Skip to content

Add darc get-subscription-history#6437

Open
dkurepa wants to merge 1 commit into
dotnet:mainfrom
dkurepa:dkurepa/DarcSubHistory
Open

Add darc get-subscription-history#6437
dkurepa wants to merge 1 commit into
dotnet:mainfrom
dkurepa:dkurepa/DarcSubHistory

Conversation

@dkurepa

@dkurepa dkurepa commented Jun 24, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 24, 2026 14:24
@dkurepa

dkurepa commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

get-subscription-history --id 5062ef9d-0a23-4aa5-9835-b62951d567a8 --output-format json --after 2026-06-23 shows
image
and the non json, default format
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 / BarApiClient to 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.md to 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)
Comment thread docs/Darc.md
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),
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.

2 participants