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 CD pipeline to avoid issues with concurrent deployments #2558

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

mwaskom
Copy link
Contributor

@mwaskom mwaskom commented Nov 21, 2024

This PR makes some changes to the CI-CD workflow to better handle concurrent deployments.

It moves the steps that mutate the repository (updating the changelog and bumping the version number) first in the pipeline, so those run before we run any tests. Then the deployment job checks out the commit created when we update the version and deploys that.

This helps avoid an issue with the current configuration, where the deployment job checks out main after waiting for tests to run, meaning that it can includes additional commits that have subsequently been merged (but, critically, have not been validated by CI in a post-merge state).

@mwaskom mwaskom requested a review from ekzhang November 21, 2024 23:29
Comment on lines -171 to -176
- name: Generate token for Github PR Bot
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.GH_PRBOT_APP_ID }}
private_key: ${{ secrets.GH_PRBOT_APP_PRIVATE_KEY }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure this was vestigial?

Copy link
Member

Choose a reason for hiding this comment

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

I think it might be needed but I guess we'll find out!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I think this is that we set the default_author in the add-and-commit action:

default_author: github_actions

Which is documented for that action without making reference to this other token pathway.

Meanwhile the docs for the tibdex/github-app-token action demonstrate using it in subsequent steps though step.<name>.outputs, which we don't do anywhere in the workflow.

In any case yeah the worst thing that happens if we actually needed this step is that it fails and blocks the deployment so we can iterate further :D.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mwaskom mwaskom changed the title Michael/improve client deployment Improve CD pipeline to avoid issues with concurrent deployments Nov 21, 2024
@mwaskom mwaskom force-pushed the michael/improve-client-deployment branch from e976b19 to c16cfef Compare November 21, 2024 23:37
@mwaskom mwaskom merged commit 47a09c8 into main Nov 22, 2024
22 checks passed
@mwaskom mwaskom deleted the michael/improve-client-deployment branch November 22, 2024 13:52
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.

2 participants