Skip to content

feat(gitops-update): support per-cluster env suffix variants (-st / -mt) - #423

Merged
bedatty merged 20 commits into
developfrom
feature/gitops-update-env-suffixes
Jun 24, 2026
Merged

bedatty merged 20 commits into
developfrom
feature/gitops-update-env-suffixes

Conversation

@ferr3ira-gabriel

@ferr3ira-gabriel ferr3ira-gabriel commented Jun 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds per-cluster env-suffix expansion to the gitops-update workflow so clusters that host multiple parallel variants per environment (e.g. Benedita with single-tenant -st and multi-tenant -mt) can be onboarded without forking the workflow.

Closes #422.

Manifest change (additive)

clusters:
  benedita:
    env_suffixes: ["-st", "-mt"]         # produces dev-st, dev-mt, stg-st, ...
    suffix_excludes_envs: ["sandbox"]    # sandbox stays bare
    apps: [...]

Both fields are optional:

Field Default Effect
env_suffixes [""] List of suffixes appended to each tag-derived env. Default preserves single-variant behavior.
suffix_excludes_envs [] Tag-derived env names that should NOT receive any suffix (stay bare).

Resolution example

Manifest: benedita declares env_suffixes: ["-st", "-mt"], suffix_excludes_envs: ["sandbox"].

Tag type Tag-derived envs Final envs for benedita
beta (v1.2.3-beta.1) dev dev-st, dev-mt
rc (v1.2.3-rc.1) stg stg-st, stg-mt
production (v1.2.3) dev stg prd sandbox dev-st, dev-mt, stg-st, stg-mt, prd-st, prd-mt, sandbox
sandbox (v1.2.3-sandbox.1) sandbox sandbox

For firmino/clotilde/anacleto (no manifest change), env_suffixes defaults to [""], so the final env list equals the tag-derived list verbatim. Byte-identical behavior to today.

Workflow changes

  1. resolve_clusters step — extended to emit a per-cluster JSON map of env_suffixes and suffix_excludes_envs resolved from the manifest (with defaults applied).

  2. apply_tags step — new helper expand_envs_for_server runs the cross-product of the tag-derived env list × the cluster's env_suffixes, with suffix_excludes_envs honored. The expanded env name flows through unchanged to:

    • Helmfile path: environments/{server}/helmfile/applications/{ENV}/{app}/values.yaml where ENV is now dev-st etc.
    • ArgoCD app name template ({server}-{app}-{env} by default) — benedita-midaz-dev-st resolves naturally with no new workflow inputs.
  3. Cross-app handling — when an app has app_helmfile_env set (e.g. forge: cross), the suffix expansion is bypassed and the sync target's env equals the override value (cross). This makes benedita-forge-cross the correct ArgoCD app name once the cross apps are renamed to follow the standard convention.

  4. Sync-matrix dedup — the updated (server, env) pairs are now de-duplicated before being emitted as the ArgoCD sync matrix. This prevents cross apps (visited once per outer env iteration) from being queued for sync multiple times.

  5. Kustomize layout — unchanged. The kustomize branch already bypasses the env list when its sentinel env (-) is in effect; expand_envs_for_server returns the input unchanged in that case.

Lint extension

src/lint/deployment-matrix/action.yml was previously validating only version, apps.registry, and clusters.<name>.apps. This PR extends it to validate:

  • env_suffixes (list of strings, unique, non-empty list)
  • suffix_excludes_envs (list of valid env names; warns if pointing at unknown env or used without env_suffixes)
  • app_helmfile_env (pre-existing field, now validated: dict whose keys must reference apps in the cluster's apps list)

Testing

Simulated the full env resolution offline against the updated manifest for all four clusters × four tag types. Output verified manually:

=== Production tag (dev stg prd sandbox) ===
firmino: dev stg prd sandbox                       # unchanged
clotilde: dev stg prd sandbox                      # unchanged
anacleto: dev stg prd sandbox                      # unchanged
benedita: dev-st dev-mt stg-st stg-mt prd-st prd-mt sandbox

=== Beta tag (dev) ===
firmino/clotilde/anacleto: dev
benedita: dev-st dev-mt

Workflow and action YAML pass actionlint clean.
Extended lint passes on the updated manifest (violations=0 warnings=0).

Out of scope

  • Per-app suffix restriction (e.g. "tenant-manager is MT-only") — to be added as app_env_suffixes in a follow-up when an actual MT-only or ST-only app emerges.
  • Renaming non-standard ArgoCD app names on Benedita (benedita-forge → benedita-forge-cross, etc.) — handled separately in the gitops repo by the cluster owner.

Reviewer checklist

  • Manifest change in config/deployment-matrix.yml reads sensibly and the schema comments make the new fields discoverable
  • Workflow diff in gitops-update.yml preserves existing behavior for firmino/clotilde/anacleto (default env_suffixes=[""] produces no env list change)
  • expand_envs_for_server correctly handles edge cases: empty ENV_CONFIG, kustomize sentinel -, missing fields
  • Sync matrix dedup uses sort -u and the resulting JSON array preserves the (server, env) shape
  • Documentation in docs/gitops-update-workflow.md describes the new fields and resolution rules
  • Lint extension in src/lint/deployment-matrix/action.yml covers the new fields and the pre-existing app_helmfile_env

Summary by CodeRabbit

  • New Features
    • Added per-cluster environment expansion via env_contexts, env_suffixes, and suffix_excludes_envs, with improved ArgoCD app-name normalization.
    • Production tag handling now conditionally includes sandbox based on the update mode.
    • Added Helmfile/env override behavior so sync targeting follows app_helmfile_env.
  • Bug Fixes
    • Deduplicated ArgoCD sync targets to avoid repeated (server, env) entries.
  • Documentation
    • Updated the GitOps workflow guide, examples, and troubleshooting to match the new env resolution rules and ArgoCD token secret naming.
  • Chores
    • Updated reusable workflow interfaces (defaulting/fallbacks, removed override inputs) and strengthened deployment-matrix validation.

Adds two additive, backward-compatible fields to the deployment matrix
manifest to express clusters that host multiple parallel variants per
environment (e.g. single-tenant -st + multi-tenant -mt on benedita):

  clusters:
    benedita:
      env_suffixes: ["-st", "-mt"]
      suffix_excludes_envs: ["sandbox"]

The gitops-update workflow expands each tag-derived env (dev/stg/prd/sandbox)
against the cluster's env_suffixes, except envs listed in suffix_excludes_envs
which stay bare. The expanded env name flows through unchanged to the helmfile
path resolution and the ArgoCD app name template, so 'benedita-midaz-dev-st'
resolves naturally without any new workflow inputs.

Cross apps (those with app_helmfile_env set, e.g. forge: cross) bypass the
suffix expansion - they update once at the override path and their sync target
uses the override env, so 'benedita-forge-cross' resolves correctly when the
cluster renames its ArgoCD apps to follow the {server}-{app}-{env} convention.

Defaults preserve byte-identical behavior for firmino/clotilde/anacleto:
env_suffixes defaults to [""] (single empty-suffix expansion), suffix_excludes_envs
defaults to []. Tag-derived env list for those clusters is unchanged.

Also extends the deployment-matrix lint action to validate the new fields
plus the pre-existing app_helmfile_env field (which was previously unvalidated).

Closes #422
@ferr3ira-gabriel
ferr3ira-gabriel requested a review from a team as a code owner June 11, 2026 17:27
@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@bedatty, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 9 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6fc88f27-a00b-44a2-8463-c8a252729df5

📥 Commits

Reviewing files that changed from the base of the PR and between b7d366b and 1bcd98e.

📒 Files selected for processing (3)
  • .github/workflows/gitops-update.yml
  • config/deployment-matrix.yml
  • docs/gitops-update-workflow.md

Walkthrough

The PR adds per-cluster environment suffix and context handling to GitOps deployment matrix resolution, updates workflow inputs and runtime sync behavior, and refreshes the matching configuration and documentation. It also removes the deprecated Firmino/Clotilde override inputs.

Changes

Environment suffix variants and context directories

Layer / File(s) Summary
Schema and validator rules
config/deployment-matrix.yml, src/lint/deployment-matrix/action.yml
The deployment matrix schema defines env_contexts, env_suffixes, and suffix_excludes_envs for clusters, documents their runtime expansion behavior, and the validator enforces list shape, duplicate detection, forbidden / characters in contexts, allowed env warnings, and app_helmfile_env membership checks.
Cluster configuration updates
config/deployment-matrix.yml
anacleto adds env_contexts: ["chaos", "fuzzing"] with env_suffixes: ["-st", "-mt"]. benedita adds env_suffixes, suffix_excludes_envs: ["sandbox"], expanded app_helmfile_env overrides for cross-directory apps, updated app membership, and refreshed registry entries.
Workflow input contract and forwarding
.github/workflows/gitops-update.yml, .github/workflows/go-release.yml
gitops-update.yml changes gitops_repository to resolve from an empty default plus runtime variables and removes the Firmino/Clotilde override inputs. go-release.yml adds deployment_matrix_ref, updates the GitOps repository and runner defaults to empty fallbacks, removes the deprecated inputs, and forwards deployment_matrix_ref downstream.
GitOps environment expansion and sync flow
.github/workflows/gitops-update.yml
The workflow resolves the effective GitOps repo from inputs or org variables, uses ${{ vars.GITOPS_RUNNERS }} for runners, validates checkout against the GitOps allowlist, skips yq installation when already present, builds ENV_CONFIG from the deployment matrix, expands environments by cluster suffix and context rules, records HELMFILE_ENV for sync tracking, deduplicates sync matrix pairs, normalizes ArgoCD app names, uses vars.ARGOCD_URL and secrets.ARGOCD_TOKEN, and skips sync when argocd app get fails.
Workflow documentation and examples
docs/gitops-update-workflow.md
The docs update secret naming, remove deprecated force-off override examples, describe env_contexts, env_suffixes, and suffix_excludes_envs, add resolution examples for Anacleto and Benedita, update app naming patterns, revise migration steps, and refresh troubleshooting examples.

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

github-config, validate, size/M

Suggested reviewers

  • bedatty
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning go-release.yml interface changes and runner/repo fallback refactors are not required by #422 and read as unrelated scope expansion. Split the go-release and other workflow-refactor changes into a separate PR unless they are required to satisfy a linked issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: per-cluster environment suffix variants for gitops-update.
Description check ✅ Passed The PR description covers the change, examples, testing, and related issues, even though it deviates from the template headings.
Linked Issues check ✅ Passed The workflow, manifest, docs, and lint changes satisfy #422's suffix-expansion requirements and preserve existing clusters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feature/gitops-update-env-suffixes

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

@lerian-studio lerian-studio added size/M PR changes 200–499 lines documentation Improvements or additions to documentation workflow Changes to one or more reusable workflow files lint Changes to linting and code quality checks deployment-matrix Changes to the canonical deployment matrix (config/deployment-matrix.yml) composite Changes to any composite action manifest (src/**/*.yml) labels Jun 11, 2026
@lerian-studio

lerian-studio commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ CodeQL Analysis Results

Languages analyzed: actions

Found 2 issue(s): 2 Medium

Severity Rule File Message
🟡 Medium actions/untrusted-checkout/medium .github/workflows/gitops-update.yml:140 Potential unsafe checkout of untrusted pull request on privileged workflow.
🟡 Medium actions/untrusted-checkout/medium .github/workflows/gitops-update.yml:148 Potential unsafe checkout of untrusted pull request on privileged workflow.

🔍 View full scan logs | 🛡️ Security tab

@lerian-studio

lerian-studio commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

🔍 PR Validation Summary

✅ PR Mergeable — no blocking failures

Check Status Blocking
Source Branch ✅ success yes
PR Title ✅ success yes
PR Description ✅ success yes
PR Size ✅ success no
Auto Labels ✅ success no
PR Metadata ✅ success no

🔍 View workflow run

@lerian-studio

lerian-studio commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

🔍 Lint Analysis

Check Files Scanned Status
YAML Lint 4 file(s) ✅ success
Action Lint 2 file(s) ✅ success
Pinned Actions 3 file(s) ✅ success
Markdown Link Check 1 file(s) ✅ success
Spelling Check 5 file(s) ✅ success
Shell Check 3 file(s) ✅ success
README Check 3 file(s) ✅ success
Composite Schema 1 file(s) ✅ success
Deployment Matrix 1 file(s) ✅ success

🔍 View full scan logs

@bedatty bedatty linked an issue Jun 19, 2026 that may be closed by this pull request
4 tasks

@coderabbitai coderabbitai 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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/gitops-update-workflow.md (1)

1-163: ⚠️ Potential issue | 🟠 Major

Add Lerian branding header to file start.

All docs/*.md files must begin with the Lerian HTML header block per repository conventions:

<table border="0"><tr><td><img src="https://github.com/LerianStudio.png" width="64" height="64"/></td><td><h1>GitOps Update Workflow</h1></td></tr></table>

Currently the file starts with a markdown heading instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/gitops-update-workflow.md` around lines 1 - 163, Add the Lerian branding
header block at the very beginning of the gitops-update-workflow.md file, before
the current markdown heading. Insert an HTML table containing the Lerian Studio
logo image (from https://github.com/LerianStudio.png with dimensions 64x64) and
the GitOps Update Workflow title. This header block should follow the repository
conventions for all docs/*.md files and precede the existing markdown content.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/gitops-update.yml:
- Around line 565-568: The early return statement triggered by the `-z
"$suffixes"` condition is exiting the function before context-based environment
expansion occurs. This causes the function to skip generating context-specific
target environments (e.g., `{context}/...` patterns) even when context expansion
is required. Restructure the logic so that the context expansion logic executes
regardless of whether suffixes is empty, either by moving the context expansion
before the early return check or by removing the early return and letting the
function continue through the context expansion logic when suffixes is empty.

---

Outside diff comments:
In `@docs/gitops-update-workflow.md`:
- Around line 1-163: Add the Lerian branding header block at the very beginning
of the gitops-update-workflow.md file, before the current markdown heading.
Insert an HTML table containing the Lerian Studio logo image (from
https://github.com/LerianStudio.png with dimensions 64x64) and the GitOps Update
Workflow title. This header block should follow the repository conventions for
all docs/*.md files and precede the existing markdown content.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: da93ccc9-3fd6-4bf8-be2a-e188e05d741d

📥 Commits

Reviewing files that changed from the base of the PR and between d91ef1b and 4202bc5.

📒 Files selected for processing (5)
  • .github/workflows/gitops-update.yml
  • .github/workflows/go-release.yml
  • config/deployment-matrix.yml
  • docs/gitops-update-workflow.md
  • src/lint/deployment-matrix/action.yml

Comment thread .github/workflows/gitops-update.yml Outdated
@lerian-studio lerian-studio added the golang Changes to Go-related workflows label Jun 23, 2026
coderabbitai[bot]
coderabbitai Bot previously requested changes Jun 23, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/gitops-update.yml (1)

247-253: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Treat removed force-off inputs as a caller-breaking API change.

deploy_in_firmino and deploy_in_clotilde were removed from the reusable workflow interface and no longer wired here; existing callers that still pass them will fail before this job starts. If this is not being released as a breaking version, keep the inputs as deprecated no-ops or provide a compatibility path. As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

Also applies to: 296-309

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 247 - 253, The inputs
`deploy_in_firmino` and `deploy_in_clotilde` have been removed from the workflow
interface, causing existing callers that still pass these inputs to fail. To
maintain backward compatibility, either re-add these inputs to the workflow's
input definitions but mark them as deprecated with a note that they are no
longer used, or implement a compatibility path that gracefully handles the
removal without breaking existing callers. This ensures a smoother migration
path rather than a hard breaking change.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/go-release.yml:
- Line 144: The workflow inputs deploy_in_firmino and deploy_in_clotilde have
been removed from the workflow_call inputs section, which breaks the contract
for any external callers still providing these inputs. To maintain backward
compatibility during a transition period, re-add deploy_in_firmino and
deploy_in_clotilde as inputs to workflow_call with type boolean, mark them as
deprecated through documentation or comments, and ensure they are accepted but
not used (no-op). Alternatively, if this is an intentional breaking change,
explicitly communicate it in release notes and version bumps rather than
silently removing the inputs.
- Line 196: The AWS_MIGRATIONS_ROLE_ARN is declared as an optional input but is
being used unconditionally in the Configure AWS credentials step, causing
failures when the secret is not provided during beta/rc/prod tag deployments.
Either mark AWS_MIGRATIONS_ROLE_ARN as required: true in the input declaration,
or add an if condition to the Configure AWS credentials step that checks whether
the AWS_MIGRATIONS_ROLE_ARN secret is present before executing the step. Choose
the approach that best fits your deployment requirements for when credential
configuration should be skipped.
- Line 432: The `enable_gitops_artifacts` field on line 432 uses the `|| true`
pattern which incorrectly coerces explicit false values to true, preventing
callers from disabling this feature. Replace the `|| true` pattern with the
correct default pattern already used on line 436 for `normalize_to_filter`,
which properly allows explicit false values to be respected. Apply the same fix
to line 444 for `helm_detect_env_changes` which has the identical issue.

In `@config/deployment-matrix.yml`:
- Around line 119-125: The comment in the Benedita configuration contradicts the
actual suffix expansion behavior. The configuration defines env_suffixes:
["-st", "-mt"] which applies the "-mt" suffix to all non-excluded base
environments (dev, stg, prd), meaning dev-mt and prd-mt are actually generated
by the current schema, not excluded. Either update the comment to correctly
state that dev-mt, stg-mt, and prd-mt are all generated by the current
configuration, or redesign the suffix_excludes_envs logic to support
per-environment suffix restrictions (e.g., excluding "-mt" only from dev and prd
while allowing it for stg) if dev-mt and prd-mt should not actually exist.

In `@docs/gitops-update-workflow.md`:
- Line 329: The description of the `<server>` parameter in the
gitops-update-workflow.md file hardcodes specific cluster names (anacleto and
benedita) which will become outdated as the deployment manifest changes. Remove
the hardcoded cluster names from this description and instead make it reference
the dynamic cluster resolution from the deployment matrix, ensuring it aligns
with the manifest-driven approach described in later examples that resolve
clusters from config/deployment-matrix.yml. The description should indicate that
servers come from the deployment matrix with optional filtering, rather than
listing specific cluster instances.

---

Outside diff comments:
In @.github/workflows/gitops-update.yml:
- Around line 247-253: The inputs `deploy_in_firmino` and `deploy_in_clotilde`
have been removed from the workflow interface, causing existing callers that
still pass these inputs to fail. To maintain backward compatibility, either
re-add these inputs to the workflow's input definitions but mark them as
deprecated with a note that they are no longer used, or implement a
compatibility path that gracefully handles the removal without breaking existing
callers. This ensures a smoother migration path rather than a hard breaking
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e384cdd-ad8e-4eb2-bb86-dd40e0e60b29

📥 Commits

Reviewing files that changed from the base of the PR and between 4202bc5 and a287ecc.

📒 Files selected for processing (4)
  • .github/workflows/gitops-update.yml
  • .github/workflows/go-release.yml
  • config/deployment-matrix.yml
  • docs/gitops-update-workflow.md

@coderabbitai coderabbitai 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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/gitops-update.yml (1)

247-253: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Treat removed force-off inputs as a caller-breaking API change.

deploy_in_firmino and deploy_in_clotilde were removed from the reusable workflow interface and no longer wired here; existing callers that still pass them will fail before this job starts. If this is not being released as a breaking version, keep the inputs as deprecated no-ops or provide a compatibility path. As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

Also applies to: 296-309

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 247 - 253, The inputs
`deploy_in_firmino` and `deploy_in_clotilde` have been removed from the workflow
interface, causing existing callers that still pass these inputs to fail. To
maintain backward compatibility, either re-add these inputs to the workflow's
input definitions but mark them as deprecated with a note that they are no
longer used, or implement a compatibility path that gracefully handles the
removal without breaking existing callers. This ensures a smoother migration
path rather than a hard breaking change.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/go-release.yml:
- Line 144: The workflow inputs deploy_in_firmino and deploy_in_clotilde have
been removed from the workflow_call inputs section, which breaks the contract
for any external callers still providing these inputs. To maintain backward
compatibility during a transition period, re-add deploy_in_firmino and
deploy_in_clotilde as inputs to workflow_call with type boolean, mark them as
deprecated through documentation or comments, and ensure they are accepted but
not used (no-op). Alternatively, if this is an intentional breaking change,
explicitly communicate it in release notes and version bumps rather than
silently removing the inputs.
- Line 196: The AWS_MIGRATIONS_ROLE_ARN is declared as an optional input but is
being used unconditionally in the Configure AWS credentials step, causing
failures when the secret is not provided during beta/rc/prod tag deployments.
Either mark AWS_MIGRATIONS_ROLE_ARN as required: true in the input declaration,
or add an if condition to the Configure AWS credentials step that checks whether
the AWS_MIGRATIONS_ROLE_ARN secret is present before executing the step. Choose
the approach that best fits your deployment requirements for when credential
configuration should be skipped.
- Line 432: The `enable_gitops_artifacts` field on line 432 uses the `|| true`
pattern which incorrectly coerces explicit false values to true, preventing
callers from disabling this feature. Replace the `|| true` pattern with the
correct default pattern already used on line 436 for `normalize_to_filter`,
which properly allows explicit false values to be respected. Apply the same fix
to line 444 for `helm_detect_env_changes` which has the identical issue.

In `@config/deployment-matrix.yml`:
- Around line 119-125: The comment in the Benedita configuration contradicts the
actual suffix expansion behavior. The configuration defines env_suffixes:
["-st", "-mt"] which applies the "-mt" suffix to all non-excluded base
environments (dev, stg, prd), meaning dev-mt and prd-mt are actually generated
by the current schema, not excluded. Either update the comment to correctly
state that dev-mt, stg-mt, and prd-mt are all generated by the current
configuration, or redesign the suffix_excludes_envs logic to support
per-environment suffix restrictions (e.g., excluding "-mt" only from dev and prd
while allowing it for stg) if dev-mt and prd-mt should not actually exist.

In `@docs/gitops-update-workflow.md`:
- Line 329: The description of the `<server>` parameter in the
gitops-update-workflow.md file hardcodes specific cluster names (anacleto and
benedita) which will become outdated as the deployment manifest changes. Remove
the hardcoded cluster names from this description and instead make it reference
the dynamic cluster resolution from the deployment matrix, ensuring it aligns
with the manifest-driven approach described in later examples that resolve
clusters from config/deployment-matrix.yml. The description should indicate that
servers come from the deployment matrix with optional filtering, rather than
listing specific cluster instances.

---

Outside diff comments:
In @.github/workflows/gitops-update.yml:
- Around line 247-253: The inputs `deploy_in_firmino` and `deploy_in_clotilde`
have been removed from the workflow interface, causing existing callers that
still pass these inputs to fail. To maintain backward compatibility, either
re-add these inputs to the workflow's input definitions but mark them as
deprecated with a note that they are no longer used, or implement a
compatibility path that gracefully handles the removal without breaking existing
callers. This ensures a smoother migration path rather than a hard breaking
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e384cdd-ad8e-4eb2-bb86-dd40e0e60b29

📥 Commits

Reviewing files that changed from the base of the PR and between 4202bc5 and a287ecc.

📒 Files selected for processing (4)
  • .github/workflows/gitops-update.yml
  • .github/workflows/go-release.yml
  • config/deployment-matrix.yml
  • docs/gitops-update-workflow.md
🛑 Comments failed to post (5)
.github/workflows/go-release.yml (3)

144-144: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Breaking caller contract by removing workflow inputs

Line 144 removes deploy_in_firmino and deploy_in_clotilde from workflow_call. Callers still sending these keys will fail validation at dispatch time. Keep deprecated no-op inputs for a transition window or ship this only with explicit breaking-change release signaling.

As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/go-release.yml at line 144, The workflow inputs
deploy_in_firmino and deploy_in_clotilde have been removed from the
workflow_call inputs section, which breaks the contract for any external callers
still providing these inputs. To maintain backward compatibility during a
transition period, re-add deploy_in_firmino and deploy_in_clotilde as inputs to
workflow_call with type boolean, mark them as deprecated through documentation
or comments, and ensure they are accepted but not used (no-op). Alternatively,
if this is an intentional breaking change, explicitly communicate it in release
notes and version bumps rather than silently removing the inputs.

Source: Path instructions


196-196: 🩺 Stability & Availability | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/go-release.yml"

echo "== workflow_call.secrets block =="
sed -n '190,206p' "$FILE"

echo
echo "== S3 credential bootstrap step =="
sed -n '308,320p' "$FILE"

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1280


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/go-release.yml"

echo "== Full secrets block (190-215) =="
sed -n '190,215p' "$FILE"

echo
echo "== S3 upload job context (295-330) =="
sed -n '295,330p' "$FILE"

echo
echo "== Input declarations for s3_uploads =="
sed -n '1,100p' "$FILE" | grep -A 20 's3_uploads' || echo "No s3_uploads in first 100 lines, searching broader..."
rg 's3_uploads' "$FILE" -B 2 -A 10 --no-heading | head -50

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 4570


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/go-release.yml"

echo "== Looking for s3-upload composite reference =="
grep -n "s3-upload" "$FILE" || echo "No direct reference found"

echo
echo "== Check if src/ has composite actions =="
find . -name "action.yml" -o -name "action.yaml" | head -20

echo
echo "== If s3-upload composite exists =="
find . -path "*/s3-upload/*" -o -path "*/s3*upload*" 2>/dev/null | grep -E "\.(yml|yaml)$" | head -10

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1617


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== s3-upload.yml workflow (first 100 lines) =="
sed -n '1,100p' ".github/workflows/s3-upload.yml"

echo
echo "== Search for aws_role_arn or role-arn in s3-upload.yml =="
grep -n "role-arn\|aws_role\|AWS_ROLE" ".github/workflows/s3-upload.yml" || echo "No aws_role_arn field found"

echo
echo "== Full inputs section of s3-upload.yml =="
sed -n '/^  inputs:/,/^  /p' ".github/workflows/s3-upload.yml" | head -80

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 4168


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/go-release.yml"

echo "== Full Configure AWS credentials step (line 312-317) =="
sed -n '312,325p' "$FILE"

echo
echo "== Check step condition and surrounding context =="
sed -n '305,330p' "$FILE"

echo
echo "== Verify AWS_MIGRATIONS_ROLE_ARN secret declaration =="
sed -n '190,210p' "$FILE" | grep -A 1 "AWS_MIGRATIONS_ROLE_ARN"

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1946


Make AWS_MIGRATIONS_ROLE_ARN secret required or guard credential setup on secret presence

AWS_MIGRATIONS_ROLE_ARN is declared as optional (line 196) but unconditionally referenced in the Configure AWS credentials step (line 316). When a tag matches an environment pattern (beta/rc/prod), the step runs and fails if the secret is not provided. Either mark the secret required: true or add an explicit condition to skip credential setup when the secret is absent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/go-release.yml at line 196, The AWS_MIGRATIONS_ROLE_ARN is
declared as an optional input but is being used unconditionally in the Configure
AWS credentials step, causing failures when the secret is not provided during
beta/rc/prod tag deployments. Either mark AWS_MIGRATIONS_ROLE_ARN as required:
true in the input declaration, or add an if condition to the Configure AWS
credentials step that checks whether the AWS_MIGRATIONS_ROLE_ARN secret is
present before executing the step. Choose the approach that best fits your
deployment requirements for when credential configuration should be skipped.

432-432: 🎯 Functional Correctness | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In GitHub Actions expression syntax, what does ${{ false || true }}evaluate to, and what pattern preserves explicitfalsewhile defaulting undefined totrue?

💡 Result:

${{ false || true }} evaluates to true. Reason: In GitHub Actions expressions, the logical OR operator (||) returns the value that corresponds to the first truthy operand; since the left operand is false (falsy) and the right operand is true (truthy), the overall expression evaluates to true [1][2]. Pattern to preserve explicit false while defaulting undefined to true: Use inputs.<name> || true is NOT safe for preserving an explicit false, because false is falsy and would be replaced by true. Instead, use the “explicit false” pattern based on ternary-like short-circuiting: ${{ inputs.<name> == false && false || true }} Explanation: If the input is explicitly false, the inputs.<name> == false predicate is true, so the left branch yields false; otherwise (including true and undefined), it yields true [2].

Citations:


🏁 Script executed:

# First, locate and inspect the workflow file
fd -name "go-release.yml" .github/workflows/ -x cat -n {} | head -100

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 413


🏁 Script executed:

# Search for the problematic pattern around lines 432 and 444
fd -name "go-release.yml" .github/workflows/ -x sed -n '425,450p' {}

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 413


🏁 Script executed:

# Check if there are other instances of the same problematic pattern in the file
fd -name "go-release.yml" .github/workflows/ -x rg "|| true" {} -n

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 413


🏁 Script executed:

# Locate the workflow file
find .github/workflows -name "go-release.yml"

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 215


🏁 Script executed:

# Inspect lines around 432 and 444
sed -n '425,450p' .github/workflows/go-release.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1627


🏁 Script executed:

# Search for the || true pattern
grep -n "|| true" .github/workflows/go-release.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 356


🏁 Script executed:

# Check the full context around those lines and see if there are other similar patterns
sed -n '420,460p' .github/workflows/go-release.yml | cat -n

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 2456


🏁 Script executed:

# Search for all instances of the pattern used on line 435 (toJSON comparison)
grep -n "toJSON.*== 'false'" .github/workflows/go-release.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 293


🏁 Script executed:

# Search for all || true and || false patterns
grep -n "||" .github/workflows/go-release.yml | head -20

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1597


Fix boolean defaults to allow explicit false on lines 432 and 444

The || true pattern coerces explicit false to true, preventing callers from disabling enable_gitops_artifacts and helm_detect_env_changes. The file already uses the correct pattern on line 436 (normalize_to_filter); apply it consistently here.

Required changes
-      enable_gitops_artifacts: ${{ matrix.group.enable_gitops_artifacts || true }}
+      enable_gitops_artifacts: ${{ toJSON(matrix.group.enable_gitops_artifacts) == 'false' && 'false' || 'true' }}
-      helm_detect_env_changes: ${{ matrix.group.helm_detect_env_changes || true }}
+      helm_detect_env_changes: ${{ toJSON(matrix.group.helm_detect_env_changes) == 'false' && 'false' || 'true' }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/go-release.yml at line 432, The `enable_gitops_artifacts`
field on line 432 uses the `|| true` pattern which incorrectly coerces explicit
false values to true, preventing callers from disabling this feature. Replace
the `|| true` pattern with the correct default pattern already used on line 436
for `normalize_to_filter`, which properly allows explicit false values to be
respected. Apply the same fix to line 444 for `helm_detect_env_changes` which
has the identical issue.
config/deployment-matrix.yml (1)

119-125: 🎯 Functional Correctness | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's read the actual file to see the context around lines 119-125
cat -n config/deployment-matrix.yml | sed -n '110,135p'

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1596


🏁 Script executed:

# Also check the overall structure of the file to understand the benedita section
ast-grep outline config/deployment-matrix.yml --view expanded

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 225


🏁 Script executed:

# Search for how env_suffixes and suffix_excludes_envs are used elsewhere
rg "env_suffixes|suffix_excludes_envs" -A 2 -B 2

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Look for references to dev-mt, prd-mt, stg-mt in the repository
rg "dev-mt|prd-mt|stg-mt" --type yml --type yaml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 210


🏁 Script executed:

# Search for files that reference env_suffixes or deployment-matrix
rg "env_suffixes|deployment-matrix" -l

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Look for workflow files that might process the benedita configuration
fd "\.ya?ml$" --type f | head -20

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 915


🏁 Script executed:

# Search for references to benedita and how it's used
rg "benedita" --type yaml --type yml -B 2 -A 2

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 210


🏁 Script executed:

# Check if there's any code that processes the deployment matrix
rg "dev-mt|prd-mt" -r

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 596


🏁 Script executed:

# Search for deployment-matrix usage in shell/JavaScript files
rg "deployment-matrix" -A 3 -B 3

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Look for any scripts that process environment suffixes
rg "env_suffix" -A 2 -B 2

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Check if there's any conditional logic for different environments in the codebase
rg "dev-st|stg-st|prd-st" -A 2 -B 2

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Look at the full benedita section to understand the context better
sed -n '119,200p' config/deployment-matrix.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 1967


🏁 Script executed:

# Search for any references to mt (multi-tenant) across the entire repo
rg "\-mt" | head -30

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Check the log from the -mt search to see if there were any results
tail -100 /tmp/coderabbit-shell-logs/shell-output-2yRspn

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 182


🏁 Script executed:

# Look for workflow files that might use the deployment-matrix
find . -name "*.yml" -o -name "*.yaml" | xargs grep -l "benedita" 2>/dev/null | head -10

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 291


🏁 Script executed:

# Check if there's a script or action that processes deployment-matrix
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.sh" \) | xargs grep -l "deployment-matrix" 2>/dev/null

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 186


🏁 Script executed:

# Look at the entire deployment-matrix.yml structure
head -150 config/deployment-matrix.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 7117


🏁 Script executed:

# Check the gitops-update workflow to see how env_suffixes is actually processed
sed -n '1,100p' .github/workflows/gitops-update.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 5038


🏁 Script executed:

# Look at the deployment-matrix action to understand how it processes the config
cat src/lint/deployment-matrix/action.yml

Repository: LerianStudio/github-actions-shared-workflows

Length of output: 11156


Resolve the Benedita suffix contract mismatch.

Line 122 states dev-mt and prd-mt do not exist, but env_suffixes: ["-st", "-mt"] applies -mt to every non-excluded base env. The schema documentation confirms this expansion behavior: all tag-derived envs (dev/stg/prd/sandbox) receive all suffixes unless listed in suffix_excludes_envs. With current config, production tags will generate dev-mt, stg-mt, and prd-mt deployments, contradicting the comment.

The app_helmfile_env per-app override does not provide per-env suffix control—it skips suffixes entirely for that app. Either update the comment if dev-mt and prd-mt exist, or implement per-env suffix configuration before enabling -mt globally.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/deployment-matrix.yml` around lines 119 - 125, The comment in the
Benedita configuration contradicts the actual suffix expansion behavior. The
configuration defines env_suffixes: ["-st", "-mt"] which applies the "-mt"
suffix to all non-excluded base environments (dev, stg, prd), meaning dev-mt and
prd-mt are actually generated by the current schema, not excluded. Either update
the comment to correctly state that dev-mt, stg-mt, and prd-mt are all generated
by the current configuration, or redesign the suffix_excludes_envs logic to
support per-environment suffix restrictions (e.g., excluding "-mt" only from dev
and prd while allowing it for stg) if dev-mt and prd-mt should not actually
exist.
docs/gitops-update-workflow.md (1)

329-329: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Keep the <server> description fully manifest-driven.

The hard-coded anacleto/benedita snapshot will drift as soon as the manifest changes, and it clashes with the later examples that resolve a different cluster set from config/deployment-matrix.yml.

♻️ Proposed fix
-- `<server>`: any cluster resolved from the deployment matrix (current set: `anacleto`, `benedita`), minus those force-off via `deploy_in_<cluster>: false`
+- `<server>`: any cluster resolved from the deployment matrix, minus those force-off via `deploy_in_<cluster>: false`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

- `<server>`: any cluster resolved from the deployment matrix, minus those force-off via `deploy_in_<cluster>: false`
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/gitops-update-workflow.md` at line 329, The description of the
`<server>` parameter in the gitops-update-workflow.md file hardcodes specific
cluster names (anacleto and benedita) which will become outdated as the
deployment manifest changes. Remove the hardcoded cluster names from this
description and instead make it reference the dynamic cluster resolution from
the deployment matrix, ensuring it aligns with the manifest-driven approach
described in later examples that resolve clusters from
config/deployment-matrix.yml. The description should indicate that servers come
from the deployment matrix with optional filtering, rather than listing specific
cluster instances.

@lerian-studio lerian-studio added size/L PR changes 500–999 lines and removed size/M PR changes 200–499 lines labels Jun 23, 2026

@coderabbitai coderabbitai 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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/go-release.yml (1)

117-139: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Keep go-release callers compatible or document the breaking migration.

This wrapper also removed the Firmino/Clotilde force-off inputs and changed GitOps defaults, but docs/go-release-workflow.md still lists the old inputs and fixed defaults. Existing go-release callers following those docs will pass invalid inputs or rely on missing org variables. Keep deprecated inputs until the next breaking release, or update the docs and release notes with an explicit migration path. As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

Also applies to: 469-475

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/go-release.yml around lines 117 - 139, The go-release
workflow has removed inputs for Firmino/Clotilde force-off and changed GitOps
defaults, but the documentation in docs/go-release-workflow.md still references
the old inputs and defaults, causing existing callers to break. Either restore
the removed inputs (like Firmino/Clotilde force-off controls) as deprecated with
warnings until the next major release to maintain backward compatibility, or
update docs/go-release-workflow.md with explicit migration instructions for all
removed/renamed inputs (such as the changes to update_sandbox,
gitops_artifact_pattern, gitops_yaml_key_mappings, deployment_matrix_ref, and
gitops_runner_type) and document this as a breaking change in release notes.

Source: Path instructions

.github/workflows/gitops-update.yml (1)

4-21: 🗄️ Data Integrity & Integration | 🟠 Major

Update docs for removed deploy_in_* inputs and mark as breaking change.

Inputs deploy_in_firmino and deploy_in_clotilde have been removed from the workflow definition, but the documentation still references them:

  • docs/go-release-workflow.md:58-59 — parameter table lists both removed inputs
  • docs/gitops-update-workflow.md:438-439 — example code passes the removed inputs

External callers relying on these inputs will fail silently on workflow call (GitHub rejects unknown inputs). Either retain the inputs with deprecation warnings until a major version bump, or update all caller docs and examples immediately and document this as a breaking change per the path guidelines: "Flag any removed or renamed input/output as a breaking change for callers."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 4 - 21, The workflow inputs
deploy_in_firmino and deploy_in_clotilde have been removed from the workflow
definition, but documentation still references them in two locations:
docs/go-release-workflow.md (lines 58-59) in the parameter table and
docs/gitops-update-workflow.md (lines 438-439) in the example code. To fix this,
either retain these inputs with deprecation warnings in the workflow definition
and update documentation to note deprecation, or remove all references to these
inputs from both documentation files and mark this as a breaking change in the
workflow documentation and release notes to inform external callers that they
must update their calls to this workflow.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/gitops-update.yml:
- Around line 48-50: The runner input has an empty string as default, which
causes runs-on to be empty when neither the input parameter nor the
GITOPS_RUNNERS environment variable is provided, resulting in job scheduling
failures. Update the default value from an empty string to include a fallback
chain that allows the input and GITOPS_RUNNERS variable to override, but
ultimately defaults to blacksmith-4vcpu-ubuntu-2404 as the concrete runner.
Apply this same fallback pattern to all job definitions in the workflow that
reference the runner input (also at lines 102 and 842).

---

Outside diff comments:
In @.github/workflows/gitops-update.yml:
- Around line 4-21: The workflow inputs deploy_in_firmino and deploy_in_clotilde
have been removed from the workflow definition, but documentation still
references them in two locations: docs/go-release-workflow.md (lines 58-59) in
the parameter table and docs/gitops-update-workflow.md (lines 438-439) in the
example code. To fix this, either retain these inputs with deprecation warnings
in the workflow definition and update documentation to note deprecation, or
remove all references to these inputs from both documentation files and mark
this as a breaking change in the workflow documentation and release notes to
inform external callers that they must update their calls to this workflow.

In @.github/workflows/go-release.yml:
- Around line 117-139: The go-release workflow has removed inputs for
Firmino/Clotilde force-off and changed GitOps defaults, but the documentation in
docs/go-release-workflow.md still references the old inputs and defaults,
causing existing callers to break. Either restore the removed inputs (like
Firmino/Clotilde force-off controls) as deprecated with warnings until the next
major release to maintain backward compatibility, or update
docs/go-release-workflow.md with explicit migration instructions for all
removed/renamed inputs (such as the changes to update_sandbox,
gitops_artifact_pattern, gitops_yaml_key_mappings, deployment_matrix_ref, and
gitops_runner_type) and document this as a breaking change in release notes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 818b5f95-36d7-49f4-8a6e-4d0306891398

📥 Commits

Reviewing files that changed from the base of the PR and between 99236a1 and 90c96a2.

📒 Files selected for processing (2)
  • .github/workflows/gitops-update.yml
  • .github/workflows/go-release.yml

Comment thread .github/workflows/gitops-update.yml Outdated
Comment thread .github/workflows/gitops-update.yml Fixed

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/gitops-update.yml (2)

4-21: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Treat the removed workflow inputs as a breaking caller contract.

Removing deploy_in_firmino and deploy_in_clotilde makes existing callers that still pass those with: keys fail workflow validation. Either keep them as deprecated no-op inputs for compatibility, or mark this release as breaking and update the workflow docs that still publish those inputs and the old gitops_repository default. As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 4 - 21, The workflow has
removed the inputs deploy_in_firmino and deploy_in_clotilde without maintaining
backward compatibility, which breaks existing callers passing these keys via
with:. Either restore these inputs as no-op boolean inputs in the workflow_call
inputs section (with appropriate deprecation notes in their descriptions) to
maintain caller compatibility, or document this as a breaking change in the
release notes and update any workflow documentation that references the old
gitops_repository default behavior and these removed inputs.

Source: Path instructions


192-204: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Move yq_version through env before using it in shell.

Line 199 expands a caller-controlled workflow input directly into the run: script. A quoted value can break the shell assignment before validation. Map it through env, validate the tag shape, and only skip installation when the existing binary matches the requested version. As per coding guidelines, “Never interpolate untrusted user input directly into run: commands. Pass untrusted values through environment variables instead.”

Proposed fix
       - name: Install yq
         shell: bash
+        env:
+          YQ_VERSION: ${{ inputs.yq_version }}
         run: |
           set -euo pipefail
-          if command -v yq &>/dev/null; then
+          if [[ ! "$YQ_VERSION" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
+            echo "::error::Invalid yq_version '$YQ_VERSION'. Expected vX.Y.Z."
+            exit 1
+          fi
+          if command -v yq &>/dev/null && yq --version | grep -q "version ${YQ_VERSION}$"; then
             echo "yq already installed: $(yq --version)"
           else
-            YQ_VERSION="${{ inputs.yq_version }}"
             YQ_BIN="yq_linux_amd64"
             YQ_URL="https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${YQ_BIN}"
             sudo curl -L "$YQ_URL" -o /usr/local/bin/yq
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 192 - 204, The "Install yq"
step directly interpolates the caller-controlled input.yq_version into the shell
run command, which is a security risk. Instead, pass the yq_version input
through the env section of the step, then reference it as an environment
variable (like $YQ_VERSION) within the shell script. Add validation to ensure
the version tag is in an expected format before using it in the download URL,
and update the version check logic to compare the requested version against the
output of the already-installed yq binary (if present) to determine whether
reinstallation is needed.

Sources: Coding guidelines, Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/gitops-update.yml:
- Around line 4-21: The workflow has removed the inputs deploy_in_firmino and
deploy_in_clotilde without maintaining backward compatibility, which breaks
existing callers passing these keys via with:. Either restore these inputs as
no-op boolean inputs in the workflow_call inputs section (with appropriate
deprecation notes in their descriptions) to maintain caller compatibility, or
document this as a breaking change in the release notes and update any workflow
documentation that references the old gitops_repository default behavior and
these removed inputs.
- Around line 192-204: The "Install yq" step directly interpolates the
caller-controlled input.yq_version into the shell run command, which is a
security risk. Instead, pass the yq_version input through the env section of the
step, then reference it as an environment variable (like $YQ_VERSION) within the
shell script. Add validation to ensure the version tag is in an expected format
before using it in the download URL, and update the version check logic to
compare the requested version against the output of the already-installed yq
binary (if present) to determine whether reinstallation is needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f35c6e0a-511c-4fb1-9652-941669b96328

📥 Commits

Reviewing files that changed from the base of the PR and between 90c96a2 and 69b5f51.

📒 Files selected for processing (2)
  • .github/workflows/gitops-update.yml
  • .github/workflows/go-release.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/go-release.yml

@bedatty bedatty self-assigned this Jun 24, 2026
Comment thread .github/workflows/gitops-update.yml Fixed

@coderabbitai coderabbitai 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.

Warning

CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.

Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.

👉 Steps to fix this

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
docs/gitops-update-workflow.md (2)

115-115: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

gitops_repository default is out of sync with workflow behavior.

Line 115 still documents a fixed default repo, but the workflow contract in this PR moved to empty input + runtime/org fallback resolution. This is a caller-facing interface mismatch and can mislead adopters during upgrades.

Suggested doc fix
-| `gitops_repository` | string | `LerianStudio/midaz-firmino-gitops` | GitOps repository to update |
+| `gitops_repository` | string | `""` | GitOps repository to update. When empty, falls back to org-level variable/default resolution in the workflow runtime. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/gitops-update-workflow.md` at line 115, The documented default for
gitops_repository is out of sync with the workflow behavior; update the
gitops_repository entry in gitops-update-workflow.md to reflect that the input
is now empty by default and resolved at runtime using the org fallback logic.
Make sure the docs match the workflow contract introduced in this PR, and keep
the description aligned with the actual behavior of the gitops_repository
handling.

283-283: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Anacleto statement contradicts the new section above.

Line 283 says Anacleto behavior is byte-identical when fields are absent, but this same doc now introduces explicit env_contexts/env_suffixes behavior for Anacleto. Keep only unchanged clusters in this sentence, or reword as a conditional generic rule.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/gitops-update-workflow.md` at line 283, The Anacleto wording conflicts
with the new env_contexts/env_suffixes behavior described above, so update this
sentence to avoid claiming byte-identical behavior when those fields are absent.
Keep the unchanged cluster names only if the rule still applies universally, or
rephrase it as a generic conditional statement that matches the documented
default behavior in the same section.
.github/workflows/gitops-update.yml (3)

890-907: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Fail fast when ArgoCD connection inputs are missing.

After switching to vars.ARGOCD_URL and secrets.ARGOCD_TOKEN, an unset var/secret becomes an empty CLI argument. The current argocd app get handling converts that misconfiguration into a warning and exits 0, so sync can be silently skipped.

Proposed fix
           set -uo pipefail
 
+          if [[ -z "$ARGOCD_URL" || -z "$ARGOCD_TOKEN" ]]; then
+            echo "::error::enable_argocd_sync requires vars.ARGOCD_URL and secrets.ARGOCD_TOKEN to be set."
+            exit 1
+          fi
+
           PRUNE_FLAG=""
           if [[ "$ARGOCD_PRUNE" == "true" ]]; then
             PRUNE_FLAG="--prune"
           fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 890 - 907, Fail fast in the
GitOps update step when ARGOCD_URL or ARGOCD_TOKEN is missing instead of letting
argocd app get proceed with empty arguments and return a warning. In the
workflow run block that uses ARGOCD_URL, ARGOCD_TOKEN, and APP_NAME, add an
explicit validation before calling argocd app get and exit nonzero with a clear
error if either input is unset/empty, so the resolve_argocd_app and sync path
cannot silently skip due to misconfiguration.

4-21: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Treat the removed callable inputs as a breaking API change.

deploy_in_firmino, deploy_in_clotilde, and runner_type were removed from the workflow_call surface, so existing external callers that still pass them will fail before the workflow starts. If this is not a semver-breaking release, keep deprecated compatibility inputs and preserve the force-off filtering path for one release; otherwise document and release it as breaking. As per path instructions, “Flag any removed or renamed input/output as a breaking change for callers.”

Also applies to: 46-47, 260-264, 306-320

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 4 - 21, The workflow_call
surface in gitops-update.yml has removed caller-facing inputs, which is a
breaking API change for external reusable workflow consumers. In the workflow
definition and any related input handling paths, restore backward-compatible
deprecated inputs for deploy_in_firmino, deploy_in_clotilde, and runner_type,
and keep the existing force-off filtering behavior in the update logic
(including the reusable workflow’s input mapping and component selection flow)
so old callers still work for one release. If compatibility is not intended,
make sure the change is explicitly treated and documented as a breaking release
for callers.

Source: Path instructions


196-205: 🩺 Stability & Availability | 🟠 Major

Require the requested yq version before skipping install. command -v yq accepts any runner-provided binary, so a preinstalled v3/custom build can bypass inputs.yq_version and break the later yq -o=json / strenv() calls. Compare yq --version against the requested version, or always install the requested release.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/gitops-update.yml around lines 196 - 205, The yq install
check is too permissive because command -v yq will skip installation for any
preinstalled binary, even if it is the wrong major/version for the later yq
-o=json and strenv() usage. Update the install logic in the workflow step that
references inputs.yq_version and yq --version so it verifies the existing yq
matches the requested version before skipping, or otherwise always download and
install the requested release into ~/.local/bin.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/gitops-update-workflow.md`:
- Line 35: The GitOps workflow docs incorrectly list ARGOCD_URL as a required
secret, but the runtime resolves the ArgoCD URL from org/repo variables while
only ARGOCD_TOKEN is secret-backed. Update the required-secrets wording in the
workflow guide to remove ARGOCD_URL from the secrets list and clearly document
that the URL comes from variables, matching the behavior in the GitOps workflow
documentation section.

---

Outside diff comments:
In @.github/workflows/gitops-update.yml:
- Around line 890-907: Fail fast in the GitOps update step when ARGOCD_URL or
ARGOCD_TOKEN is missing instead of letting argocd app get proceed with empty
arguments and return a warning. In the workflow run block that uses ARGOCD_URL,
ARGOCD_TOKEN, and APP_NAME, add an explicit validation before calling argocd app
get and exit nonzero with a clear error if either input is unset/empty, so the
resolve_argocd_app and sync path cannot silently skip due to misconfiguration.
- Around line 4-21: The workflow_call surface in gitops-update.yml has removed
caller-facing inputs, which is a breaking API change for external reusable
workflow consumers. In the workflow definition and any related input handling
paths, restore backward-compatible deprecated inputs for deploy_in_firmino,
deploy_in_clotilde, and runner_type, and keep the existing force-off filtering
behavior in the update logic (including the reusable workflow’s input mapping
and component selection flow) so old callers still work for one release. If
compatibility is not intended, make sure the change is explicitly treated and
documented as a breaking release for callers.
- Around line 196-205: The yq install check is too permissive because command -v
yq will skip installation for any preinstalled binary, even if it is the wrong
major/version for the later yq -o=json and strenv() usage. Update the install
logic in the workflow step that references inputs.yq_version and yq --version so
it verifies the existing yq matches the requested version before skipping, or
otherwise always download and install the requested release into ~/.local/bin.

In `@docs/gitops-update-workflow.md`:
- Line 115: The documented default for gitops_repository is out of sync with the
workflow behavior; update the gitops_repository entry in
gitops-update-workflow.md to reflect that the input is now empty by default and
resolved at runtime using the org fallback logic. Make sure the docs match the
workflow contract introduced in this PR, and keep the description aligned with
the actual behavior of the gitops_repository handling.
- Line 283: The Anacleto wording conflicts with the new
env_contexts/env_suffixes behavior described above, so update this sentence to
avoid claiming byte-identical behavior when those fields are absent. Keep the
unchanged cluster names only if the rule still applies universally, or rephrase
it as a generic conditional statement that matches the documented default
behavior in the same section.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 06c5375a-561d-4d0b-9413-0530e4099a02

📥 Commits

Reviewing files that changed from the base of the PR and between 69b5f51 and b7d366b.

📒 Files selected for processing (2)
  • .github/workflows/gitops-update.yml
  • docs/gitops-update-workflow.md

Comment thread docs/gitops-update-workflow.md Outdated
@bedatty
bedatty dismissed coderabbitai[bot]’s stale review June 24, 2026 14:05

All comments addressed: env_contexts early return fixed, runner fallback added, ARGOCD_URL moved to variables in docs, Lerian branding header added.

@bedatty
bedatty merged commit 0928cad into develop Jun 24, 2026
2 checks passed
@github-actions
github-actions Bot deleted the feature/gitops-update-env-suffixes branch June 24, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

composite Changes to any composite action manifest (src/**/*.yml) deployment-matrix Changes to the canonical deployment matrix (config/deployment-matrix.yml) documentation Improvements or additions to documentation golang Changes to Go-related workflows lint Changes to linting and code quality checks size/L PR changes 500–999 lines workflow Changes to one or more reusable workflow files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitops-update: support per-cluster env suffix variants (-st / -mt) for benedita

4 participants