Skip to content

fix(ci): empty tag inputs no longer override values.yaml image settings#77

Merged
CodeByNikolas merged 3 commits intomainfrom
fix/empty-tag-no-override-main-only
Mar 18, 2026
Merged

fix(ci): empty tag inputs no longer override values.yaml image settings#77
CodeByNikolas merged 3 commits intomainfrom
fix/empty-tag-no-override-main-only

Conversation

@CodeByNikolas
Copy link
Copy Markdown
Contributor

@CodeByNikolas CodeByNikolas commented Mar 17, 2026

Summary

Cherry-pick of commit 57c6981 onto a clean base from main.

This is a targeted single-commit PR containing only the CI empty-tag fix, with no unrelated commits from feature branches.

Changes

  • Change theia_cloud_tag and ide_images_tag defaults from 'latest' to ''
  • Update input descriptions to clarify empty means no override
  • deploy-pr.yml: forward empty tags as-is (remove || 'latest' fallback)
  • deploy-theia.yml: apply --set image overrides only when tag is non-empty, otherwise leave values.yaml settings untouched; add set -euo pipefail

Additional fix (latest commit)

  • deploy-pr.yml: removed the environment selector from workflow_dispatch inputs entirely. Manual dispatch now always triggers all three environment jobs (test1, test2, test3) unconditionally. Per-environment approvals configured in GitHub Environment settings remain the gate before each deployment runs.

Replaces

PR #76 (fix/empty-tag-no-override → main) which was closed because it incorrectly included 13 unrelated commits from its branch ancestry.

Summary by CodeRabbit

  • Chores
    • Deployment now uses configuration defaults when image tag inputs are left empty.
    • Removed per-environment gating so deployments trigger on PRs or manual dispatch without environment-specific conditions.
    • Tag inputs are passed through as provided (no implicit "latest" fallback).
    • Improved reliability with stricter runtime checks and streamlined command logic for conditional tag overrides.

- Change theia_cloud_tag and ide_images_tag defaults from 'latest' to ''
- Update input descriptions to clarify empty means no override
- deploy-pr.yml: forward empty tags as-is (remove || 'latest' fallback)
- deploy-theia.yml: apply --set image overrides only when tag is non-empty,
  otherwise leave values.yaml settings untouched; add set -euo pipefail
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

Updated GitHub Actions deployment workflows to allow empty image-tag inputs to defer to Helm values.yaml (removed 'latest' defaults), removed per-environment gating in PR-triggered deploy jobs, and added stricter shell error handling plus conditional Helm override logic that only applies when tags are provided.

Changes

Cohort / File(s) Summary
PR deploy workflow
.github/workflows/deploy-pr.yml
Removed environment multi-choice input and per-environment gating; changed theia_cloud_tag and ide_images_tag defaults from "latest" to "" and updated descriptions to indicate empty values defer to values.yaml; pass raw inputs through to deploy-theia.yml.
Theia deploy job / Helm invocation
.github/workflows/deploy-theia.yml
Added set -euo pipefail; introduced a base HELM_CMD array and built conditional logic to append image tag overrides only when THEIA_CLOUD_TAG or IDE_IMAGES_TAG are non-empty; replaced monolithic helm invocation with "${HELM_CMD[@]}".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHubActions as Actions
    participant Runner
    participant DeployScript as deploy-theia.yml
    participant Helm
    participant K8s as Kubernetes
    User->>Actions: open PR / workflow_dispatch
    Actions->>Runner: start jobs (deploy-test*)
    Runner->>DeployScript: execute deploy steps (with inputs)
    DeployScript->>DeployScript: build HELM_CMD (conditionally append tag overrides if non-empty)
    DeployScript->>Helm: helm upgrade --install "${HELM_CMD[@]}"
    Helm->>K8s: apply chart / image tags
    K8s-->>Helm: status
    Helm-->>Runner: exit status
    Runner-->>Actions: job result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • lukaskratzel
  • Mtze

Poem

🐰 Hop, hop — tags left blank, I say,
Values.yaml leads the way.
Shells are strict, commands aligned,
Helm only overrides when tags are signed.
A little hop to CI bliss today! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: preventing empty tag inputs from overriding values.yaml settings, which is the core fix across both modified workflow files.
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 fix/empty-tag-no-override-main-only
📝 Coding Plan
  • Generate coding plan for human review comments

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

❤️ Share

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CI workflows so that empty tag inputs no longer override image settings defined in values.yaml. Previously, the defaults were 'latest', which would always override values.yaml settings even when no tag was intended. Now, empty strings are the default and image overrides are applied conditionally.

Changes:

  • Default values for theia_cloud_tag and ide_images_tag changed from 'latest' to '' in both deploy-pr.yml and deploy-theia.yml, with updated descriptions.
  • deploy-pr.yml no longer applies || 'latest' fallbacks when forwarding tag inputs.
  • deploy-theia.yml restructured to build the Helm command as a bash array, conditionally appending image overrides only when tags are non-empty, and adds set -euo pipefail for safer script execution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/deploy-pr.yml Change tag defaults to empty, remove 'latest' fallbacks, update descriptions
.github/workflows/deploy-theia.yml Change tag defaults to empty, conditionally apply image overrides via bash array, add set -euo pipefail

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When dispatching manually, selecting 'all' (the new default) triggers
all three deploy-test* jobs in a single run. Each job is still gated
by its individual environment approval, so operators can approve only
the environments they want without having to re-trigger the workflow
for each one.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy-theia.yml:
- Around line 255-268: Add fallback definitions for the four preload images that
are only conditionally set by IDE_IMAGES_TAG so deployments still preload them
when IDE_IMAGES_TAG is empty: add default entries for theia-cloud.preloading
images corresponding to java-17-no-ls, rust-no-ls, langserver-java and
langserver-rust (the same images referenced by the HELM_CMD --set lines
theia-cloud.preloading.images[7] through images[10]) into the base or
environment-specific values files (or set equivalent
theia-appdefinitions.defaultImageTag fallbacks) so they exist even when
IDE_IMAGES_TAG is not provided.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 977e28b3-c0ed-4508-bcb2-bbd985a32b03

📥 Commits

Reviewing files that changed from the base of the PR and between 34d6830 and f5205db.

📒 Files selected for processing (2)
  • .github/workflows/deploy-pr.yml
  • .github/workflows/deploy-theia.yml

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes CI deployment workflows so that empty image tag inputs no longer override the values.yaml image settings with an empty string. Previously, the theia_cloud_tag and ide_images_tag inputs defaulted to 'latest' and were always passed as --set overrides, meaning values.yaml settings could never take effect. Now, the defaults are empty strings and --set image overrides are conditionally applied only when a tag is explicitly provided.

Changes:

  • Change input defaults from 'latest' to '' in both deploy-theia.yml and deploy-pr.yml, and remove the || 'latest' fallback expressions when forwarding tags.
  • Make Helm --set image overrides conditional on non-empty tag values in deploy-theia.yml, using a bash array to build the command incrementally. Also adds set -euo pipefail for robustness.
  • Remove the environment choice input from deploy-pr.yml so manual dispatch always triggers all three environment jobs (gated by environment approvals).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/deploy-theia.yml Defaults tags to empty, conditionally applies --set image overrides, adds set -euo pipefail
.github/workflows/deploy-pr.yml Defaults tags to empty, removes `

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/deploy-pr.yml (2)

42-54: Add a permissions block to follow the principle of least privilege.

CodeQL flags that this workflow does not limit the permissions of the GITHUB_TOKEN. Since this workflow calls a reusable workflow (deploy-theia.yml) that likely needs specific permissions, you should explicitly declare only what's required at the workflow or job level. This prevents over-privileged tokens if the workflow or called workflows are compromised.

🔒 Proposed fix: Add minimal permissions block

Add a top-level permissions block after line 13 (after name:), or within each job. Example at workflow level:

name: Deploy PR to Environment

permissions:
  contents: read
  # Add other permissions as needed by deploy-theia.yml (e.g., id-token: write for OIDC)

If the reusable workflow requires additional permissions (like id-token: write for cloud authentication), add those explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-pr.yml around lines 42 - 54, Add an explicit
permissions block to limit GITHUB_TOKEN scope for this workflow (or at least the
deploy-test1 job) instead of using default full permissions; update the workflow
(near the top-level name or inside the deploy-test1 job) to specify only the
minimum permissions required by the reusable workflow deploy-theia.yml (for
example contents: read and id-token: write if OIDC is needed) so the
deploy-test1 job and inputs like theia_cloud_tag/ide_images_tag only run with
least privilege.

43-43: Redundant conditions can be simplified.

The condition github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' is always true since the workflow only triggers on these two events (defined in the on: block). The jobs will run regardless.

That said, this is a minor nit—keeping explicit conditions can serve as defensive documentation if additional triggers are added later.

♻️ Optional: Remove redundant conditions

If you prefer brevity, you can remove the if: clauses entirely since the on: block already constrains execution:

  deploy-test1:
-   if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
    name: Deploy to Test1

Apply similarly to deploy-test2 and deploy-test3.

Also applies to: 61-61, 79-79

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy-pr.yml at line 43, The conditional "if:
github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'"
in the deploy jobs is redundant because the workflow's on: block already
restricts triggers; remove that if: clause from the deploy job(s) (the lines
matching "if: github.event_name == 'pull_request' || github.event_name ==
'workflow_dispatch'") — apply the same removal for the deploy-test,
deploy-test2, and deploy-test3 job definitions so the jobs rely on the on:
triggers, or alternatively keep a single concise comment above the job
explaining the defensive intent if you want to preserve explicitness.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/deploy-pr.yml:
- Around line 42-54: Add an explicit permissions block to limit GITHUB_TOKEN
scope for this workflow (or at least the deploy-test1 job) instead of using
default full permissions; update the workflow (near the top-level name or inside
the deploy-test1 job) to specify only the minimum permissions required by the
reusable workflow deploy-theia.yml (for example contents: read and id-token:
write if OIDC is needed) so the deploy-test1 job and inputs like
theia_cloud_tag/ide_images_tag only run with least privilege.
- Line 43: The conditional "if: github.event_name == 'pull_request' ||
github.event_name == 'workflow_dispatch'" in the deploy jobs is redundant
because the workflow's on: block already restricts triggers; remove that if:
clause from the deploy job(s) (the lines matching "if: github.event_name ==
'pull_request' || github.event_name == 'workflow_dispatch'") — apply the same
removal for the deploy-test, deploy-test2, and deploy-test3 job definitions so
the jobs rely on the on: triggers, or alternatively keep a single concise
comment above the job explaining the defensive intent if you want to preserve
explicitness.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3614d3cb-9454-4d06-a7b0-6fa810e79357

📥 Commits

Reviewing files that changed from the base of the PR and between f5205db and 06092d8.

📒 Files selected for processing (1)
  • .github/workflows/deploy-pr.yml

Copy link
Copy Markdown
Contributor

@lukaskratzel lukaskratzel left a comment

Choose a reason for hiding this comment

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

Great change

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.

3 participants