Skip to content

Comments

PLENG-339/unified trigger labels#10

Open
lucien-UD wants to merge 13 commits intomain-udfrom
PLENG-339/unified-trigger-labels
Open

PLENG-339/unified trigger labels#10
lucien-UD wants to merge 13 commits intomain-udfrom
PLENG-339/unified-trigger-labels

Conversation

@lucien-UD
Copy link

@lucien-UD lucien-UD commented Jun 24, 2025

Creates a new array constant, PrTriggerLabels to list labels that will trigger/disable deployments in a PR

Copy link

@regis-underdog regis-underdog left a comment

Choose a reason for hiding this comment

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

I like using the Labels.DEPLOY model everwhere, even in the comments, but no worries. Looks good to me.

@lucien-UD
Copy link
Author

i think i need to make the old label still work too like i did with greyhound... gonna think more on it

@regis-underdog
Copy link

make the old label still work too

Even more reason to make the comments more generic.

@lucien-UD lucien-UD requested a review from regis-underdog June 25, 2025 18:01
@lucien-UD
Copy link
Author

Copy link

@regis-underdog regis-underdog left a comment

Choose a reason for hiding this comment

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

This is significantly improved since I reviewed it.

Comment on lines +148 to +150
const isDisabled = Array.isArray(labels)
? labels.some((item) => PrTriggerLabels.DISABLED.includes(item))
: PrTriggerLabels.DEPLOY.includes(labels);

Choose a reason for hiding this comment

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

If labels is not an array, is the PrTriggerLabels.DEPLOY.includes(labels); expression valid? If labels is not an array and labels is equal to a DEPLOY label like lets-go! then isDisabled will resolve to true but that seems like it might be unexpected.

should it be PrTriggerLabels.DISABLED.includes(labels) instead?

Copy link
Author

@lucien-UD lucien-UD Jun 26, 2025

Choose a reason for hiding this comment

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

the enableKillSwitch function takes a labels value that defaults to an empty array...

Choose a reason for hiding this comment

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

So what happens if your PR only has a single label and the single label is let-it-go!?

Copy link
Author

Choose a reason for hiding this comment

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

in theory.... nothing should happen... ill test it

Copy link
Author

Choose a reason for hiding this comment

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

So after a bit of testing the let-it-go! label doesnt make sense since it just disabling auto-deply... ive update the label to reflect that and not use lifecycle wordage

: [
...new Set([
...currentLabels,
...(Array.isArray(PrTriggerLabels.DEPLOY) ? PrTriggerLabels.DEPLOY : [PrTriggerLabels.DEPLOY]),

Choose a reason for hiding this comment

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

This seems like it would add all the deploy labels to the PR. Do we want to it to just add the first deploy label instead?

Copy link
Author

Choose a reason for hiding this comment

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

does it matter? like just adding the first label makes it cleaner or something?

Choose a reason for hiding this comment

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

I don't know how much it matters, but the reasons I can think of are:

  • If we want people to use the first label why do we add all of them?
  • Do you need to remove multiple deploy labels now to tear down your env?

Copy link
Author

Choose a reason for hiding this comment

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

you only need to remove the initial label used

@nickhodaly-ud nickhodaly-ud self-requested a review July 22, 2025 18:12
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.

3 participants