github / vscode-github-actions

GitHub Actions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-github-actions
MIT License
486 stars 86 forks source link

Number of Environments is limited to 30 #278

Open dinotuku opened 11 months ago

dinotuku commented 11 months ago

Describe the bug When you check the Environments list in the SETTINGS tab, you can only see at most 30 environments. This affects the validation of the file as it will highlight a valid environment when it is not in the first 30 environments.

To Reproduce

  1. With a repository that has over 30 environments
  2. Go to SETTINGS --> Environments

Expected behavior It should show all the environments.

Screenshots Environments

Extension Version v0.26.2

Additional context This should be fixed by the paginate method as used in this #110.

muzimuzhi commented 11 months ago

This should be fixed by the paginate method as used in this #110.

Unfortunately not. https://github.com/github/vscode-github-actions/blob/02a4f12047a38409abce525e45650235499db371/src/treeViews/settings/environmentsNode.ts#L12-L16

octokit.rest.repos.getAllEnvironments() (provided by @octokit/plugin-rest-endpoint-methods npm package, v7.0.1) accepts an optional per_page parameter as well, see https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/v7.0.1/docs/repos/getAllEnvironments.md.

I'm afraid there are more places need max per_page: 100 and pagination.

dinotuku commented 11 months ago

This should be fixed by the paginate method as used in this #110.

Unfortunately not.

https://github.com/github/vscode-github-actions/blob/02a4f12047a38409abce525e45650235499db371/src/treeViews/settings/environmentsNode.ts#L12-L16

octokit.rest.repos.getAllEnvironments() (provided by @octokit/plugin-rest-endpoint-methods npm package, v7.0.1) accepts an optional per_page parameter as well, see https://github.com/octokit/plugin-rest-endpoint-methods.js/blob/v7.0.1/docs/repos/getAllEnvironments.md.

I'm afraid there are more places need max per_page: 100 and pagination.

I don't fully understand why not 😓. Yes, it accepts the optional per_page. But surely, you can combine the paginate method and getAllEnvironments to really get all the environments, right? Just like how it was used with listJobsForWorkflowRun.

https://github.com/github/vscode-github-actions/blob/695cfb9a9100ac0273a656c0efb566c38069ceb5/src/store/workflowRun.ts#L82-L94

muzimuzhi commented 11 months ago

This should be fixed by the paginate method as used in this #110.

Unfortunately not. [...]

I don't fully understand why not 😓.

I meant, unfortunately list of environments and perhaps some more lists that need an improvement on pagenating are not covered by #110.