Skip to content

Conversation

@flin-8
Copy link
Contributor

@flin-8 flin-8 commented Jan 11, 2026

Refactor the Argo CD image update step to be a simple loop that iterates over the sources.

Also fixes a small bug where the default values.yaml isn't updated if it's not in the Helm valueFiles list - OctopusDeploy/Issues#9825

Diagram: https://whimsical.com/argocd-step-process-flows-WgXQKEM27ouNoJA4H4Gcer

CleanShot 2026-01-13 at 11 33 16@2x

@flin-8 flin-8 marked this pull request as ready for review January 13, 2026 00:56
@flin-8 flin-8 self-assigned this Jan 13, 2026
@flin-8 flin-8 changed the base branch from main to frank/sourcetype January 13, 2026 11:28
# Conflicts:
#	source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionHelmTests.cs
#	source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionTest.cs
#	source/Calamari/ArgoCD/Conventions/UpdateArgoCDAppImagesInstallConvention.cs
@flin-8 flin-8 changed the title Rewrite image update step to be a simple loop Rewrite image update step to be a simple loop and fix small Helm bug Jan 14, 2026

var sourceResults = applicationFromYaml.GetSourcesWithMetadata()
.Select(applicationSource =>
ProcessSource(applicationSource,
Copy link
Contributor

Choose a reason for hiding this comment

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

it feels like a smell that we need to pass in application and applicationFromYaml - are these not related under and umbrella type?
Note: this could be done as a separate refactoring.

It alsmost feels like Appllication/AppliactionFromYaml/GitCredentials/RepositoryFactory is a 'Context' - i.e. they're all either providers or factories.


using (var repository = CreateRepository(gitCredentials, applicationSource, repositoryFactory))
{
foreach (var valuesFileSource in helmTargetsForRefSource.Targets)
Copy link
Contributor

Choose a reason for hiding this comment

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

will this include the default values.yaml? (i.e. if no values files exist, I think helm always looks at the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the ref source. I know we need to include the default values.yml where the chart is, but we do need to do that for the ref?

# Conflicts:
#	source/Calamari.Tests/ArgoCD/Helm/HelmValuesFileUpdateTargetParserTests.cs
Copy link
Contributor

@rain-on rain-on left a comment

Choose a reason for hiding this comment

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

I've only reviewed the files with comments - so will come back around to the rest later.

Base automatically changed from frank/sourcetype to main January 15, 2026 04:24
# Conflicts:
#	source/Calamari.Tests/ArgoCD/Commands/Conventions/ArgoCDApplicationBuilder.cs
#	source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionHelmTests.cs
#	source/Calamari.Tests/ArgoCD/Commands/Conventions/UpdateArgoCDAppImagesInstallConventionTest.cs
#	source/Calamari/ArgoCD/Conventions/UpdateArgoCDAppImagesInstallConvention.cs
Copy link
Contributor

@rain-on rain-on left a comment

Choose a reason for hiding this comment

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

LGTM

@flin-8 flin-8 merged commit 4fb5c1a into main Jan 19, 2026
33 checks passed
@flin-8 flin-8 deleted the frank/newloop branch January 19, 2026 01:54
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.

2 participants