Add darc get-subscription-history#6437
Open
dkurepa wants to merge 1 commit into
Open
Conversation
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DARC CLI verb, get-subscription-history, to query and print subscription trigger outcomes (history) using the same kinds of filters as the subscriptions UI, backed by BAR/PCS APIs.
Changes:
- Extends
IBarApiClient.GetSubscriptionTriggerOutcomesAsync/BarApiClientto support additional server-side filters (before,subscriptionOutcomeType,search). - Introduces a new DARC verb (
get-subscription-history) with command-line options and an operation that outputs either text or JSON. - Updates
docs/Darc.mdto document the new command and add it to the command index.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.Darc/DarcLib/IBarApiClient.cs | Adds new optional filters to the subscription outcomes query API. |
| src/Microsoft.DotNet.Darc/DarcLib/BarApiClient.cs | Passes new filters through to the generated PCS client endpoint. |
| src/Microsoft.DotNet.Darc/Darc/Program.cs | Registers the new command’s options with the CLI parser. |
| src/Microsoft.DotNet.Darc/Darc/Options/GetSubscriptionHistoryCommandLineOptions.cs | Defines CLI options/filters for get-subscription-history. |
| src/Microsoft.DotNet.Darc/Darc/Operations/GetSubscriptionHistoryOperation.cs | Implements execution: validate inputs, query outcomes, and render output. |
| docs/Darc.md | Documents get-subscription-history and links it from the index. |
Comment on lines
64
to
71
| Task<IReadOnlyList<SubscriptionTriggerOutcome>> GetSubscriptionTriggerOutcomesAsync( | ||
| Guid? subscriptionId = null, | ||
| int? buildId = null, | ||
| DateTimeOffset? after = null, | ||
| DateTimeOffset? before = null, | ||
| string? subscriptionOutcomeType = null, | ||
| string? search = null, | ||
| int limit = 100); |
Comment on lines
182
to
189
| public async Task<IReadOnlyList<SubscriptionTriggerOutcome>> GetSubscriptionTriggerOutcomesAsync( | ||
| Guid? subscriptionId = null, | ||
| int? buildId = null, | ||
| DateTimeOffset? date = null, | ||
| DateTimeOffset? after = null, | ||
| DateTimeOffset? before = null, | ||
| string? subscriptionOutcomeType = null, | ||
| string? search = null, | ||
| int limit = 100) |
| target repo and target branch. | ||
| - `--after` / `--before` - Restrict to outcomes on or after / on or before the | ||
| given date (e.g. `"2025-01-15T12:00:00Z"`). | ||
| - `--limit` - Maximum number of outcomes to return (1-1000, default 100). |
Comment on lines
+38
to
+42
| public override async Task<int> ExecuteAsync() | ||
| { | ||
| Guid? subscriptionId = null; | ||
| if (!string.IsNullOrWhiteSpace(_options.SubscriptionId)) | ||
| { |
Comment on lines
141
to
+142
| typeof(GetSubscriptionsCommandLineOptions), | ||
| typeof(GetSubscriptionHistoryCommandLineOptions), |
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.


#6387