Skip to content

Add AppliedResources output variable#1947

Open
akavalchuk wants to merge 3 commits into
mainfrom
akavalchuk/feat/sie-126-add-output-variable-with-applied-resources
Open

Add AppliedResources output variable#1947
akavalchuk wants to merge 3 commits into
mainfrom
akavalchuk/feat/sie-126-add-output-variable-with-applied-resources

Conversation

@akavalchuk
Copy link
Copy Markdown

@akavalchuk akavalchuk commented May 18, 2026

Adds output variable with applied resources so it would be possible to move verification into a separate step.
For kubernates steps we've already had identifiers, so it's only a matter of setting the variable.
For helm step identifiers received be calling helm get manifest <release> --revision <N> after the upgrade completes.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 18, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Collaborator

@scme0 scme0 left a comment

Choose a reason for hiding this comment

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

I think this is looking good and I've pre-approved. 🚀 But please take a look at the comments and let me know if something doesn't make sense.


var json = JsonConvert.SerializeObject(resourceList);

log.SetOutputVariable("AppliedResources", json, deployment.Variables);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a place we can set this as a const? I think we might do it for other output variables?

}
catch (Exception ex)
{
log.Warn($"Failed to set applied resources output variable: {ex.Message}");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What do we expect to fail here? Just getting the manifest or getting the resources from manifest?

}

[Test]
public async Task DoesNotSetAppliedResourcesOutputVariable_WhenFeatureToggleIsDisabled()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess it doesn't really hurt but because the feature toggle guard is in the SetAppliedResourcesOutputVariable method, we don't really need this test as well?

}

[Test]
public void DoesNotCallGetManifest_WhenFeatureToggleIsDisabled()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test is basically testing one part of the test above DoesNotSetAppliedResourcesOutputVariable_WhenFeatureToggleIsDisabled() - maybe we can just remove this one?

}

[Test]
public void CallsGetManifest_WhenFeatureToggleIsEnabled()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Similar to my comment above, should we just add the assertion into the SetsAppliedResourcesOutputVariable_WhenFeatureToggleIsEnabled test?

}

[Test]
public void LogsWarningAndContinues_WhenGetManifestFails()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should fail on this - The verification step will probably fail if it doesn't get a valid output variable value.

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