Skip to content

stage_executor: history should include heredoc summary correctly #6041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Mar 7, 2025

getCreatedBy ignores heredoc summary when build args are specified following PR makes sure the behaviour is correct.

Also test is modified to make sure buildah correctly burst cache if heredoc content is changed.

Closes: containers/podman#25469

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

stage_executor: history should include heredoc summary correctly

}
}
if buildArgs != "" {
return "|" + strconv.Itoa(len(strings.Split(buildArgs, " "))) + " " + buildArgs + " /bin/sh -c " + shArg + heredoc + appendCheckSum, nil
Copy link
Member

Choose a reason for hiding this comment

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

Correct result, but harder to follow than having this block compute a value that also gets combined with others and is returned from one place. It would be very easy to mistakenly introduce a similar bug in the future.

if buildArgs != "" {
return "|" + strconv.Itoa(len(strings.Split(buildArgs, " "))) + " " + buildArgs + " /bin/sh -c " + shArg + heredoc + appendCheckSum, nil
}
result := "/bin/sh -c " + shArg + heredoc
return result + appendCheckSum, nil
Copy link
Member

Choose a reason for hiding this comment

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

Why concatenate multiple values to produce one string, then concatenate another with it in the return?

getCreatedBy ignores heredoc summary when build args are specified
following PR makes sure the behaviour is correct.

Also test is modified to make sure buildah correctly burst cache if
heredoc content is changed.

Closes: containers/podman#25469

Signed-off-by: flouthoc <[email protected]>
@flouthoc flouthoc requested a review from nalind March 7, 2025 15:58
@nalind
Copy link
Member

nalind commented Mar 7, 2025

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Mar 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, nalind

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Mar 7, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 8fd8abc into containers:main Mar 7, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bash HereDoc does not invalidate cache
2 participants