Commit graph

10054 commits

Author SHA1 Message Date
Kynan Ware
68af5ccda0
Merge pull request #11620 from cli/kw/1003-gh-agent-task-list-respects--l--limit
`gh agent-task list`: implement `--limit` flag
2025-09-02 13:57:14 -06:00
Kynan Ware
0dcf0c6c81
Merge pull request #11619 from cli/kw/1002-gh-agent-task-list-respects-cwd-repo-and---repo-flag
`gh agent-task list`: Implement repo scoping support
2025-09-02 13:56:40 -06:00
Kynan Ware
ffc8792260
Merge branch 'kw/1002-gh-agent-task-list-respects-cwd-repo-and---repo-flag' into kw/1003-gh-agent-task-list-respects--l--limit 2025-08-29 19:14:37 -06:00
Kynan Ware
3197193e42 Handle repo resolution errors gracefully in agent-task list
Updated listRun to ignore errors from BaseRepo resolution and proceed when possible. Adjusted tests to reflect that repo resolution errors no longer surface, improving robustness when repo information is ambiguous.
2025-08-29 19:13:35 -06:00
Kynan Ware
83c597ff53 Show default limit in agent-task list flag help
Updates the help text for the --limit flag in the agent-task list command to display the default value, improving clarity for users.
2025-08-29 17:56:04 -06:00
Kynan Ware
a49994defa Add limit flag to agent-task list command
Introduces a --limit flag to control the maximum number of agent tasks fetched. Validates that the limit is greater than zero and updates tests to cover custom and invalid limit scenarios.
2025-08-29 17:52:27 -06:00
Kynan Ware
e750e71288 Add repo-scoped agent session listing support
Introduces ListSessionsForRepo to CapiClient and CAPIClient, enabling listing agent sessions for a specific repository. Updates the list command and tests to support repo override and repo-scoped session queries, including error handling and test coverage for repo resolution.
2025-08-29 17:27:04 -06:00
Kynan Ware
c10ac8a326
Merge pull request #11606 from cli/kw/1001-gh-agent-task-list-responds-with-table-of-the-users-agent-sessions
Introduce `gh agent-task list`
2025-08-29 15:41:26 -06:00
Kynan Ware
4fd6ae6e3a Refactor session state color logic to shared package
Moved the session state color selection logic from list.go to a new shared/display.go file as ColorFuncForSessionState. This improves code reuse and maintainability by centralizing the color mapping for session states.
2025-08-29 15:23:40 -06:00
Kynan Ware
ea9dfae3bf Optimize session pull request hydration logic
Replaces linear search with a map for associating sessions with pull requests, improving performance and simplifying code in hydrateSessionPullRequests.
2025-08-29 14:23:43 -06:00
Kynan Ware
5281be467d Refactor error handling in generatePullRequestNodeID
Simplified error handling by inlining the encoder.Encode call and removing redundant comments for improved code clarity.
2025-08-29 14:20:12 -06:00
Kynan Ware
bc1d306c31 Update API query name for session PR fetch
Changed the API query from 'FetchPRs' to 'FetchPRsForAgentTaskSessions' in hydrateSessionPullRequests to match updated backend endpoint.
2025-08-29 14:18:45 -06:00
Kynan Ware
13c293f4cf Refactor variable names in ListSessionsForViewer
Renamed 'Sessions' to 'result' for clarity and consistency in the ListSessionsForViewer method when hydrating session pull requests.
2025-08-29 14:12:33 -06:00
Kynan Ware
48012063df Remove commented-out fields from sessionPullRequest
Cleaned up the sessionPullRequest struct by deleting unused commented-out fields related to Author and MergedBy.
2025-08-29 14:11:47 -06:00
Kynan Ware
7b71b5f21b Refactor agent-task list command client initialization
Moves CAPI client initialization to a deferred function in ListOptions, simplifying command setup and improving testability. Updates tests to use the new client initialization pattern and adds more comprehensive test cases for session listing.
2025-08-29 14:09:45 -06:00
Kynan Ware
0a5b78a510 Refactor session filtering in listRun function
Simplifies logic for filtering sessions to only include those with valid pull request and repository data. This reduces nested conditionals and improves code readability.
2025-08-29 08:25:00 -06:00
Kynan Ware
0de5cf24f0 Fix import alias for shared package in agent-task list
Renames the import of the shared package to 'prShared' and updates its usage in list.go to avoid naming conflicts and improve code clarity.
2025-08-29 08:19:37 -06:00
Kynan Ware
dd424d85fd Add agent task listing command and CAPI client
Introduces a new 'list' subcommand under agent-task for listing agent tasks. Implements a Copilot API client for fetching agent sessions and hydrating them with pull request data. Updates PullRequest and PRRepository types to support new fields. Adds dependencies for msgpack and tagparser.

Co-Authored-By: Babak K. Shandiz <babakks@github.com>
2025-08-28 22:00:35 -06:00
Kynan Ware
09be17e18f
Merge pull request #11600 from cli/kw/997-gh-agent-task-responds-and-exits-if-user-not-authenticated-with-oauth
Introduce `gh agent-task`
2025-08-27 17:27:18 -06:00
Kynan Ware
b939188e6d Refactor agent task tests into table-driven format
Consolidates multiple individual test functions into a single table-driven test, improving maintainability and readability. This change makes it easier to add new test cases and ensures consistent test structure for agent task command authentication scenarios.
2025-08-27 17:20:45 -06:00
Kynan Ware
1bc2710c88 Refactor test to use require.Empty assertion
Replaces require.Equal with require.Empty in TestOAuthTokenAccepted for improved clarity when checking for empty output.
2025-08-27 17:07:35 -06:00
Kynan Ware
2128a297b3 Show help on agent-task command execution
Changed the RunE function of the agent-task command to display help output instead of returning nil, improving user guidance when the command is run without arguments.
2025-08-27 17:06:19 -06:00
Kynan Ware
3573f61b86 Add agent-task command with OAuth token validation
Introduces a new `agent-task` command under pkg/cmd/agent with strict OAuth (device flow) token validation. Includes comprehensive tests for token source and host validation, and registers the command in the root command set.
2025-08-27 12:23:01 -06:00
Andrey
4e1318eb2a
feat: gh auth Automatically copy one-time OAuth code to clipboard (#11518)
* feat: add ability to copy one-time OAuth code while authenticating

Signed-off-by: Andrey <andrekabatareika@gmail.com>

* fix(docs): wrong example for gh auth refresh

* chore(authflow): update message to include one-time code to it

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* chore(authflow): improve message when copied one-time code

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* chore(authflow): don't early return error when could not copy OAuth code

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* refactor(authflow): make code for working with OAuth code more readable

* Adjust language in `gh auth` help for clipboard

---------

Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-08-25 09:52:51 -06:00
Andrey
204536cdd0
docs(release create): difference --generate-notes and --notes-from-tag (#11534)
* docs(release create): distinguish difference between '--generate-notes' and '--notes-from-tag'

Signed-off-by: Andrey <andrekabatareika@gmail.com>

* Clarify release notes behavior for unannotated tags

Updated help text to specify that if a git tag is not annotated, the release notes will use the commit message instead of the tag annotation.

---------

Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-08-25 15:20:21 +00:00
Andrey
89512590ad
Add --force flag to gh run cancel (#11513)
* feat: add --force flag to run cancel command

Signed-off-by: Andrey <andrekabatareika@gmail.com>

* docs: use less prescriptive docs for --force flag

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>

* chore: remove short flag

Signed-off-by: Andrey <andrekabatareika@gmail.com>

---------

Signed-off-by: Andrey <andrekabatareika@gmail.com>
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-08-21 12:45:12 -06:00
Kynan Ware
d43d7a1bdd
Update third-party license versions (#11557)
Bump several dependency versions in third-party-licenses files for Darwin, Linux, and Windows platforms to reflect updated packages and license links.
2025-08-21 17:45:56 +00:00
dependabot[bot]
6d183488cc
chore(deps): bump github.com/go-viper/mapstructure/v2 (#11556)
Bumps [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-21 11:09:59 -06:00
Copilot
5eddf8d523
Merge pull request #11536 from cli/copilot/fix-11535
Fix `gh repo delete --yes` safety issue when no repository argument provided
2025-08-20 11:03:44 -06:00
Kynan Ware
f0f9987584
Merge pull request #11537 from cli/dependabot/go_modules/github.com/cli/go-gh/v2-2.12.2
chore(deps): bump github.com/cli/go-gh/v2 from 2.12.1 to 2.12.2
2025-08-19 15:35:51 -06:00
dependabot[bot]
4fad0b42bc
chore(deps): bump github.com/cli/go-gh/v2 from 2.12.1 to 2.12.2
Bumps [github.com/cli/go-gh/v2](https://github.com/cli/go-gh) from 2.12.1 to 2.12.2.
- [Release notes](https://github.com/cli/go-gh/releases)
- [Commits](https://github.com/cli/go-gh/compare/v2.12.1...v2.12.2)

---
updated-dependencies:
- dependency-name: github.com/cli/go-gh/v2
  dependency-version: 2.12.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-19 21:21:19 +00:00
Andy Feller
9ae764b9fa
Merge pull request #11514 from cli/github-cli-937-v1-project-ghes-deprecation
Ensure users can see v2 projects when viewing issues and PRs, avoid v1 projects on GHES 3.17 and newer
2025-08-18 16:15:54 -04:00
Eugene
5ae174b6b3
Merge pull request #11511 from cli/eugene/trusted_root_flag_for_release_verify
Hidden trusted root flag for release verify
2025-08-15 16:58:19 -04:00
Kynan Ware
f64892474f
Merge pull request #11510 from cli/kw/upgrade-grpc-batch
Bump google.golang.org/grpc & other required dependencies
2025-08-15 09:44:58 -06:00
Andy Feller
4a2abf79b7
Merge pull request #11497 from cli/11409-pr-view-v2-projects
View v2 projects in `gh pr view` output
2025-08-15 08:07:36 -04:00
Andy Feller
8873d1b6a7
Merge pull request #11496 from cli/10708-issue-view-v2-projects
Display v2 projects in `gh issue view`
2025-08-15 08:06:22 -04:00
Kynan Ware
1dadf98148
Merge branch 'github-cli-937-v1-project-ghes-deprecation' into 11409-pr-view-v2-projects 2025-08-14 15:31:27 -06:00
Kynan Ware
17ce7893a7
Merge branch 'github-cli-937-v1-project-ghes-deprecation' into 10708-issue-view-v2-projects 2025-08-14 15:21:26 -06:00
Eugene
7316ddc57d
Update pkg/cmd/release/verify/verify.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-14 16:08:44 -04:00
Eugene
e23c9d087d
Update pkg/cmd/release/verify-asset/verify_asset.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-14 16:08:37 -04:00
Eugene
38a00b8976
Merge pull request #11481 from cli/eugene/test-for-release-FetchRefSHA
add test for FetchRefSHA
2025-08-14 15:31:35 -04:00
ejahnGithub
79888378d8 Hidden trusted root flag for release verify 2025-08-14 14:00:55 -04:00
Kynan Ware
f781d90ebc Update Go dependencies to latest versions
Bump several dependencies in go.mod and go.sum, including golang.org/x/crypto, golang.org/x/net, golang.org/x/sys, golang.org/x/term, golang.org/x/text, golang.org/x/tools, google.golang.org/protobuf, google.golang.org/genproto/googleapis/rpc, and github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp. This keeps the project up to date with the latest bug fixes and improvements.
2025-08-14 10:15:54 -06:00
Kynan Ware
6fa003543b
Merge pull request #11368 from cli/dependabot/go_modules/github.com/yuin/goldmark-1.7.13
chore(deps): bump github.com/yuin/goldmark from 1.7.12 to 1.7.13
2025-08-14 09:49:04 -06:00
Kynan Ware
1da55e90f3
Merge pull request #11490 from cli/dependabot/github_actions/actions/checkout-5
chore(deps): bump actions/checkout from 4 to 5
2025-08-14 09:45:42 -06:00
dependabot[bot]
6710bbc2be
chore(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-14 15:35:09 +00:00
Kynan Ware
245484cc51
Merge pull request #11458 from cli/dependabot/github_actions/actions/download-artifact-5
chore(deps): bump actions/download-artifact from 4 to 5
2025-08-14 09:33:54 -06:00
Eugene
a45107f6b4
Merge branch 'trunk' into eugene/test-for-release-FetchRefSHA 2025-08-14 11:20:48 -04:00
Andy Feller
8699d8596f
Merge pull request #11491 from cli/andyfeller/10716-project-featuredetection-api-version
Report that v1 classic projects are detected on GHES 3.16.x or older
2025-08-14 09:46:36 -04:00
ejahnGithub
c4d14044c7 udpate the test 2025-08-13 14:42:50 -04:00