Commit graph

11089 commits

Author SHA1 Message Date
William Martin
45596c9b63 Add AGENTS.md optimized for AI agent token efficiency
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 18:00:42 +01:00
Kynan Ware
b046d2030e
Merge pull request #13021 from joshjohanning/add-reviewer-re-request-docs
docs: clarify that `gh pr edit --add-reviewer` can re-request reviews
2026-03-24 09:46:10 -06:00
Josh Johanning
761229f057
docs: simplify flag text
applying @BagToad's suggestion to simplify the wording to avoid line wrapping

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2026-03-24 10:37:20 -05:00
Kynan Ware
84050fbbad docs(pr edit): improve command examples with grouped sections
Add comment headers to group examples by concern (title/body, labels,
reviewers, assignees, projects/milestones), matching the style used by
other commands like pr review and repo create. Also adds examples for
--body-file and re-requesting review via --add-reviewer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 09:20:08 -06:00
Josh Johanning
b9439afa78
docs: clarify that --add-reviewer can re-request reviews
The --add-reviewer flag on pr edit already supports re-requesting
reviews from reviewers who have already submitted their review,
but this wasn't documented in the help text.

Ref #12489
Ref #2053
2026-03-24 09:43:12 -05:00
Kynan Ware
11f177a8c3 feat(pr create, issue create): search-based assignee selection in MetadataSurvey
Wire up MultiSelectWithSearch for assignees in MetadataSurvey, replacing
the static MultiSelect that required bulk fetching all assignable actors.
This applies to both gh pr create and gh issue create interactive flows
when selecting assignees via the 'Add metadata' prompt.

Changes:
- Add assigneeSearchFunc parameter to MetadataSurvey
- Skip assignee bulk fetch when search func is available
- New SearchRepoAssignableActors API function for repo-level search
  (create flows have no issue/PR node ID yet)
- New RepoAssigneeSearchFunc in shared editable.go
- Refactor actorsToSearchResult helper shared by both search functions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 18:49:28 -06:00
Kynan Ware
33783748f3 review: address code review feedback
- Fix tests: assert logins (not display names) in actorLogins
- Remove dead ReplaceActorsForAssignableByID (no callers)
- Extract shared AssigneeSearchFunc to pkg/cmd/pr/shared/editable.go
- Remove duplicate assigneeSearchFunc from pr/edit and issue/edit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 17:36:52 -06:00
Kynan Ware
947f8fb1b7 refactor(issue edit): wire up search-based assignee selection
Add AssigneeSearchFunc to gh issue edit interactive flow, matching
the pattern already used in gh pr edit. This eliminates the bulk
RepositoryAssignableActors fetch for interactive assignee selection,
using dynamic SuggestedAssignableActors search instead.

Also clean up pr edit assigneeSearchFunc signature to remove the
unused editable parameter (no longer needed after removing the
actor accumulation hack).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 17:06:38 -06:00
Kynan Ware
e24f55d5a4 refactor(pr edit): remove actor accumulation hack from assignee search
The assigneeSearchFunc previously accumulated actors into
editable.Metadata.AssignableActors so that MembersToIDs could
later resolve logins to node IDs. Now that the edit flow uses
AssigneeLogins + ReplaceActorsForAssignableByLogin on github.com,
this accumulation is no longer needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 15:34:44 -06:00
Kynan Ware
b3cfe7454c refactor(pr edit, issue edit): use login-based assignee mutation for flag flows
When ActorAssignees is true (github.com), the --add-assignee and
--remove-assignee flag flows now pass logins directly to
ReplaceActorsForAssignableByLogin instead of bulk fetching all
assignable actors and resolving logins to node IDs.

Changes:
- New AssigneeLogins() method on Editable that computes the final
  login set (defaults + add - remove) without ID resolution
- UpdateIssue: call AssigneeLogins + ByLogin when ActorAssignees is true
- EditableOptionsFetch: skip assignee bulk fetch for flag flows on
  github.com (only fetch on GHES where ID resolution is needed)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 15:33:37 -06:00
Kynan Ware
e6d9019bc9 fix(pr create): use login-based assignee mutation on github.com
When ActorAssignees is true (github.com), pass assignee logins directly
to the ReplaceActorsForAssignable mutation instead of resolving logins
to node IDs. This eliminates the need to bulk fetch all assignable
users/actors and fixes a bug where providing assignees via CLI flag
and then interactively adding metadata would fail with 'not found'
because the cached MetadataResult had no assignee data.

Changes:
- Set state.ActorAssignees = true in pr create (was missing)
- AddMetadataToIssueParams: pass assigneeLogins when ActorAssignees
  is true, skip fetch and ID resolution entirely
- CreatePullRequest/IssueCreate: call ReplaceActorsForAssignableByLogin
  after creation to assign via logins
- Consolidate replaceActorsForAssignable mutation into api/ package
  (ReplaceActorsForAssignableByLogin + ReplaceActorsForAssignableByID)
- Remove duplicate replaceActorAssigneesForEditable from editable_http.go
- Add TODO replaceActorsByLoginCleanup markers on edit paths

Fixes cli/cli#13000

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-23 15:21:20 -06:00
dependabot[bot]
dd1a3680d3
chore(deps): bump microsoft/setup-msbuild from 2.0.0 to 3.0.0
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 2.0.0 to 3.0.0.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Commits](6fb0222098...30375c66a4)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-23 14:14:35 +00:00
dependabot[bot]
c255e77dde
chore(deps): bump mislav/bump-homebrew-formula-action from 3.6 to 4.1
Bumps [mislav/bump-homebrew-formula-action](https://github.com/mislav/bump-homebrew-formula-action) from 3.6 to 4.1.
- [Release notes](https://github.com/mislav/bump-homebrew-formula-action/releases)
- [Commits](56a283fa15...ccf2332299)

---
updated-dependencies:
- dependency-name: mislav/bump-homebrew-formula-action
  dependency-version: '4.1'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-23 14:14:32 +00:00
tidy-dev
8723e3bb52
Merge pull request #12972 from cli/remove-auto-labels-from-templates
Remove auto-labels from issue templates
2026-03-19 19:45:35 -04:00
tidy-dev
d77b2239e9 Remove auto-labels from issue templates
The bug_report, submit-a-request, and submit-a-design-proposal issue
templates currently auto-apply 'bug' and 'enhancement' labels. This
causes issues to arrive pre-labeled with types that may not be accurate,
making triage harder since the template-applied labels can't be trusted.

Removing auto-labels ensures all type classification happens during
triage, giving the team confidence that labeled issues have been
reviewed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-19 19:36:11 -04:00
Kynan Ware
78b958f9ae
fix(agent-task): resolve Copilot API URL dynamically (#12956)
* fix(agent-task): resolve Copilot API URL dynamically

Query viewer.copilotEndpoints.api to get the correct Copilot API URL
for the user's host instead of hardcoding api.githubcopilot.com. This
fixes 401 errors for ghe.com tenancy users whose Copilot API lives at
a different endpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-18 18:14:02 +00:00
dependabot[bot]
0611b9ca0f
chore(deps): bump google.golang.org/grpc from 1.79.2 to 1.79.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.79.2 to 1.79.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.79.2...v1.79.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.79.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-18 14:03:50 +00:00
dependabot[bot]
ead34e1ed2
chore(deps): bump azure/login from 2.3.0 to 3.0.0
Bumps [azure/login](https://github.com/azure/login) from 2.3.0 to 3.0.0.
- [Release notes](https://github.com/azure/login/releases)
- [Commits](a457da9ea1...532459ea53)

---
updated-dependencies:
- dependency-name: azure/login
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-17 14:03:22 +00:00
dependabot[bot]
fb13f29f8a
chore(deps): bump advanced-security/filter-sarif from 1.0.1 to 1.1
Bumps [advanced-security/filter-sarif](https://github.com/advanced-security/filter-sarif) from 1.0.1 to 1.1.
- [Release notes](https://github.com/advanced-security/filter-sarif/releases)
- [Commits](f3b8118a93...2da736ff05)

---
updated-dependencies:
- dependency-name: advanced-security/filter-sarif
  dependency-version: '1.1'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-12 14:03:44 +00:00
William Martin
37800dd56a
Merge pull request #12915 from cli/revert-12596-fix/clarify-scope-error
Revert "fix: clarify scope error while creating issues for projects"
2026-03-12 13:06:18 +01:00
William Martin
3921788f76
Revert "fix: clarify scope error while creating issues for projects" 2026-03-12 12:55:55 +01:00
William Martin
4a3f7d9ce0
Merge pull request #12914 from cli/revert-12845-refactor/deduplicate-scope-error-handling
Revert "refactor: deduplicate scope error handling between api/client.go and project queries"
2026-03-12 12:54:54 +01:00
William Martin
d45acae604
Revert "refactor: deduplicate scope error handling between api/client.go and project queries" 2026-03-12 12:45:48 +01:00
Kynan Ware
2bf1669a6b
Merge pull request #12911 from cli/kw/deployment-oidc
Migrate Windows code signing from client secret to OIDC
2026-03-12 03:02:35 -06:00
Kynan Ware
bd12a06860 Switch deployment signing to OIDC authentication 2026-03-11 18:42:56 -06:00
tidy-dev
e8cc7f9436
Merge pull request #12894 from cli/tidy-dev/add-pitch-surfacing
Add monthly pitch surfacing workflow
2026-03-10 09:02:10 -07:00
tidy-dev
c9afc3c089 fix: add if guard to no-response job to prevent running on workflow_dispatch
Prevents no-response from accidentally closing issues when manually
dispatching the workflow for pitch surfacing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-10 11:44:55 -04:00
Babak K. Shandiz
8f2673062e
Merge pull request #12846 from yuvrajangadsingh/feat/squash-merge-commit-message
feat(repo): add --squash-merge-commit-message flag to gh repo edit
2026-03-10 15:32:56 +00:00
tidy-dev
089e461087 Add pitch surfacing workflow (monthly + manual dispatch) 2026-03-10 09:30:57 -04:00
yuvrajangadsingh
198487e166 fix: address review feedback on squash merge commit message
- reorder if checks: validate --enable-squash-merge is set before
  checking the value, and error when --enable-squash-merge=false
- use validSquashMsgValues directly in interactive prompt instead of
  duplicating the slice
- use slices.Contains in validateSquashMergeCommitMsg
- interpolate const values in Long description instead of hardcoding
- add default clause in transformSquashMergeOpts to avoid mutating
  title/message on unknown input
- move optionDiscussions to end of const block with TODO comment
- add test for unknown input and --enable-squash-merge=false case
2026-03-10 18:27:21 +05:30
yuvrajangadsingh
3baf83a339 fix: gofmt alignment in test struct literals 2026-03-10 16:55:50 +05:30
yuvrajangadsingh
4ae0c5851b feat(repo): add --squash-merge-commit-message flag to gh repo edit
Add a single --squash-merge-commit-message flag that maps to both
squash_merge_commit_title and squash_merge_commit_message API fields.

Supported values:
- default: COMMIT_OR_PR_TITLE + COMMIT_MESSAGES
- pr-title: PR_TITLE + BLANK
- pr-title-commits: PR_TITLE + COMMIT_MESSAGES
- pr-title-description: PR_TITLE + PR_BODY

The flag requires --enable-squash-merge to be set alongside it. In
interactive mode, the squash merge commit message prompt appears when
squash merging is selected.

Closes #10092
2026-03-10 16:55:50 +05:30
Babak K. Shandiz
19864b9e1e
Merge pull request #12886 from cli/dependabot/go_modules/golang.org/x/sync-0.20.0
chore(deps): bump golang.org/x/sync from 0.19.0 to 0.20.0
2026-03-09 15:08:44 +00:00
Babak K. Shandiz
4ae2743bf1
Merge pull request #12655 from yuvrajangadsingh/feature/pr-diff-exclude
feat(pr diff): add --exclude flag to filter files from diff output
2026-03-09 15:08:19 +00:00
dependabot[bot]
1a7f2aa0c0
chore(deps): bump golang.org/x/sync from 0.19.0 to 0.20.0
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.19.0 to 0.20.0.
- [Commits](https://github.com/golang/sync/compare/v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-version: 0.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-09 14:59:56 +00:00
Yuvraj Angad Singh
78891fc6e5
Merge branch 'trunk' into feature/pr-diff-exclude 2026-03-09 19:35:51 +05:30
yuvrajangadsingh
ea83ca0ca9 refactor: change extractFileName param from []byte to string 2026-03-09 19:26:29 +05:30
Babak K. Shandiz
27fb2da1c8
fix: improve docs around IssueRepoInfo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-09 12:16:02 +00:00
Babak K. Shandiz
9f5dfa80c8
test(issue transfer): update stub for IssueRepositoryInfo query
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:49:44 +00:00
Babak K. Shandiz
aad0239683
fix(issue transfer): use IssueRepoInfo to fetch minimal fields for issues
Only the destination repo ID is needed for issue transfer. Switch from
GitHubRepo to IssueRepoInfo to use minimal fields appropriate for issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:49:22 +00:00
Babak K. Shandiz
64416e1ea1
test(issue create): update stubs for IssueRepositoryInfo query
Update test mocks to match the renamed GraphQL query used by
IssueRepoInfo, and switch to StubIssueRepoInfoResponse helper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:35:13 +00:00
Babak K. Shandiz
1d95b633e3
fix(issue create): use IssueRepoInfo to avoid requiring Contents:Read permission
Switch issue create from GitHubRepo to IssueRepoInfo so that
gh issue create works with fine-grained PATs that only have
Issues:Write and Metadata:Read permissions.

Fixes cli/cli#12798

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:33:12 +00:00
Babak K. Shandiz
11e5be7842
test(api): add tests for GitHubRepo and IssueRepoInfo
Add success, not-found, and edge case tests for both GitHubRepo and
IssueRepoInfo, covering field population, parent repo handling,
viewer permission checks, and issues-disabled scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:30:46 +00:00
Babak K. Shandiz
5e2b2779d1
refactor(api): add IssueRepoInfo for minimal issue repo queries
Add a new IssueRepoInfo function that fetches only the fields needed
for issue creation (id, name, owner, hasIssuesEnabled, viewerPermission),
avoiding defaultBranchRef and other fields that require Contents:Read.

Also add StubIssueRepoInfoResponse helper to httpmock for testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-09 11:30:02 +00:00
Babak K. Shandiz
6e49747f49
Merge pull request #12851 from cli/dependabot/go_modules/google.golang.org/grpc-1.79.2
chore(deps): bump google.golang.org/grpc from 1.79.1 to 1.79.2
2026-03-08 01:03:26 +00:00
Kynan Ware
3d86738017
Merge pull request #12864 from cli/kw/update-build-from-source-to-go-1.26
Update Go version requirement to 1.26+
2026-03-07 10:37:18 -07:00
Kynan Ware
7fa453e467 Update Go version requirement to 1.26+ 2026-03-07 10:10:01 -07:00
William Martin
02196707e6
Merge pull request #12860 from cli/kw/bump-go-1.26
Bump Go from 1.25.7 to 1.26.1
2026-03-07 10:20:02 +01:00
Kynan Ware
b18358b754 Bump golangci-lint from v2.6.0 to v2.11.0 for Go 1.26 support
golangci-lint v2.6.0 was built with Go 1.25 and cannot lint code targeting
Go 1.26.1. Go 1.26 support was added in golangci-lint v2.9.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:24:41 -07:00
Kynan Ware
1524ea21ae Bump Go from 1.25.7 to 1.26.1 to fix stdlib vulnerabilities
Fixes 5 Go standard library vulnerabilities found by govulncheck:
- GO-2026-4603: html/template URL escaping
- GO-2026-4602: os FileInfo root escape
- GO-2026-4601: net/url IPv6 parsing
- GO-2026-4600: crypto/x509 malformed cert panic
- GO-2026-4599: crypto/x509 email constraint enforcement

Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:21:21 -07:00