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

Improve release workflows #1913

Closed
wants to merge 6 commits into from
Closed

Improve release workflows #1913

wants to merge 6 commits into from

Conversation

vinzscam
Copy link
Member

Hey, I just made a Pull Request!

The current release workflow heavily relies on git to understand which workspaces need to be published, by computing a diff of the changed files and the state of the main branch before a PR was merged. However, this won't work if the changes that are already in the main branch haven't been released.

This PR attempts to address the issue by comparing the versions of the packages that are in the main branch with the versions of the respective packages published on npm.

release_all.yaml: computes a list of packages that have new changesets and a list of packages that need to be published.
These two lists are used to invoke the create_changeset_pr_for_workspace workflow for packages with changesets and the release_workspace workflow for workspaces with plugins that need to be published.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
@vinzscam vinzscam requested review from backstage-service and a team as code owners November 12, 2024 22:22
@vinzscam vinzscam requested a review from awanlin November 12, 2024 22:22
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>

- name: Find changed workspaces
id: find-changed-workspaces
run: node ./scripts/ci/list-workspaces-to-be-released.js
Copy link
Member Author

Choose a reason for hiding this comment

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

here we compute the list of workspaces that have changesets and the list of workspaces containing packages that haven't been published on npm

fail-fast: false
matrix:
workspace: ${{ fromJSON(needs.find-changed-workspaces.outputs.workspaces_with_changesets) }}
uses: ./.github/workflows/create_changeset_pr_for_workspace.yml
Copy link
Member Author

Choose a reason for hiding this comment

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

here we make sure we create new "Version packages" PRs

fail-fast: false
matrix:
workspace: ${{ fromJSON(needs.find-changed-workspaces.outputs.workspaces_to_be_published) }}
uses: ./.github/workflows/release_workspace.yml
Copy link
Member Author

Choose a reason for hiding this comment

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

here we release workspaces


concurrency:
group: ${{ github.workflow }}-${{ inputs.workspace }}

jobs:
changesets-pr:
Copy link
Member Author

Choose a reason for hiding this comment

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

all of these have been moved to the create_changeset_pr_for_workspace workflow

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>

jobs:
changesets-pr:
name: Update Version Packages PR for ${{ inputs.workspace }} on branch main
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that we run this workflow on branches besides main?

Copy link
Member Author

Choose a reason for hiding this comment

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

not at the moment

Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't yet looked in detail at the logic. But, I just want to query if this would break the workflow described in #1175? Losing the capability to patch older versions of plugins (for security releases/compatibility where needed with older Backstage versions) would be a difficult regression for us.

Happy to help with a different approach to patching older releases that aligns with this PR, but would prefer not to lose the capability in the interim.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it makes sense, I can add the feature. I've DM you with more details 😄

Copy link
Collaborator

@BethGriggs BethGriggs left a comment

Choose a reason for hiding this comment

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

Just until we figure out how to retain the ability to release older plugin patch versions

Copy link
Contributor

github-actions bot commented Dec 6, 2024

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Dec 6, 2024
@github-actions github-actions bot closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants