Skip to content

fix(placement): close the deferred review items on the applier and the Grafana Secret check - #1028

Merged
krisztian-gajdar merged 2 commits into
mainfrom
fix/placement-deferred-review-items
Nov 26, 2026
Merged

krisztian-gajdar merged 2 commits into
mainfrom
fix/placement-deferred-review-items

Conversation

@krisztian-gajdar

@krisztian-gajdar krisztian-gajdar commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes the four non-blocking review items deferred to #903 from the #914 reviews.

Changes

Item 4: a CA directory the applier can list but not search. pools._holds_files now requires search permission on each SSL_CERT_DIR directory, checked with the effective ids where the platform supports it, before it looks for a file there. A directory with mode 0600 or 0400 used to pass the start-up check, because listing works and DirEntry.is_file() reads the type from the listing. Every gateway call then failed with CERTIFICATE_VERIFY_FAILED. Such a directory is now refused before any call, with the same error as an unusable location. A directory the applier may search but not list is still left to OpenSSL, as before. The README sentence on refused locations now says "may search and finds a file in".

Item 1: the Grafana admin Secret check in the release namespace. sie-cluster.wiredSecretKeys now checks and evaluates kube-prometheus-stack.grafana.admin.existingSecret only when Grafana reads its admin username or password from that Secret. That is the same condition the Grafana chart and the NOTES use. Before this change, a value that Grafana never evaluates, for example with GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION set or with both admin values supplied through env, could still fail the render.

Items 2 and 3: no change.

  • Item 2: YAML 1.2 post-renderers rewrite unquoted scalars such as 0o-7 and 2001-12-14. The check models sigs.k8s.io/yaml, which Helm and kubectl use, and the API server rejects both rewritten forms, so the outcome fails closed.
  • Item 3: a Secret name that starts with NBSP or U+3000 only causes an extra refusal.

Neither item can let a wrong Secret through.

Tests

  • test_a_ca_location_the_applier_may_not_search_is_refused_before_any_call gains a listable-unsearchable case. It fails without the change to pools.py and passes with it.
  • test_a_grafana_admin_secret_that_grafana_never_reads_is_not_checked_in_the_release_namespace covers 3 env forms × 2 names the check refuses. All 6 cases fail without the template change and pass with it.

Commands run:

  • pytest packages/sie_placement/tests: 1612 passed.
  • pytest tools/ci/tests/test_helm_render.py: 714 passed.
  • mise run lint: passed.
  • mise run helm -- lint: passed.

Closes #903.

…e Grafana Secret check

Refuse an SSL_CERT_DIR directory the applier can list but not search,
before any gateway call, instead of failing every call with a TLS error.

Check and evaluate kube-prometheus-stack.grafana.admin.existingSecret in
the release namespace only when Grafana reads its admin Secret, as the
NOTES already do, so a name Grafana never evaluates no longer fails the
render.

Refs #903
@krisztian-gajdar
krisztian-gajdar requested a review from a team as a code owner November 25, 2026 16:10
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 47fd558f-577a-4ebe-bc48-15d7d7cd0693
Commits

Reviewing files that changed from the base of the PR and between 0b872e1 and 345989d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The changes make Grafana admin Secret validation conditional on Secret use. They also adjust CA directory permission handling, expand its test cases, and update the related credentials documentation.

Changes: Grafana Admin Secret Validation

Layer / File(s) Summary
Conditional Grafana Secret check
deploy/helm/sie-cluster/templates/_helpers.tpl, tools/ci/tests/test_helm_render.py
The chart resolves and records Grafana admin Secret references only for credentials Grafana reads from a Secret. Render tests cover settings that bypass Secret-based passwords and existingSecret values that would otherwise fail validation.

CA Directory Search Checks

Layer / File(s) Summary
CA directory permission handling
packages/sie_placement/src/sie_placement/pools.py, packages/sie_placement/tests/test_cli.py, packages/sie_placement/README.md
_holds_files checks execute permission before scanning and handles scan errors. Tests cover unsearchable directories and an unsearchable parent. The documentation describes the refusal condition for searchable directories.

Possibly related PRs

Suggested reviewers: huronat

Merge Risk: Minimal · previous review 0b872

The change makes the Grafana admin Secret check run only when Grafana reads that Secret. It also refuses certificate directories the applier cannot search before any gateway call. No merge-blocking issues were found, and both changes come with targeted tests.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the 'fix(placement)' scope and two review items: the placement applier and the Grafana Secret check. Those two changes match the changeset. The title is a single line but uses a conven…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the 'fix(placement)' scope and two review items: the placement applier and the Grafana Secret check. Those two changes match the changeset. The title is a single line but uses a conventional-commit prefix and 'deferred review items', which is somewhat vague about the actual behavior change. It still refers to the real main changes, so it passes as partially related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 919d8970-bc5d-4108-9770-c2c86535cdfe
Commits

Reviewing files that changed from the base of the PR and between d7be537 and 0b872e1.

Files selected for processing: 5

  • deploy/helm/sie-cluster/templates/_helpers.tpl
  • packages/sie_placement/README.md
  • packages/sie_placement/src/sie_placement/pools.py
  • packages/sie_placement/tests/test_cli.py
  • tools/ci/tests/test_helm_render.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@krisztian-gajdar

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@krisztian-gajdar
krisztian-gajdar added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 30ac755 Nov 26, 2026
67 of 70 checks passed
@krisztian-gajdar
krisztian-gajdar deleted the fix/placement-deferred-review-items branch November 26, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Measured-only placement planner for worker pools (sie_placement)

1 participant