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

Add a "Prepare release" workflow for classic buildpacks #184

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Jan 25, 2024

This new workflow is based on the prepare release workflow used by the classic Python buildpack:
https://github.com/heroku/heroku-buildpack-python/blob/main/.github/workflows/prepare-release.yml

However, as part of porting the following changes have been made:

  • The workflow now uses Git tags as the source of truth for the "existing" buildpack version, rather than the version from the buildpack registry. This allows the workflow to be used by classic buildpacks whose changelog/git tag versions are no longer in sync with the buildpack registry version (such as Ruby and PHP). This also saves callers of this workflow from having to pass the specific name/ID that the buildpack uses on the registry.
  • There's a new optional custom_update_command input, which can be used by the Ruby buildpack to update the version constant here: https://github.com/heroku/heroku-buildpack-ruby/blob/main/lib/language_pack/version.rb ...as well as perform the changelog directory rename.
  • The description in the PR opened by the workflow now includes a list of commits generated by git log, to make it easier to spot changes that have been forgotten in the changelog, as well as helping to identify when PRs are released thanks to the mention pings the prepare release PR will leave in the history of the original PRs.

I've intentionally kept the number of workflow inputs small, and not included the ability to customise the runner or GitHub App details, since this workflow is pretty team-specific, and unlikely to be used by others (in particular, the overhead of having to set up your own GitHub App is pretty high) - and is also not required for manual testing.

GUS-W-14894410.

@edmorley edmorley added the enhancement New feature or request label Jan 25, 2024
@edmorley edmorley self-assigned this Jan 25, 2024
@edmorley edmorley marked this pull request as ready for review January 25, 2024 18:48
@edmorley edmorley requested a review from a team as a code owner January 25, 2024 18:48
@edmorley
Copy link
Member Author

edmorley commented Jan 25, 2024

I tested this using heroku/heroku-buildpack-nodejs#1200.

The PR it opened can be seen here:
heroku/heroku-buildpack-nodejs#1203

(The initial broken version title etc, was due to needing to add fetch-tags: true and fetch-depth: 0 to the actions/checkout settings, since otherwise it doesn't fetch tags + runs into this bug: actions/checkout#1471)

An example of using the custom_update_command (which will end up being used by the Ruby buildpack) can be seen here:
https://github.com/heroku/heroku-buildpack-nodejs/actions/runs/7660899884/job/20879192848#step:7:1

This new workflow is based on the prepare release workflow used
by the classic Python buildpack:
https://github.com/heroku/heroku-buildpack-python/blob/main/.github/workflows/prepare-release.yml

However, as part of porting, the following changes have been made:
- The workflow now uses Git tags as the source of truth for the
  "existing" buildpack version, rather than the version from the
  buildpack registry. This allows the workflow to be used by classic
  buildpacks whose changelog/git tag versions are no longer in sync
  with the buildpack registry version. This also saves callers of this
  workflow from having to pass the specific name/ID that the buildpack
  uses on the registry.
- There's a new optional `custom_update_command` input, which can be
  used by the Ruby buildpack to update the version constant here:
  https://github.com/heroku/heroku-buildpack-ruby/blob/main/lib/language_pack/version.rb
  ...as well as perform the changelog directory rename.
- The PR description now includes a list of commits generated by
  git log, to make it easier to spot changes that have been forgotten
  in the changelog, as well as helping to identify when PRs are released
  thanks to the mention pings the prepare release PR will leave in the
  history of the original PRs.

I've intentionally kept the number of workflow inputs small, and not included
the ability to customise the runner or GitHub App details, since this workflow
is pretty team-specific, and unlikely to be used by others (in particular, the
overhead of having to set up your own GitHub App is pretty high), plus not
required for manual testing.

GUS-W-14894410.
Since we need them to be able to determine the buildpack version
@edmorley edmorley force-pushed the edmorley/classic-prepare-release branch from f7266ce to e7367f9 Compare January 26, 2024 14:01
@edmorley edmorley merged commit c94ad88 into main Jan 26, 2024
2 checks passed
@edmorley edmorley deleted the edmorley/classic-prepare-release branch January 26, 2024 14:03
edmorley added a commit to heroku/heroku-buildpack-python that referenced this pull request Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants