Skip to content

fix(chart): rename plugins.existingSecret - #650

Merged
uniqueg merged 2 commits into
devfrom
fix/chart-plugin-store-value
Nov 3, 2026
Merged

uniqueg merged 2 commits into
devfrom
fix/chart-plugin-store-value

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Renames the chart value plugins.existingSecret to pluginStore.existingSecret while foca-common 0.4.0 is unpublished. Gateway app charts use top-level plugins for their own settings and render them into the config overlay, so the old name needed a special case in each of them. The environment variable FOCA_PLUGINS_STORE_KEY_SECRET and FOCA's setting stay.

Also, in the pages this touches:

  • A checklist for app charts going from foca-common 0.2.0 to 0.4.0 in the migration guide.
  • A caveat in "Several replicas": a worker of an old pod that respawns late in a rollout can change the configured access control rules.

Closes #644

How it was verified

  • pytest charts/foca-common/tests with Helm 3.22.1: 275 passed, including a new test that top-level plugins values are ignored.
  • helm lint --strict for both charts and all petstore CI values: passed.
  • ruff check, ruff format --check, mkdocs build --strict: passed.
  • Full review (charts): adversarial-reviewer and quality-reviewer, one round.

Declined review findings

  • Move the rollout caveat to its own PR (quality, medium): declined. It belongs to the same page, and the issue and this body name it. The reviewer's question whether a respawned worker re-runs startup is answered: foca/gunicorn_config.py doesn't preload, so it does.

The quality reviewer's other medium (versions in the checklist) was docs wording, fixed in a docs-only commit, so no second round.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

Summary by Sourcery

Rename the common chart’s plugin-store secret value to pluginStore.existingSecret and update chart validation, tests, examples, and migration documentation accordingly.

Bug Fixes:

  • Prevent the common Helm chart from interpreting app-specific top-level plugins values as the plugin-store secret configuration.

Enhancements:

  • Rename the Helm value for an existing plugin-store secret from plugins.existingSecret to pluginStore.existingSecret while preserving the existing environment variable and FOCA setting.
  • Clarify Helm chart behavior and add migration guidance for upgrading app charts from foca-common 0.2.0 to 0.4.0.
  • Document the access-control rule consistency risk caused by late-respawning workers during rollouts.

Documentation:

  • Update plugin-store and Helm chart documentation to use pluginStore.existingSecret and explain the migration and rollout caveats.

Tests:

  • Add coverage confirming top-level plugins values are ignored and validate the renamed pluginStore values.

uniqueg and others added 2 commits November 3, 2026 10:42
Read the secret of the plugin store from pluginStore.existingSecret.
Gateway app charts use top-level plugins for their own settings and
render them into the config overlay, where FOCA refuses unknown keys.
Renaming is cheap only while foca-common 0.4.0 is unpublished. The
environment variable and FOCA's setting stay.

Add a checklist for app charts going from foca-common 0.2.0 to 0.4.0
to the migration guide, and a caveat on configured access control
rules during a rollout to the Helm docs.

Closes #644

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
State the values of app charts once, name the chart versions in the
checklist, and say that a late start can also drop a new rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR separates plugin-store Secret configuration from application-owned top-level plugins values by renaming the Helm value to pluginStore.existingSecret, updates templates, schemas, tests, examples, and documentation accordingly, and adds migration and rollout guidance for chart users.

File-Level Changes

Change Details Files
Rename the chart value used for the plugin-store Secret while preserving FOCA’s existing environment-variable contract.
  • Read pluginStore.existingSecret when rendering FOCA_PLUGINS_STORE_KEY_SECRET.
  • Update validation, error messages, examples, and chart-facing documentation to use the new value.
  • Keep the plugin-store secret separate from top-level application-owned plugins settings.
charts/foca-common/app-values.schema.json
charts/foca-common/templates/_helpers.tpl
charts/foca-common/tests/test_templates.py
examples/petstore/chart/values.schema.json
examples/petstore/chart/values.yaml
docs/configuration/plugins.md
docs/helm-chart.md
docs/migration-0.20.md
Extend chart tests to cover the renamed value and prevent accidental interpretation of application plugin settings.
  • Update existing Secret rendering and schema rejection tests for pluginStore.
  • Add coverage proving top-level plugins.existingSecret is ignored by the common chart.
  • Verify invalid plugin-store values are rejected and overlay secrets still fail with the updated guidance.
charts/foca-common/tests/test_templates.py
Document the foca-common chart migration path and rollout behavior affecting configured access-control rules.
  • Add a checklist for upgrading app charts from foca-common 0.2.0 to 0.4.0, including schemas, replicas, probes, and gateway plugin-store values.
  • Document that late-respawning workers from old pods can restore stale access-control rules.
  • Recommend restarting pods after rollouts that change configured rules.
docs/migration-0.20.md
docs/helm-chart.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0223366) to head (7ac234b).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #650   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         7142      7142           
=========================================
  Hits          7142      7142           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 3, 2026 10:01

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!

Linked issues

#644 fix(chart): rename plugins.existingSecret · 3 of 3 met

# Requirement Status Notes
1 Rename the value to pluginStore.existingSecret in templates, schema, petstore example, tests, migration guide and Helm docs; keep the environment variable and app setting unchanged. ✅ Met The templates and schemas use pluginStore.existingSecret, the example, tests and docs are updated, and FOCA_PLUGINS_STORE_KEY_SECRET plus plugins.defaults.store.key_secret remain unchanged.
2 Add a checklist for app charts going from foca-common 0.2.0 to 0.4.0 covering replicas and budget, probes, and plugin store. ✅ Met The migration guide checklist covers the foca-common dependency and schema, replicas and disruption budget, probes, and the plugin-store value.
3 Add a caveat on configured access control rules during a rollout to “Several replicas”. ✅ Met The “Several replicas” section explains how a late-starting worker from an old pod can restore a revoked rule or drop a newly added one, and advises restarting pods after old ones are gone.

Sourcery assessment

Needs a human reviewer. If a deployment still supplies plugins.existingSecret, the chart will no longer pass that secret to the app or worker, so plugin-store hashes may change and existing entries can become unreachable. Setting the secret under pluginStore.existingSecret restores the prior key, but any records written while it was missing may remain under different keys.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit ac58395 into dev Nov 3, 2026
80 checks passed
@uniqueg
uniqueg deleted the fix/chart-plugin-store-value branch November 3, 2026 10:16
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.

fix(chart): rename plugins.existingSecret

1 participant