Commit graph

10968 commits

Author SHA1 Message Date
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
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
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
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
Kynan Ware
59ba50885f
Merge pull request #12854 from cli/kw/pr-view-copilot-friendly-name
`gh pr view` and `gh issue view`: show friendly display names for all actors
2026-03-06 20:45:38 -07:00
Kynan Ware
e047fa6b0e Address review comments: use actorDisplayName for Copilot author display
- Add actorDisplayName call in CommentAuthor.DisplayName for consistency
- Use require.Equal in TestActorDisplayName instead of manual comparisons
- Simplify user type name constant usage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 20:36:46 -07:00
Kynan Ware
3651c289ed Show friendly display names in gh issue view
Apply DisplayName() to author and assignee display in issue view,
consistent with the pr view changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 12:01:06 -07:00
Kynan Ware
7198d270b4 Add generic actorDisplayName for all actor display names
Replace copilotDisplayName with actorDisplayName(typeName, login, name)
which handles all actor types: known bots get friendly names (e.g.
Copilot → 'Copilot (AI)'), regular bots return login, users with
names return 'login (Name)', others return login.

All DisplayName() methods on Author, CommentAuthor, GitHubUser,
AssignableUser, AssignableBot, RequestedReviewer, and ReviewerBot
now delegate to actorDisplayName with their available fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 11:55:09 -07:00
Kynan Ware
04bc0d27f4 Show friendly Copilot (AI) name in gh pr view
Add CopilotDisplayName helper that translates known Copilot bot
logins (copilot-pull-request-reviewer, copilot-swe-agent) to the
friendly 'Copilot (AI)' display name. Applied to:

- PullRequestReview.AuthorLogin() — review comment author
- Comment.AuthorLogin() — PR/issue comment author
- parseReviewers() in pr view — reviewer list display

This ensures gh pr view shows 'Copilot (AI)' instead of the raw
'copilot-pull-request-reviewer' login for both the reviewer status
line and any review comments left by Copilot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 11:19:43 -07:00
yuvrajangadsingh
a331ef7f8f fix: align example indentation with codebase convention 2026-03-06 23:07:32 +05:30
yuvrajangadsingh
d7f1d8e89d fix: address review feedback for --exclude flag
- add usage examples to --help output
- use path.Match instead of filepath.Match for OS-consistent behavior
- rename patterns to excludePatterns for clarity
- simplify splitDiffSections using strings.Split
2026-03-06 23:07:32 +05:30
yuvrajangadsingh
8bd48afa87 fix: share diffHeaderRegexp between changedFilesNames and extractFileName, fix gofmt 2026-03-06 23:07:32 +05:30
yuvrajangadsingh
18536dc2b1 feat(pr diff): add --exclude flag to filter files from diff output
Add a new --exclude (-e) flag to gh pr diff that allows users to exclude
files matching glob patterns from the diff output. This is useful for
filtering out auto-generated files, vendor directories, or other noise
when reviewing pull requests.

Supports standard glob patterns and can be specified multiple times.
Patterns match against both the full path and basename.

Closes #8739
2026-03-06 23:07:32 +05:30
Kynan Ware
93c4340f29
Merge pull request #12627 from cli/kw/pr-create-multi-select-with-search-ccr
`gh pr create`: login-based reviewer requests and search-based interactive selection
2026-03-06 10:24:19 -07:00
Kynan Ware
7382b86c1a Fetch org teams via repository.owner inline fragment
Replace the top-level organization(login: $owner) query with
repository.owner { ... on Organization { teams } }. This uses
GraphQL inline fragments to conditionally fetch team data only
when the repo owner is an Organization, eliminating the need to
handle 'Could not resolve to an Organization' errors for
personal repos.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 09:47:47 -07:00
dependabot[bot]
c39a51e73b
chore(deps): bump google.golang.org/grpc from 1.79.1 to 1.79.2
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.79.1 to 1.79.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.79.1...v1.79.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-06 14:03:21 +00:00
Kynan Ware
24fb7657cd Exclude PR author from reviewer candidates in SuggestedReviewerActors
Add author { login } to the SuggestedReviewerActors GraphQL query
and pre-seed the seen map with the author login so they are excluded
from all sources (suggestions, collaborators, teams). Previously the
author was only skipped via the isAuthor flag in the suggestions loop
but could still appear as a collaborator.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:53:50 -07:00
Kynan Ware
1bba50b3e0 Fix duplicate reviewers in gh pr edit by passing logins as defaults
Use DefaultLogins instead of Default display names when calling
MultiSelectWithSearch for reviewers. The dedup logic in the
prompter compares keys (logins) against defaults, so passing
display names like 'mxie (Melissa Xie)' prevented deduplication
against search result keys like 'mxie'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:44:25 -07:00
Kynan Ware
90bfa624c2 Exclude current user from suggested reviewers in gh pr create
Query the viewer login in SuggestedReviewerActorsForRepo and
pre-seed the seen map so the current user is filtered out of
collaborator results. You cannot review your own PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:36:48 -07:00
Kynan Ware
08c7a4c207 Replace @copilot with Copilot reviewer login in gh pr create
Wire CopilotReviewerReplacer into NewIssueState so that
`gh pr create --reviewer @copilot` correctly resolves to the
copilot-pull-request-reviewer bot login, matching the behavior
already implemented in gh pr edit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 15:15:33 -07:00
Kynan Ware
49f1bd8800 Add TODO requestReviewsByLoginCleanup on GHES ID-based reviewer path
Mark the GHES ID-resolution branch in AddMetadataToIssueParams
for cleanup once GHES supports requestReviewsByLogin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 10:58:23 -07:00
Kynan Ware
07138b6edf Remove /slug team reviewer shorthand normalization
Team reviewers must be provided as fully qualified org/teamname.
Remove the /slug shorthand that auto-prefixed the repo owner,
as this format is not supported.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 10:58:08 -07:00
Kynan Ware
37776cf2e6 Add TODO requestReviewsByLoginCleanup on static reviewer MultiSelect
Mark the legacy static MultiSelect reviewer path for cleanup once
GHES supports requestReviewsByLogin and search-based selection can
be used universally.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 10:57:45 -07:00
Kynan Ware
dd7e44ee0a Check state.ActorReviewers in MetadataSurvey reviewer search gate
Gate search-based reviewer selection on both state.ActorReviewers
and the search function being available, consistent with the
ActorAssignees pattern used for assignees.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 10:57:28 -07:00
Kynan Ware
8f62e8116d Label Copilot detection in SuggestedReviewerActorsForRepo as a hack
Mark the piggyback-on-open-PR technique for detecting Copilot
reviewer availability as a HACK, since there is no repo-level API
to check Copilot eligibility without a PR context.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 10:56:47 -07:00