Skip to content
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

Amend update-builder functionality #342

Merged
merged 2 commits into from
Jun 18, 2024
Merged

Conversation

sophiewigmore
Copy link
Member

@sophiewigmore sophiewigmore commented Jun 17, 2024

Summary

Allows the jam update-builder command to update the run image (and associated run image mirrors) if the run image tag is semantically versioned instead of latest. There are some use cases (such as not being able to publish to latest) that make this use case helpful. Prior to this change, this use case caused errors when executing.

The PR makes the following choices:

  • If the run image tag is a semantic version (x.y.z or x.y.z-suffix), we should update it to match the latest build image version, to keep the stack images in lockstep. This assumes the run/build images of a stack are versioned and released together. I think this is simpler than re-calculating the highest tag version available twice, once for build and once for run.

  • If the builder.toml file has run image mirrors present, update them to the same version as the build/run image if the run image has been updated

  • Continue to support the "legacy tagging convention" in which tags may have a suffix (like -cnb), although none of our officially supported Paketo stack images use this mechanism, see
    Find latest stack images in semver-tagged repos #81

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

- If the run image is a version, we should update it to match the latest
build image version, to keep the stack images in lockstep

- The run image does not necessarily need to be set to `latest` or
follow the legacy tagging convention we used in the Bionic stacks.

- For more information on the "legacy tagging convention", see
#81

- Add support for updating run image mirrors
@ForestEckhardt
Copy link
Contributor

  • This assumes the run/build images of a stack are versioned and released together.

I think that I am comfortable with this assumption as we do not currently market this as a tool we offer but do make it available and because I think that setting a specific run image version is something that is an oddity and will only be done in unique circumstance.

@ForestEckhardt ForestEckhardt added the semver:patch A change requiring a patch version bump label Jun 17, 2024
if err != nil {
return err
}

builder.Stack.BuildImage = fmt.Sprintf("%s:%s", buildImage.Name, buildImage.Version)
if runImage != (internal.Image{}) {
Copy link
Member

Choose a reason for hiding this comment

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

Are the () necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need them when comparing an instantiation inline but that could be old news.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes they are necessary unfortunately. expected ';', found '{' (typecheck)

@sophiewigmore sophiewigmore merged commit 8475f48 into main Jun 18, 2024
7 of 8 checks passed
@sophiewigmore sophiewigmore deleted the amend-update-builder branch June 18, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants