Add missing TODO comments for featuredetection if-statements
Add greppable TODO identifiers above all if-statements that reference featuredetection struct fields, as required by the featuredetection linter. This ensures every feature detection branch is tagged for future cleanup when GHES gains support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
1af2823fc3
commit
9de48154de
13 changed files with 18 additions and 0 deletions
|
|
@ -132,6 +132,7 @@ func apiClose(httpClient *http.Client, repo ghrepo.Interface, issue *api.Issue,
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// TODO stateReasonCleanup
|
||||
if !features.StateReason {
|
||||
// If StateReason is not supported silently close issue without setting StateReason.
|
||||
reason = ""
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ func createRun(opts *CreateOptions) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO actorIsAssignableCleanup
|
||||
if issueFeatures.ActorIsAssignable {
|
||||
assignees = copilotReplacer.ReplaceSlice(assignees)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ func editRun(opts *EditOptions) error {
|
|||
|
||||
lookupFields := []string{"id", "number", "title", "body", "url"}
|
||||
if editable.Assignees.Edited {
|
||||
// TODO actorIsAssignableCleanup
|
||||
if issueFeatures.ActorIsAssignable {
|
||||
editable.Assignees.ActorAssignees = true
|
||||
lookupFields = append(lookupFields, "assignedActors")
|
||||
|
|
|
|||
|
|
@ -164,8 +164,10 @@ func searchIssues(client *api.Client, detector fd.Detector, repo ghrepo.Interfac
|
|||
filters.Repo = ghrepo.FullName(repo)
|
||||
filters.Entity = "issue"
|
||||
|
||||
// TODO advancedIssueSearchCleanup
|
||||
if features.AdvancedIssueSearchAPI {
|
||||
variables["query"] = prShared.SearchQueryBuild(filters, true)
|
||||
// TODO advancedIssueSearchCleanup
|
||||
if features.AdvancedIssueSearchAPIOptIn {
|
||||
variables["type"] = "ISSUE_ADVANCED"
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ func listRun(opts *ListOptions) error {
|
|||
return err
|
||||
}
|
||||
fields := defaultFields
|
||||
// TODO stateReasonCleanup
|
||||
if features.StateReason {
|
||||
fields = append(defaultFields, "stateReason")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ func FindIssueOrPR(httpClient *http.Client, repo ghrepo.Interface, number int, f
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// TODO stateReasonCleanup
|
||||
if !features.StateReason {
|
||||
fieldSet.Remove("stateReason")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ func editRun(opts *EditOptions) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// TODO actorIsAssignableCleanup
|
||||
if issueFeatures.ActorIsAssignable {
|
||||
findOptions.Fields = append(findOptions.Fields, "assignedActors")
|
||||
} else {
|
||||
|
|
@ -269,6 +270,7 @@ func editRun(opts *EditOptions) error {
|
|||
editable.Base.Default = pr.BaseRefName
|
||||
editable.Reviewers.Default = pr.ReviewRequests.DisplayNames()
|
||||
editable.Reviewers.DefaultLogins = pr.ReviewRequests.Logins()
|
||||
// TODO actorIsAssignableCleanup
|
||||
if issueFeatures.ActorIsAssignable {
|
||||
editable.Assignees.ActorAssignees = true
|
||||
editable.Assignees.Default = pr.AssignedActors.DisplayNames()
|
||||
|
|
@ -299,6 +301,7 @@ func editRun(opts *EditOptions) error {
|
|||
// Wire up search functions for assignees and reviewers.
|
||||
// When these aren't wired up, it triggers a downstream fallback
|
||||
// to legacy reviewer/assignee fetching.
|
||||
// TODO actorIsAssignableCleanup
|
||||
if issueFeatures.ActorIsAssignable {
|
||||
editable.AssigneeSearchFunc = assigneeSearchFunc(apiClient, repo, &editable, pr.ID)
|
||||
editable.ReviewerSearchFunc = reviewerSearchFunc(apiClient, repo, &editable, pr.ID)
|
||||
|
|
|
|||
|
|
@ -75,8 +75,10 @@ func searchPullRequests(httpClient *http.Client, detector fd.Detector, repo ghre
|
|||
filters.Repo = ghrepo.FullName(repo)
|
||||
filters.Entity = "pr"
|
||||
|
||||
// TODO advancedIssueSearchCleanup
|
||||
if features.AdvancedIssueSearchAPI {
|
||||
variables["q"] = prShared.SearchQueryBuild(filters, true)
|
||||
// TODO advancedIssueSearchCleanup
|
||||
if features.AdvancedIssueSearchAPIOptIn {
|
||||
variables["type"] = "ISSUE_ADVANCED"
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err
|
|||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
// TODO mergeQueueCleanup
|
||||
if !prFeatures.MergeQueue {
|
||||
fields.Remove("isInMergeQueue")
|
||||
fields.Remove("isMergeQueueEnabled")
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ func fetchReleases(httpClient *http.Client, repo ghrepo.Interface, limit int, ex
|
|||
// `@skip(condition)` here because if the field doesn't exist on the schema
|
||||
// then the whole query would still fail regardless of the condition being
|
||||
// met or not.
|
||||
// TODO immutableReleaseFullSupport
|
||||
if !releaseFeatures.ImmutableReleases {
|
||||
return fetchReleasesWithoutImmutableReleases(httpClient, repo, limit, excludeDrafts, excludePreReleases, order)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,9 +233,11 @@ func editRun(ctx context.Context, opts *EditOptions) error {
|
|||
"squashMergeAllowed",
|
||||
"watchers",
|
||||
}
|
||||
// TODO repoFeaturesCleanup
|
||||
if repoFeatures.VisibilityField {
|
||||
fieldsToRetrieve = append(fieldsToRetrieve, "visibility")
|
||||
}
|
||||
// TODO repoFeaturesCleanup
|
||||
if repoFeatures.AutoMerge {
|
||||
fieldsToRetrieve = append(fieldsToRetrieve, "autoMergeAllowed")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ func listRun(opts *ListOptions) error {
|
|||
}
|
||||
|
||||
fields := defaultFields
|
||||
// TODO repoFeaturesCleanup
|
||||
if features.VisibilityField {
|
||||
fields = append(defaultFields, "visibility")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ func (s searcher) search(query Query, result interface{}) (string, error) {
|
|||
} else {
|
||||
qs.Set("q", query.AdvancedIssueSearchString())
|
||||
|
||||
// TODO advancedIssueSearchCleanup
|
||||
if features.AdvancedIssueSearchAPIOptIn {
|
||||
// Advanced syntax should be explicitly enabled
|
||||
qs.Set("advanced_search", "true")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue