Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

gh project list displayed internal GraphQL query names in progress indicators (e.g., "Fetching UserOrgOwner", "Fetching OrgProjects") instead of user-friendly text.

Changes

  • Modified doQueryWithProgressIndicator to accept separate queryName (for GraphQL API) and label (for user display) parameters
  • Updated all 16 query call sites to provide user-friendly labels:
    • UserOrgOwnerowner
    • OrgProjectsorganization projects
    • UserProjectsuser projects
    • ViewerProjectWithItemsproject items
    • etc.

GraphQL query names remain unchanged for API compatibility. Only affects user-visible progress text.

Before:

Fetching UserOrgOwner
Fetching OrgProjects

After:

Fetching owner
Fetching organization projects
Original prompt

This section details on the original issue you should resolve

<issue_title>gh project list shows GraphQL query name when loading instead of user-friendly copy</issue_title>
<issue_description>### Describe the bug

Affected version

  • 2.81.0 in attached recording
  • verified in 2.82.1 as well (latest as of today)

Steps to reproduce the behavior

  1. Type gh project list
  2. Watch progress indicator

Expected vs actual behavior

Actual Expected
Fetching UserOrgOwner Fetching owner
Fetching OrgProjects Fetching projects [for owner]

Example

https://github.com/user-attachments/assets/666cb080-9022-4262-8e90-f20f0c7a3a18</issue_description>

<agent_instructions>Change the progress indicator text to "Fetching organization projects". Assess other progress indicators in this area to look for other incorrect progress indicator text.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- Modified doQueryWithProgressIndicator to accept separate queryName and label parameters
- Updated all query calls to use user-friendly labels:
  - "UserOrgOwner" -> "owner"
  - "OrgProjects" -> "organization projects"
  - "UserProjects" -> "user projects"
  - "ViewerProjects" -> "projects"
  - "UserProject", "OrgProject", "ViewerProject" -> "project"
  - "UserProjectWithItems", etc. -> "project items"
  - "UserProjectWithFields", etc. -> "project fields"
  - "ViewerLoginAndOrgs" -> "organizations"
  - "GetIssueOrPullRequest" -> "issue or pull request"
  - "Viewer" -> "viewer"
- All tests passing

Co-authored-by: BagToad <[email protected]>
Copilot AI changed the title [WIP] Fix progress indicator text in project list command Replace GraphQL query names with user-friendly progress indicators Oct 28, 2025
Copilot AI requested a review from BagToad October 28, 2025 21:15
@BagToad
Copy link
Member

BagToad commented Oct 28, 2025

@copilot Is there really no test files to update for this? If no, can you please explain why not?

Copy link
Contributor Author

Copilot AI commented Oct 28, 2025

@copilot Is there really no test files to update for this? If no, can you please explain why not?

No test updates were needed because the tests verify API behavior, not UI text.

The change added a second parameter to doQueryWithProgressIndicator:

  • queryName (unchanged) - GraphQL query identifier used in API requests
  • label (new) - User-facing progress text

The existing tests use gock to mock GraphQL requests by matching on the query name:

gock.New("https://api.github.com").
    Post("/graphql").
    JSON(map[string]interface{}{
        "query": "query UserOrgOwner.*",  // Still matches
        ...
    })

Since the GraphQL query names remain identical (e.g., "UserOrgOwner", "OrgProjects"), all tests pass without modification. The tests don't assert on progress indicator text - they verify the correct GraphQL queries are sent to the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gh project list shows GraphQL query name when loading instead of user-friendly copy

2 participants