You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `gh aw logs` command collects workflow runs and currently lets users constrain results with workflow, date, ref, and run ID filters, but it cannot explicitly skip known unwanted runs while still returning the requested count of useful results. This PR adds a new exclusion input that accepts workflow run IDs in plain numeric form or qualified `slug/ID` form, applies the exclusion before artifact processing, and preserves it in continuation state for resumed downloads. The implementation evidence shows a need to omit specific runs without shrinking the effective result set or forcing users to narrow broader filters. The repository needs an explicit decision on whether run exclusion should be treated as a first-class logs query parameter across CLI parsing, pagination, orchestration, and reporting.
12
+
13
+
### Decision
14
+
15
+
We will add an `--ignore-workflow-runs` option to `gh aw logs` that accepts positive workflow run database IDs, including qualified `slug/ID` inputs, normalizes them to unique numeric IDs, and excludes matching runs from collection. We will apply the ignore list before downstream artifact processing and persist it through orchestration and continuation payloads so resumed or paginated log downloads keep honoring the same exclusion set. We chose this approach because it gives users precise control over unwanted runs without changing the requested result count or overloading existing date, ref, or before/after run filters.
16
+
17
+
### Alternatives Considered
18
+
19
+
#### Alternative 1: Require users to refine existing filters such as `--ref`, `--before-run-id`, or `--after-run-id`
20
+
21
+
The project could continue relying on broader query filters and ask users to manually narrow the candidate run set. This was considered because it avoids adding a new option and reuses existing filtering semantics. It was not chosen because the PR evidence explicitly addresses the need to skip specific known runs while still preserving the overall count and broader search scope.
22
+
23
+
#### Alternative 2: Support exclusion only for raw numeric run IDs
24
+
25
+
Another option would be to accept only integer run IDs and reject qualified `slug/ID` inputs. This was considered because it would simplify parsing and validation. It was not chosen because the PR explicitly supports both numeric IDs and qualified values, which improves usability when users copy workflow run references from repository-qualified contexts.
26
+
27
+
#### Alternative 3: Exclude runs only in the final output after artifacts are processed
28
+
29
+
The implementation could defer exclusion until after run data is downloaded and assembled. This was considered because it would minimize changes to earlier pagination and orchestration code paths. It was not chosen because the PR description and code both indicate exclusions should happen before artifact processing so ignored runs do not consume result slots or processing work.
30
+
31
+
### Consequences
32
+
33
+
#### Positive
34
+
- Users can omit known irrelevant or problematic workflow runs without reducing the requested number of collected results.
35
+
- The same exclusion behavior is preserved across pagination and continuation data, making resumed downloads more predictable.
36
+
- Supporting both numeric and `slug/ID` inputs reduces friction when specifying runs from copied GitHub references.
37
+
38
+
#### Negative
39
+
- The logs query path becomes more complex because ignore-list parsing, deduplication, filtering, and continuation serialization must all stay in sync.
40
+
- Invalid or non-positive run identifiers now introduce an additional user-facing validation failure mode.
41
+
- Exclusion behavior must be covered in multiple test layers to avoid regressions across CLI and orchestration flows.
42
+
43
+
#### Neutral
44
+
-`LogsDownloadOptions`, pagination options, and continuation payloads gain an `IgnoreWorkflowRuns` field.
45
+
- Run filtering semantics now include explicit exclusions in addition to inclusive workflow, date, ref, and run ID bounds.
46
+
- The implementation uses run database IDs as the stable identifier for exclusion across query and resume boundaries.
47
+
48
+
---
49
+
50
+
*ADR created by [adr-writer agent]. Review and finalize before changing status from Draft to Accepted.*
logsCmd.Flags().String("ref", "", "Filter runs by branch or tag name (e.g., main, v1.0.0)")
546
570
logsCmd.Flags().Int64("before-run-id", 0, "Filter runs with database ID before this value (exclusive)")
547
571
logsCmd.Flags().Int64("after-run-id", 0, "Filter runs with database ID after this value (exclusive)")
572
+
logsCmd.Flags().StringSlice("ignore-workflow-runs", nil, "Workflow run IDs or slug/ID values to exclude (slug is informational; matching uses the numeric ID)")
548
573
addRepoFlag(logsCmd)
549
574
logsCmd.Flags().Bool("tool-graph", false, "Generate Mermaid tool sequence graph from agent logs")
550
575
logsCmd.Flags().Bool("exclude-staged", false, "Exclude workflow runs that executed in staged mode (safe outputs previewed but not applied)")
0 commit comments