Skip to content

Fixing the string replacement in the helm chart to update the tag instead of the image#144

Merged
m-seidel merged 4 commits into
mainfrom
fixing_helm_chart_replacement
Jun 2, 2026
Merged

Fixing the string replacement in the helm chart to update the tag instead of the image#144
m-seidel merged 4 commits into
mainfrom
fixing_helm_chart_replacement

Conversation

@m-seidel
Copy link
Copy Markdown
Contributor

@m-seidel m-seidel commented Jun 2, 2026

Type of Change

  • Bugfix
  • Enhancement / new feature
  • Refactoring
  • Documentation

Description

The action would currently still replace the image and not the tag.
Added some tests using the right yq and not a mocked one to verify the behavior.

Checklist

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Review the Contributing Guideline and sign CLA
  • Reference relevant issue(s) and close them after merging

@m-seidel m-seidel requested review from a team as code owners June 2, 2026 07:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@m-seidel m-seidel marked this pull request as draft June 2, 2026 07:45
@m-seidel
Copy link
Copy Markdown
Contributor Author

m-seidel commented Jun 2, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 2, 2026
@m-seidel m-seidel marked this pull request as ready for review June 2, 2026 07:56
@m-seidel m-seidel requested a review from asadk23 June 2, 2026 08:00
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

Fixes update_file so Helm chart-style image maps (e.g., {repository: ..., tag: ...}) get their tag updated instead of replacing the entire image field, and adds tests to validate the behavior.

Changes:

  • Update update_file logic to write .tag when the target field is a map containing tag or repository.
  • Add an integration-style Bats test that exercises the behavior with a real yq.
  • Add a shared test helper to skip integration tests when yq isn’t available.

Reviewed changes

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

File Description
scripts/lib/gitops-functions.sh Adjusts map detection logic to update .tag when the map looks like an image map (tag/repository).
tests/lib-gitops-functions.bats Renames/extends tests and adds a real-yq integration test for repository-only maps.
tests/test_helper/setup.bash Adds skip_if_no_yq helper for conditional integration testing.

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

Comment thread tests/lib-gitops-functions.bats
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@m-seidel m-seidel merged commit 5416c2f into main Jun 2, 2026
10 checks passed
@m-seidel m-seidel deleted the fixing_helm_chart_replacement branch June 2, 2026 11:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants