Skip to content

feat: add pagination support when fetching repository environments #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Sylfwood
Copy link

@Sylfwood Sylfwood commented May 14, 2025

Fixes #278

Fetching environments was limited to 30 environments. This change use pagination to support fetching all environments.

Example:

A repository with 35 environments:
repository

Before

Only 30 environments were fetched by the extension.
before

After

All 35 environments are correctly fetched.
after

@Copilot Copilot AI review requested due to automatic review settings May 14, 2025 17:57
@Sylfwood Sylfwood requested a review from a team as a code owner May 14, 2025 17:57
Copy link

@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

Adds support for fetching more than the default 30 repository environments by requesting up to 100 per page.

  • Introduces a per_page: 100 parameter to the GitHub API call.
  • Ensures environments beyond the default 30 are included in the returned result.
Comments suppressed due to low confidence (1)

src/treeViews/settings/environmentsNode.ts:12

  • Add tests for the pagination logic to ensure repositories with more than 100 environments are fully fetched.
async getEnvironments(): Promise<EnvironmentNode[]> {

Copy link

@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 adds pagination support when fetching repository environments from GitHub so that all environments are correctly fetched instead of being limited to 30.

  • Uses the GitHub API endpoint merge to configure request parameters.
  • Leverages the paginate API to retrieve all environments across pages.

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.

Number of Environments is limited to 30
1 participant