Skip to content

Comments

Subprojects in merge commands#252

Merged
OpsBotPrime merged 4 commits intomasterfrom
subprojects-command
Feb 13, 2024
Merged

Subprojects in merge commands#252
OpsBotPrime merged 4 commits intomasterfrom
subprojects-command

Conversation

@alex-mckenna
Copy link

This PR adds the ability to specify specific subprojects to deploy. This makes it possible to write things like

merge and deploy foo
merge and deploy foo, bar
merge and deploy foo, bar to environment
merge and deploy foo, bar on friday
Merge commits will include an additional line Deploy-Subprojects: with a value of either all, or a comma-separated list of the subprojects to deploy.

CC: @Riscky, the PR for this has changed to this new one

@alex-mckenna alex-mckenna self-assigned this Feb 8, 2024
Copy link

@joris-burgers joris-burgers left a comment

Choose a reason for hiding this comment

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

Some minor comments, but LGTM

Comment on lines +83 to +97
it "allows a specific subproject to be deployed" $
dummyParse "@bot merge and deploy aaa to production" `shouldBe`
Success (Approve $ MergeAndDeploy (OnlySubprojects ["aaa"]) (DeployEnvironment "production"), AnyDay)

it "allows many specific subprojects to be deployed" $
dummyParse "@bot merge and deploy aaa, bbb to production" `shouldBe`
Success (Approve $ MergeAndDeploy (OnlySubprojects ["aaa", "bbb"]) (DeployEnvironment "production"), AnyDay)

it "fails when an unknown subproject is specified" $
dummyParse "@bot merge and deploy ccc to production" `shouldBe`
-- I'm not super happy with this error message, it _should_ say that we expect to see
-- either 'to', or the name of a known subproject.
ParseError
"comment:1:23:\n |\n1 | @bot merge and deploy ccc to production\n\
\ | ^^\nunexpected \"cc\"\nexpecting \"to\" or white space\n"

Choose a reason for hiding this comment

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

Can you add a test for @bot merge and deploy aaa without the environment, to see what it does.

Copy link
Author

Choose a reason for hiding this comment

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

Two tests added:

  • That we can use subprojects with an implicit environment (@bot merge and deploy aaa)
  • That we can do the above with a merge window (@bot merge and deploy aaa on friday)

@Riscky
Copy link

Riscky commented Feb 13, 2024

Taking over the deployment from @alex-mckenna
@OpsBotPrime take the wheel

@HoffBotPrime
Copy link

Pull request approved for merge by @Riscky, rebasing now.

Alexander McKenna and others added 2 commits February 13, 2024 16:35
@HoffBotPrime
Copy link

Rebased as ae9446b, waiting for CI …

@HoffBotPrime
Copy link

CI job 🟡 started.

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.

5 participants