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 ticket-id-complement input #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

eversardoth
Copy link

@eversardoth eversardoth commented Jan 7, 2025

Add ticket-id-complement input to avoid identical ticket_id value for parallel/matrix jobs in the same workflow run.

Motivation: Parallel/Matrix jobs could generate the same ticket_id, meaning multiple parallel jobs in the same workflow run could gain access to a resource at the same time. The new input allows adding a suffix to the ticket_id, allowing different values being generated for different jobs.

Resolves #32

…r parallel/matrix jobs in the same workflow run

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • rootfs/scripts/lock.sh: Language not supported
Copy link
Owner

@ben-z ben-z left a comment

Choose a reason for hiding this comment

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

Nice flexible solution! Just some minor suggestion on the naming and default value.

We don't yet have the infrastructure set up to test this. Did you try this manually and make sure it works?

@@ -29,6 +29,10 @@ inputs:
description: '[Internal] The location to store the mutex repo'
required: false
default: '/run/gh-action-mutex/repo'
ticket-id-complement:
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
ticket-id-complement:
ticket-id-suffix:

Since this is the suffix, let's just name it "suffix".

ticket-id-complement:
description: 'Ticket id suffix to avoid identical values for parallel/matrix jobs in the same workflow run'
required: false
default: ''
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
default: ''
default: 'default'

This is to make sure that we don't have ticket ids that end in -. This should help with clarity and debugging in the future.

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.

Possibility of identical ticket_id for parallel/matrix jobs
2 participants