Skip to content

Conversation

williammartin
Copy link
Member

Description

Fixes #10714

Reviewer Notes

Most of this was pulled from previous work that also adjusted the issue formatters. Currently doing a self-review on that to decide whether to split it into separate PRs.

@williammartin williammartin force-pushed the wm/projects-v1-only-ghes branch from 9f95187 to bcfde2c Compare April 14, 2025 12:28
@williammartin williammartin requested a review from Copilot April 15, 2025 15:23
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new detector interface (fd.Detector) for feature detection and propagates it to issue-related commands and tests to correctly handle Projects v1 support for non‐GHES hosts.

  • Updates include adding the Detector field to option structs, updating function signatures (e.g. IssueFromArgWithFields, IssuesFromArgsWithFields, findIssueOrPR, etc.) to accept a detector, and propagating detector usage into various commands and tests.
  • Test cases have been updated to use EnabledDetectorMock where appropriate.

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/cmd/issue/transfer/transfer.go Added detector parameter to transfer logic
pkg/cmd/issue/shared/lookup.go Updated IssueFromArgWithFields, IssuesFromArgsWithFields and findIssueOrPR with the detector parameter
pkg/cmd/issue/reopen/reopen.go Passed nil detector explicitly
pkg/cmd/issue/pin/pin.go Passed nil detector explicitly
pkg/cmd/issue/lock/lock.go Added Detector field and passed it in IssueFromArgWithFields
pkg/cmd/issue/edit/edit_test.go & edit/edit.go Introduced detector initialization and passed it to functions
pkg/cmd/issue/develop/develop.go Passed detector to IssueFromArgWithFields
pkg/cmd/issue/delete/delete.go Passed detector to IssueFromArgWithFields
pkg/cmd/issue/create/create_test.go & create/create.go Added detector to tests and ensured detector is initialized in createRun
api/queries_repo_test.go & api/queries_repo.go Updated function calls to include projectsV1Support parameter

@@ -167,6 +171,21 @@ func editRun(opts *EditOptions) error {
return err
}

baseRepo, err := opts.BaseRepo()
Copy link
Member Author

@williammartin williammartin Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this can't work because BaseRepo will error if the issue is being resolved from a URL.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➜  workspace ./cli/bin/gh issue edit https://github.com/cli/cli/issues/10797
failed to run git: fatal: not a git repository (or any of the parent directories): .git

Yep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants