-
Notifications
You must be signed in to change notification settings - Fork 80
Add --force option to darc trigger-subscriptions command
#4904
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
Conversation
Co-authored-by: premun <[email protected]>
Co-authored-by: premun <[email protected]>
--force option to darc trigger-subscriptions--force option to darc trigger-subscriptions command
src/ProductConstructionService/ProductConstructionService.DependencyFlow/IPullRequestUpdater.cs
Outdated
Show resolved
Hide resolved
src/ProductConstructionService/ProductConstructionService.DependencyFlow/IPullRequestUpdater.cs
Outdated
Show resolved
Hide resolved
…meters Co-authored-by: premun <[email protected]>
premun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a unit test to PendingUpdatesTests which will test that when passing the new force, a new build is applied even when the exiting PR has pending checks and cannot be updated at that time.
Get inspiration for instance from how the PendingUpdatesUpdatablePr is set up
Co-authored-by: premun <[email protected]>
Added the requested unit test |
...roductConstructionService/ProductConstructionService.DependencyFlow/SubscriptionTriggerer.cs
Outdated
Show resolved
Hide resolved
… default parameter Co-authored-by: dkurepa <[email protected]>
|
looks like my approval is no good now too because of the comment |
|
It looks like your approval did not do the trick |
…otnet#4904)" This reverts commit ba8bff1.
…dotnet#4904)" This reverts commit 81874d2.
This PR adds a
--forceoption to thedarc trigger-subscriptionscommand to allow forcing updates of existing pull requests even when they have pending or successful checks.Problem
When triggering a subscription via
darc trigger-subscriptions, the corresponding PR only gets updated if it's failing. A successful or pending but not failing PR won't get updated. Instead, Maestro waits until that one is merged and then opens a new one.This behavior can be problematic when users want to force an update to an existing PR regardless of its current status.
Solution
Added a
--forceoption that bypasses theInProgressCannotUpdatestatus check in the PR updater logic. When this flag is used, PRs with pending or successful checks can still be updated.Key Changes
-f, --forceoption toTriggerSubscriptionsCommandLineOptionsforcequery parameterSubscriptionTriggerWorkItemwithForcepropertyProcessPendingUpdatesAsyncto bypass status checks when forcedCore Implementation
The main fix is in
PullRequestUpdater.ProcessPendingUpdatesAsync():Usage Examples
Testing
Fixes #4845.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.