Repository navigation
Conversation
"digger applyt" was dispatched as "digger apply": the GitHub path matched with HasPrefix and GitLab, Bitbucket and Azure with Contains. Match only when the command is followed by whitespace or the end of the comment. Fixes diggerhq#2762 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧠 Ai UsageDetails (if applicable):
The bug was found by a human: a
digger applyttypo applied a production project on our Digger Cloud setup, anddigger unlocktalso unlocked. The investigation, the code change, the tests, the linked issue (#2762) and this description were generated by Claude Code. The tests listed under Testing were run locally.Fixes #2762
PR comment commands were matched with
strings.HasPrefix(GitHub path,GetCommandFromComment) orstrings.Contains(GitLab, Bitbucket, Azure), sodigger applytran an apply, and on theContainspaths any comment mentioningdigger applydid.This adds
scheduler.IsCommentCommand, which matches a command only at the start of the trimmed, lower-cased comment and only when followed by whitespace or the end of the comment, and uses it at all five sites.digger apply -p proddigger applytdigger planetdigger unlocktlgtm, digger apply(GitLab/Bitbucket/Azure)Behaviour change: on GitLab, Bitbucket and Azure the command must now start the comment, which is what GitHub already required and what the docs show.
GetCommandFromJobis left alone sincejob.Commandsare produced internally.Testing
go test ./scheduler/ ./ci/generic/ ./ci/gitlab/ ./ci/bitbucket/ ./ci/azure/inlibs/libs/scheduler/utils_test.gocovers exact match, flags, mixed case, tab/newline separators, typos, and mid-comment mentions.🤖 Generated with Claude Code