Skip to content

fix: sort provider secrets and weaviate env vars alphabetically for deterministic Helm rendering#3621

Open
BearTS wants to merge 1 commit into
05-20-chore_show_warning_if_using_default_password_for_postgres_and_redisfrom
05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff
Open

fix: sort provider secrets and weaviate env vars alphabetically for deterministic Helm rendering#3621
BearTS wants to merge 1 commit into
05-20-chore_show_warning_if_using_default_password_for_postgres_and_redisfrom
05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff

Conversation

@BearTS
Copy link
Copy Markdown
Contributor

@BearTS BearTS commented May 20, 2026

Summary

Helm chart templates that iterate over maps (provider secrets and Weaviate env vars) were producing non-deterministic ordering, which causes unnecessary diff noise and potential reconciliation churn in GitOps workflows. This change enforces alphabetical ordering when ranging over these maps.

Changes

  • Provider secrets in deployment.yaml and stateful.yaml now iterate over providerSecrets keys sorted alphabetically before looking up each value
  • Weaviate environment variables in weaviate-deployment.yaml now iterate over env keys sorted alphabetically before looking up each value

Type of change

  • Bug fix
  • Refactor
  • Feature
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Render the Helm templates and verify that environment variables appear in a consistent, alphabetically sorted order across multiple renders:

helm template bifrost ./helm-charts/bifrost --values your-values.yaml

Run the render multiple times and confirm the output is identical each time, with env vars appearing in alphabetical order.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

No security implications. This change only affects the ordering of environment variable declarations in rendered Kubernetes manifests.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

Warning

Rate limit exceeded

@BearTS has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 40 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f82b8938-798e-499f-864d-33fd29321eac

📥 Commits

Reviewing files that changed from the base of the PR and between da12406 and 1f323bc.

📒 Files selected for processing (3)
  • helm-charts/bifrost/templates/deployment.yaml
  • helm-charts/bifrost/templates/stateful.yaml
  • helm-charts/bifrost/templates/weaviate-deployment.yaml
📝 Walkthrough

Walkthrough

Three Helm deployment templates are updated to iterate over map keys in sorted alphabetical order rather than using direct map traversal. This ensures deterministic, consistent ordering of environment variables and provider secrets in rendered manifests across the deployment, stateful, and weaviate-deployment templates.

Changes

Deterministic Map Iteration for Environment Variables and Secrets

Layer / File(s) Summary
Sorted map iteration across templates
helm-charts/bifrost/templates/deployment.yaml, helm-charts/bifrost/templates/stateful.yaml, helm-charts/bifrost/templates/weaviate-deployment.yaml
Three templates update their environment variable and provider secrets loops from direct map iteration to sorting keys alphabetically and indexing into the maps. Deployment and StatefulSet templates iterate over sorted provider secret keys; Weaviate template sorts environment variable keys. The set of rendered variables remains unchanged; only the order is now deterministic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through template maps so vast,
Sorting keys to make the order fast!
No more chaos, just alphabets aligned,
Determinism now is what we find. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: sorting provider secrets and Weaviate environment variables alphabetically for deterministic Helm rendering, which directly matches the code changes across all three templates.
Description check ✅ Passed The description provides a clear summary, documents the specific changes made to three template files, includes testing instructions, and addresses breaking changes and security considerations as required by the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff

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

@BearTS BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from 46fbf6e to da12406 Compare May 20, 2026 10:56
@BearTS BearTS force-pushed the 05-20-chore_show_warning_if_using_default_password_for_postgres_and_redis branch from 8815e31 to 11715a3 Compare May 20, 2026 10:56
@BearTS BearTS changed the title chore: sort keys to avoid unneccessary kubernetes rollouts on diff fix: sort provider secrets and weaviate env vars alphabetically for deterministic Helm rendering May 20, 2026
@BearTS BearTS marked this pull request as ready for review May 20, 2026 10:59
@BearTS BearTS requested a review from a team as a code owner May 20, 2026 10:59
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Confidence Score: 5/5

Safe to merge — the change is a mechanical, well-scoped refactor of three Helm range loops with no functional side effects.

All three templates apply the standard keys | sortAlpha + root-context index $ pattern correctly. Iterating over an empty or nil map with keys is safe (returns an empty list), so there are no edge-case regressions. The fix is identical in structure across all changed files and does not touch any rendered values, only their order.

No files require special attention.

Important Files Changed

Filename Overview
helm-charts/bifrost/templates/deployment.yaml Switched provider-secrets range to iterate over alphabetically sorted keys using `keys
helm-charts/bifrost/templates/stateful.yaml Identical provider-secrets sorting fix as deployment.yaml. Correct Helm pattern; no issues found.
helm-charts/bifrost/templates/weaviate-deployment.yaml Weaviate env map now iterated over sorted keys via `keys

Reviews (4): Last reviewed commit: "chore: sort keys to avoid unneccessary k..." | Re-trigger Greptile

@BearTS BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from da12406 to 2dffd87 Compare May 20, 2026 11:45
@BearTS BearTS force-pushed the 05-20-chore_show_warning_if_using_default_password_for_postgres_and_redis branch 2 times, most recently from 4faf3e1 to 08770b6 Compare May 20, 2026 12:04
@BearTS BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from 2dffd87 to 4ea46e8 Compare May 20, 2026 12:04
@BearTS BearTS force-pushed the 05-20-chore_sort_keys_to_avoid_unneccessary_kubernetes_rollouts_on_diff branch from 4ea46e8 to 1f323bc Compare May 20, 2026 17:50
@BearTS BearTS force-pushed the 05-20-chore_show_warning_if_using_default_password_for_postgres_and_redis branch from 08770b6 to 1ae5ae6 Compare May 20, 2026 17:50
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.

1 participant