vscode-github-actions icon indicating copy to clipboard operation
vscode-github-actions copied to clipboard

Number of Environments is limited to 30

Open dinotuku opened this issue 2 years ago • 3 comments

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.

dinotuku avatar Nov 06 '23 05:11 dinotuku

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.

muzimuzhi avatar Nov 07 '23 02:11 muzimuzhi

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

dinotuku avatar Nov 07 '23 15:11 dinotuku

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.

muzimuzhi avatar Nov 08 '23 07:11 muzimuzhi