Repository navigation
Event streaming (5/11): Add gh event subscription view - #15075
Merged
Merged
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
babakks
requested review from
tidy-dev
and
a balanced review from Copilot
and removed request for
a team
November 17, 2026 17:11
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Missing constructor tests leave argument validation and subscription ID/JSON-field wiring to the run function unverified.
1 open issue
What changed in this PR
Adds gh event subscription view as layer 5 of the event-streaming stack, allowing users and scripts to inspect a subscription’s resource, event types, and lifetime.
Changes:
- Registers the new
view <id>subcommand. - Supports formatted terminal output, plain piped output, JSON export, and a descriptive not-found error.
- Tests output formats, supported JSON fields, and API error handling.
| File | Description |
|---|---|
pkg/cmd/event/subscription/view/view.go |
Implements subscription retrieval and display. |
pkg/cmd/event/subscription/view/view_test.go |
Tests output formats and error handling. |
pkg/cmd/event/subscription/subscription.go |
Registers the view subcommand. |
Review effort: Balanced
2 of 6 tasks
BagToad
approved these changes
Nov 17, 2026
This was referenced Nov 18, 2026
Merged
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.

Layer 5 of 11 in the stack tracked by #15070.
Description
Users and scripts need to inspect one subscription: which resource and event types it covers, and when it expires.
On a terminal it shows the ID, when it was created and expires, the resource URL, and the event types, each with a short description when
ghknows the type. Piped, it printskey:\tvaluelines with RFC 3339 times, like otherviewcommands.--jsonexports the same fields aslist. A subscription the API cannot find gets a message that it may have expired, been deleted, or not be accessible to the caller, since the API does not tell these apart.How did you test this change?
Recording of
gh event subscription viewon babakks#17: the formatted view on a terminal, plain key and value lines when piped,--jsonoutput, and the not found error for an unknown ID.05-sub-view.mp4
With a
ghbuilt from the complete stack, I ran the live smoke check from the evals PR against a sandbox pull request on github.com. Among other steps, it rangh event subscription createwith a merge conflict event type and got asub_...ID on stdout, saw the same ID, resource URL, and event types ingh event subscription view ID --json id,resourceUrl,eventTypes, found the ID ingh event subscription list --limit 100 --json id, rangh event subscription delete ID, and then sawgh event subscription view IDfail because the subscription was gone.Key points
Notes for reviewers
Stack, bottom to top (this is 5 of 11, based on
babakks/event-sub-create):babakks/event-client,babakks/event-listen,babakks/event-sub-list,babakks/event-sub-create,babakks/event-sub-view,babakks/event-sub-delete,babakks/event-hints,babakks/event-evals,babakks/event-listen-flush,babakks/event-listen-deleted-sub,babakks/event-check-suite.The whole change is
pkg/cmd/event/subscription/view/view.goand its tests.Authorship and follow-up
Who wrote this:
Who answers review comments: