Skip to content

docs(monitoring): correct the release name the OIDC comment, guide and test fixture encode - #3468

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
cozystack:mainfrom
youdie006:docs/3338-monitoring-release-name
Oct 11, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
cozystack:mainfrom
youdie006:docs/3338-monitoring-release-name

Conversation

@youdie006

@youdie006 KBS (youdie006) commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

The Grafana OIDC clientId, audience-scope name, client-secret name and users-Job name are all derived from the Monitoring release name. In a running cluster that release is always monitoring-system: the tenant chart's outer HelmRelease monitoring points at extra/monitoring, whose templates/helmrelease.yaml creates the inner HelmRelease {{ .Release.Name }}-system that carries system/monitoring and renders OIDC. There is no release named monitoring that renders OIDC.

Three places encoded a release named monitoring (i.e. <ns>-monitoring, where a cluster renders <ns>-monitoring-system), per #3338:

  • packages/system/monitoring/templates/_helpers.tpl header comment — both example lines were wrong. The per-tenant release is monitoring-system, and the platform Grafana lives in the tenant-root namespace, not cozy-monitoring. (cozy-monitoring only hosts the ExternalName services that redirect to the platform stack the root tenant hosts in tenant-root — see packages/system/cozystack-basics/templates/monitoring-external-services.yaml.)
  • docs/oidc-grafana.md — placed the platform release in cozy-monitoring; it lives in tenant-root. It also named the per-tenant release monitoring; that is monitoring-system too, so both instances now read monitoring-system and differ only by namespace.
  • packages/system/monitoring/tests/oidc_test.yaml — the suite pinned release.name: monitoring, so its clientId / audience-scope / client-secret / users-Job assertions pinned names no cluster renders. Both fixtures are set to monitoring-system and the derived expected values updated to what a cluster actually renders.

Nothing changes at runtime — the templates are self-consistent whatever the release is called; this only aligns the descriptions and the test fixture with reality.

Out of scope here (from the issue, left for a maintainer decision):

Verification, rebased on current main: helm unittest -f 'tests/oidc_test.yaml' packages/system/monitoring — 39/39 pass; the whole monitoring chart passes as well. After setting the fixtures I updated only the assertions helm-unittest reported as newly diverging.

Disclosure: prepared with AI assistance; I reviewed the change and verified the release-name topology against the source files cited above.

Screenshots

N/A — no UI changes.

Downstream repositories

Walked the trigger map in docs/agents/contributing.md against the diff, file by file. The three changed paths are a system/monitoring chart _helpers.tpl comment, the repo-internal docs/oidc-grafana.md, and a chart test fixture. None match a listed trigger: no change under packages/apps/ or packages/extra/, no packages/core/platform/values.yaml, and no variant/bundle/component/release-asset/Talos/tooling change. So no downstream repository is mechanically affected. (The website's own OIDC page referenced in cozystack/website#597 is a separate artifact the reporter is already engaged with, outside this repo's trigger map.)

  • No downstream repository is affected by this change

Release note

docs(monitoring): correct the release name (`monitoring-system`) and platform namespace (`tenant-root`) encoded in the Grafana OIDC helper comment, the OIDC guide, and the chart test fixture.

Summary by CodeRabbit

  • Documentation
    • Clarified that both platform and tenant Grafana instances use the monitoring-system release name. The platform instance runs in tenant-root, while tenant instances run in their respective tenant namespaces.
    • Updated the OIDC integration guidance to reflect the platform namespace and tenant release naming.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot added area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) kind/documentation Categorizes issue or PR as related to documentation size/M This PR changes 30-99 lines, ignoring generated files labels Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

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

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1b2cd6f9-4fa8-4892-949b-86e56204baa2

📥 Commits

Reviewing files that changed from the base of the PR and between cfb61db and b7708fb.


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. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7ae807b5-c4a8-4f1c-8111-ac69ab67da66



📥 Commits

Reviewing files that changed from the base of the PR and between 140e718 and cd392d2.



📒 Files selected for processing (3)
  • docs/oidc-grafana.md
  • packages/system/monitoring/templates/_helpers.tpl
  • packages/system/monitoring/tests/oidc_test.yaml


🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/oidc-grafana.md
  • packages/system/monitoring/templates/_helpers.tpl


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




📝 Walkthrough
📝 Walkthrough

Walkthrough

Grafana OIDC documentation, helper comments, and monitoring tests now use monitoring-system naming and identify tenant-root as the platform namespace.

Changes

Monitoring OIDC naming

Layer / File(s) Summary
OIDC naming references
docs/oidc-grafana.md, packages/system/monitoring/templates/_helpers.tpl, packages/system/monitoring/tests/oidc_test.yaml
Documentation, helper examples, and test release names use monitoring-system and the tenant-root namespace.
Rendered OIDC expectations
packages/system/monitoring/tests/oidc_test.yaml
Expected Keycloak scopes, audience values, client credential Secret names, Grafana OIDC values, and the users Job name use the updated names.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other



Merge Risk: ⚪ Minimal · up to cd392

The documented platform and tenant Grafana naming matches the checked-in deployment path. No actionable merge-blocking risk is established.

Architecture Summary

Architecture risk: 🔵 Low · up to cd392

The change affects 2 systems.

Changed systems: packages/system, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/system (library) was modified; 2 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/oidc-grafana.md: The deployment description now identifies both instances as monitoring-system, places the platform instance in tenant-root, and contrasts it with one instance per tenant namespace. It replaces the prior cozy-monitoring platform namespace and monitoring tenant release description.
  • observed — Modified behavior in packages/system/monitoring/templates/_helpers.tpl: The examples now use tenant-foo/monitoring-system for per-tenant Grafana and tenant-root/monitoring-system for platform Grafana, replacing the previous tenant-foo/monitoring and cozy-monitoring/monitoring-system examples.
  • observed — Modified behavior in packages/system/monitoring/tests/oidc_test.yaml: The baseline release name changes from monitoring to monitoring-system.
  • observed — Modified behavior in packages/system/monitoring/tests/oidc_test.yaml: The Keycloak client-secret reference and default audience scope expectations now use release-qualified names containing monitoring-system instead of monitoring.


🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
Title check ✅ Passed The title clearly identifies the monitoring OIDC release-name correction across the comment, guide, and test fixture. It matches the main changes.



✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR




Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4da6df5906

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread docs/oidc-grafana.md Outdated

Cozystack ships one Grafana codebase deployed twice: as
`monitoring-system` in the platform's `cozy-monitoring` namespace and as
`monitoring-system` in the platform's `tenant-root` namespace and as

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Join the edited Markdown paragraph onto one line

The edited paragraph remains split across lines 3–8, but this repository requires Markdown prose paragraphs to use one continuous line; join the paragraph rather than changing only one wrapped line.

AGENTS.md reference: AGENTS.md:L81-L81

Useful? React with 👍 / 👎.

Comment thread docs/oidc-grafana.md Outdated

Cozystack ships one Grafana codebase deployed twice: as
`monitoring-system` in the platform's `cozy-monitoring` namespace and as
`monitoring-system` in the platform's `tenant-root` namespace and as

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct the tenant release name in the same paragraph

For every non-root tenant, the next line still claims that Grafana is deployed as monitoring. However, packages/extra/monitoring/templates/helmrelease.yaml:4 names the inner release {{ .Release.Name }}-system, and the built-in outer release is monitoring, so the Grafana-rendering release is monitoring-system, as the updated helper now states. Leaving this unchanged preserves the exact release-name error this commit intends to correct and gives operators the wrong OIDC resource-name prefix.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOT LGTM, one blocker, and it is a one-line fix.

The diff corrects line 4 of the opening paragraph but leaves line 5 saying the tenant instance is released as monitoring. That is the same error this PR exists to remove: the per-tenant Grafana is monitoring-system as well, and only the namespace differs between the two instances. The chain is packages/apps/tenant/templates/monitoring.yaml creating HR monitoring in the tenant namespace, then packages/extra/monitoring/templates/helmrelease.yaml creating the inner HR {{ .Release.Name }}-system which carries system/monitoring and sets neither releaseName nor targetNamespace, so Flux defaults the release name to monitoring-system. The root tenant goes through that same path, which is exactly why the platform and tenant instances differ by namespace only. After this commit the guide and the helper comment contradict each other on that point.

An operator following line 5 would compute <ns>-monitoring, <ns>-monitoring-audience, monitoring-oidc-client and monitoring-oidc-users, all four wrong.

Everything else holds up. I re-derived the chain independently, and the eight OIDC-derived names in the fixture plus both entries in the helper comment are correct. I also checked that the rename does not make the fixture vacuous: patching the clientId helper to drop the namespace still fails two tests, and the nested-tenant case keeps namespace and release name as distinct inputs. helm unittest packages/system/monitoring passes on your head commit, 6 suites and 47 tests.

While rewriting that sentence, please join the paragraph into a single line. Markdown prose here is one line per paragraph, and the fix rewrites both wrapped lines anyway.

Non-blocking, and not something I expect this PR to absorb: five of the seven fixtures under packages/system/monitoring/tests/ still declare release.name: monitoring, and only storage_pvc_label_test.yaml uses monitoring-system. Nothing renders wrong today because no assertion in the other files depends on the release name, but it is the same drift a few files over and worth a follow-up.

Thanks for picking this up, it needed doing.

Comment thread docs/oidc-grafana.md Outdated
Cozystack ships one Grafana codebase deployed twice: as
`monitoring-system` in the platform's `cozy-monitoring` namespace and as
`monitoring-system` in the platform's `tenant-root` namespace and as
`monitoring` in every tenant namespace. Both instances opt in to OIDC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the other half of the same error. The per-tenant release is monitoring-system too, so as written this now contradicts the _helpers.tpl comment that the same commit fixes.

@youdie006

Copy link
Copy Markdown
Contributor Author

Thanks - you're right, I was too conservative on that line. Fixed in f7cec70: both instances are now described as monitoring-system differing only by namespace (platform in tenant-root, per-tenant in each tenant namespace), and the paragraph is joined into a single line. helm unittest packages/system/monitoring still passes (6 suites, 47 tests) on the new head.

On the non-blocking note: agreed - the other five fixtures under packages/system/monitoring/tests/ still declare release.name: monitoring while only storage_pvc_label_test.yaml uses monitoring-system. Since nothing renders wrong there today (no assertion depends on the release name) and you flagged it as a separate follow-up, I've kept it out of this PR. Happy to open a follow-up to align those fixtures if you'd like.

@youdie006

Copy link
Copy Markdown
Contributor Author

This was addressed in f7cec70 (pushed after your review): the opening paragraph is now a single line and both instances read monitoring-system — the per-tenant instance is monitoring-system too, differing from the platform one only by namespace (tenant-root vs the tenant namespace). Line 5's stale monitoring is gone. Could you take another look?

@youdie006
KBS (youdie006) force-pushed the docs/3338-monitoring-release-name branch from f7cec70 to 140e718 Compare August 29, 2026 00:55
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KBS (@youdie006) NOT LGTM. The docs fix itself is right now. What is left is text that would land in main with it, plus a rebase.

The blocker from my last review is fixed: the guide's opening paragraph describes both instances as monitoring-system and is one line. On a trial merge with current main the monitoring chart tests pass, 16 suites and 119 tests.

Three things before this can merge, none of them code:

  1. The PR body becomes the merge commit message, and two parts of it are no longer true. The docs/oidc-grafana.md bullet says the release name there "was already correct, so only the namespace is changed", but the diff now also changes the tenant instance from monitoring to monitoring-system. The CodeRabbit summary at the end lists "New Features" and says resource identifiers were renamed, which contradicts "Nothing changes at runtime" above it. Please fix the bullet and delete the generated block. The bot adds it back on every push, so edit the body after you push. Also, the OIDC suite has 39 tests on current main, so "37/37" will be stale after the rebase.
  2. The body says the change was prepared with AI assistance, but commit 140e718 has no Assisted-by: LLM trailer. The contributing guide asks for exactly one on a commit an AI tool helped with.
  3. Please rebase onto current main when you amend. The E2E Tests and pre-commit runs on this head are from 2026-08-29, when CI was broken for every fork PR (fixed on 2026-09-27). This change has never had a real CI run.

@youdie006

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and added the Assisted-By: trailer in the format from docs/agents/contributing.md. In the description I fixed the docs/oidc-grafana.md bullet and the OIDC test count (39 now), and removed the generated summary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KBS (@youdie006) NOT LGTM, and the trailer is the only reason. Commit cd392d2 carries Assisted-By: Claude <[email protected]>, and the contributing guide lists exactly this line as a blocker: the value has to be LLM, with no model or vendor name. Please amend it to Assisted-by: LLM and force-push. The Commit trailers CI job fails on it as well, it just has not run yet because the fork runs are waiting for approval.

Everything else from my last review is done. The patch is the same one I reviewed, now rebased. On a trial merge with current main the monitoring chart tests pass, 23 suites and 301 tests.

@youdie006
KBS (youdie006) force-pushed the docs/3338-monitoring-release-name branch from cd392d2 to cfb61db Compare October 10, 2026 23:56
@youdie006

Copy link
Copy Markdown
Contributor Author

Amended and force-pushed: cfb61db now carries Assisted-by: LLM in place of the vendor trailer. Only the message changed; the tree is identical to cd392d2.

…d test fixture encode

The naming block in _helpers.tpl, the guide's opening paragraph and the
oidc test fixture all describe the per-tenant Grafana as the release
`monitoring`. Both instances are released as `monitoring-system` by the
monitoring application and differ only by namespace: the platform one in
`tenant-root`, a per-tenant one in each tenant namespace.

Assisted-by: LLM
Signed-off-by: youdie006 <[email protected]>
@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the docs/3338-monitoring-release-name branch from cfb61db to b7708fb Compare October 11, 2026 15:32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KBS (@youdie006) LGTM, thanks. The trailer is fixed and nothing else changed. I rebased the branch onto current main so CI runs on a fresh base.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 76a4af9 into cozystack:main Oct 11, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) kind/documentation Categorizes issue or PR as related to documentation size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants