Skip to content

More flexible Pulumi mutex #63

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 5 commits into from
Jun 1, 2025
Merged

More flexible Pulumi mutex #63

merged 5 commits into from
Jun 1, 2025

Conversation

ejfine
Copy link
Contributor

@ejfine ejfine commented Jun 1, 2025

Why is this change necessary?

Sometimes just the stack name was making the mutex too restrictive in the pulumi-aws CI workflow

How does this change address the issue?

Adds additional parameter to customize mutex

What side effects does this change have?

None

How is this change tested?

Downstream repo

Other

Added picking up github API token secret from envvar

@ejfine ejfine requested a review from Copilot June 1, 2025 10:33
@ejfine ejfine self-assigned this Jun 1, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to make the Pulumi mutex mechanism more flexible by adding an additional parameter so that the mutex branch name can be customized beyond just the stack name.

  • Added an input variable (ADDITIONAL_MUTEX_SUFFIX) with a default empty value for configuring the mutex branch name.
  • Updated the branch naming in the mutex step to include the additional suffix, and added an environment variable for the GitHub API token.

@@ -98,7 +105,7 @@ jobs:
- name: Set up mutex # Github concurrency management is horrible, things get arbitrarily cancelled if queued up. So using mutex until github fixes itself. When multiple jobs are modifying cache at once, weird things can happen. possible issue is https://github.com/actions/toolkit/issues/658
uses: ben-z/gh-action-mutex@{% endraw %}{{ gha_mutex }}{% raw %}
with:
branch: mutex-pulumi-${{ inputs.PULUMI_STACK_NAME }}
branch: mutex-pulumi-${{ inputs.PULUMI_STACK_NAME }}-${{ inputs.ADDITIONAL_MUTEX_SUFFIX }}
Copy link
Preview

Copilot AI Jun 1, 2025

Choose a reason for hiding this comment

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

[nitpick] Appending a hyphen regardless of the suffix value may result in a trailing hyphen when the suffix is empty; consider conditionally appending the hyphen only when the ADDITIONAL_MUTEX_SUFFIX is provided.

Copilot uses AI. Check for mistakes.

@ejfine ejfine merged commit be99a90 into main Jun 1, 2025
6 checks passed
@ejfine ejfine deleted the pluumi-mutex branch June 1, 2025 10:37
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.

1 participant