Skip to content

Add test: TO ALL settings profile path of the allow_feature_tier access check untested - #124969

Merged
Algunenano merged 2 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr119472
Oct 13, 2026
Merged

Algunenano merged 2 commits into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr119472

Conversation

@clickgapai

@clickgapai clickgapai commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Test-only PR. Review: are the gaps real, is the test right.

Adds test coverage for 1 untested code path, found during automated review of PR #119472.
That PR: (1) PR 119472 moves allow_feature_tier enforcement for access entities into AccessControl (insert/update/remove/move/restore compare effective settings before vs after via resolveEffectiveSettings.cpp), checks removed constrained settings (checkRemovedSettings), makes profile-element …

1. TO ALL settings profile path of the allow_feature_tier access check untested
src/Access/resolveEffectiveSettings.cpp:355, src/Access/resolveEffectiveSettings.cpp:396
Risk: - AccessControl::updateImpl / removeImpl -> checkFeatureTierForPendingAccessEntities -> AccessGraph::findAffectedEntities. - A TO ALL profile has empty to_roles.ids; its users are reached only through profiles_targeting_all (resolveEffectiveSettings.cpp:353-357, :394-400). The …
Unique vs PR tests: PR's test_allow_feature_tier covers TO <user> assignment and dropping a TO <user> profile, never TO ALL / TO ALL EXCEPT. This test also runs statelessly through clickhouse-local (same -- --allow_feature_tier route as the PR's own 05293) instead of a config reload. Alternative …

cc @Algunenano (author of #119472) — could you take a look, and add the can be tested label if this looks good?

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Workflow [PR]
Sync PR [sync-upstream/pr/124969]

Version info

  • Merged into: 26.10.1.2306-master (included in 26.10 and later)

@clickgapai

Copy link
Copy Markdown
Contributor Author
Pre-PR validation: 6/6 ✅

a) Deterministic repro? ✅
Test exercises the previously-uncovered branch and passes (correct behaviour).

b) Root cause explained? ✅
src/Access/resolveEffectiveSettings.cpp:353-357 (if (profile->to_roles.all) -> profiles_targeting_all) and :394-400 (if (profiles_targeting_all.contains(id)) -> add_all(users), add_all(roles)) never executed in CI.

c) Fix matches root cause? ✅
N/A for coverage gap — this PR adds a regression test, not a fix. Asserts current correct behaviour at the cited line.

d) Test intent preserved? / New tests added? ✅
New regression test added: 05345_feature_tier_settings_profile_to_all.sh.

e) Both directions demonstrated? ✅
Test passes (MATCH) on master proving current correctness; would fail if the cited branch regressed. Single-direction is the correct shape for a coverage gap test.

f) Fix is general, not a narrow patch? ✅
Test asserts the invariant at the cited line — covers the branch, not a specific input shape.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 9, 2026
@Algunenano Algunenano self-assigned this Oct 13, 2026
@Algunenano Algunenano added the can be tested Allows running workflows for external contributors label Oct 13, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [b5b003c]

Summary: ✅


AI Review

Summary

This PR adds a focused stateless regression test for the allow_feature_tier enforcement path where a settings profile targets TO ALL / TO ALL EXCEPT, covering both the ALTER SETTINGS PROFILE ... TO ... update path and the DROP SETTINGS PROFILE removal path through persisted clickhouse-local access storage. The test matches the contract described in the PR, uses still-EXPERIMENTAL settings on both the assignment and removal cases, and I did not find an unresolved correctness or coverage issue in the new assertions.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 13, 2026
…le_to_all

`allow_experimental_kusto_dialect` is now `BETA` on master, so dropping a profile with it is no longer refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano
Algunenano enabled auto-merge October 13, 2026 14:02
@Algunenano
Algunenano added this pull request to the merge queue Oct 13, 2026
Merged via the queue into ClickHouse:master with commit 11b99c0 Oct 13, 2026
176 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 13, 2026
@clickhouse-gh clickhouse-gh Bot added comp-rbac Authorization: roles, grants, quotas, row-level security, access checks. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-rbac Authorization: roles, grants, quotas, row-level security, access checks. pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants