-
Couldn't load subscription status.
- Fork 7.3k
gh agent-task view: support PR number arg
#11674
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
gh agent-task view: support PR number arg
#11674
Conversation
Signed-off-by: Babak K. Shandiz <[email protected]>
…Client` interface Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
|
|
||
| type ColorFunc func(string) string | ||
|
|
||
| func SessionSymbol(cs *iostreams.ColorScheme, state string) string { |
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.
Idea; maybe this could be named IconForSessionState
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.
The "symbol" is what is used with gh run commands, so I think we can just keep it. What do you think? I'm fine with either, though.
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.
I guess it's fine then. I only commented because the internal color scheme funcs are named "icon". I don't feel strongly either.
| // TODO(babakks): currently we just fetch a pre-defined number of | ||
| // matching sessions to avoid hitting the API too many times, but it's | ||
| // technically possible for a PR to be associated with lots of sessions | ||
| // (i.e. above our selected limit). | ||
| sessions, err := capiClient.ListSessionsByResourceID(ctx, "pull", resourceID, defaultLimit) |
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.
I think 60 is quite high - we could probably lower it and still be fine. I think other prompting experience fetch 40 IIRC.
The prompter experience with more items in the list than fit on your terminal isn't great 🤔 at least on my terminal.
I think anything 40-60 like we have is going to be fine so long as we are sorting by most recent.
I was just about to say, if someone has many sessions, they can just run gh agent-task list instead and grab the session ID. But, then I remembered we were talking about dropping the session ID in favour of session name 🤔 If we remove the session ID, we kind of affect this "I have more sessions than what gh agent-task view will prompt but I only have the PR" use-case.
Perhaps this is something we need to think about more.
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.
Another experience to think about is gh run view which has a View all jobs in this run option 🤔
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.
I agree with 40. Will fix. But for the name-vs-ID, yeah let's discuss.
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
…interface Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
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.
Looks great! 🚀
This PR adds support for PR number/URL/reference as an argument to
agent-task view.A/C verification (for PR arg support)
Happy paths
Confirmed:

Confirmed:

Additional PR formats
Confirmed:

Confirmed:

Confirmed:

Prompting requires a TTY
Confirmed:

Zero value paths
Confirmed:

Confirmed:

A/C verification (for base repo detection)
Confirmed:

Confirmed:

