Job `environment` validation only sees the first 30 repository environments
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, typescript
- Domain
- devtools
Research direction
Start in languageserver/src/value-providers/job-environment.ts at lines 15-18 and inspect the repository-environment fetch. Use the supplied 35-environment reproduction to verify that environments beyond the API's default 30 are seen, and confirm the diagnostic no longer flags a valid later environment.
Written by the indexing model from the issue text.
Description
Describe the bug
The job environment value provider fetches the repository's environments with a single repos.getAllEnvironments({owner, repo}) call and no per_page or pagination, so it receives the API default of 30. In a repository with more than 30 environments, any job whose environment sorts past the 30th in the API's order is reported as Value '<name>' is not valid (severity Error), even though the environment exists and the workflow deploys to it.
To Reproduce
Steps to reproduce the behavior:
- In a repository with 35 environments, list them all with
gh api 'repos/OWNER/REPO/environments?per_page=100' --jq '.environments[].name'. The same call withoutper_pagereturns only the first 30 of those names, so the last five in the full list are the ones the language server never sees. - Open a workflow with a job that uses one of those five, for example:
jobs:
deploy:
runs-on: ubuntu-latest
environment: production-approval
steps:
- run: echo deploy
- See
Value 'production-approval' is not validon theenvironmentline. Jobs that use any of the first 30 environments show no diagnostic.
Expected behavior
Every environment the repository defines is accepted. The Octokit method takes per_page (max 100), and client.paginate(client.repos.getAllEnvironments, {owner, repo, per_page: 100}) returns the full list, since @octokit/plugin-paginate-rest normalizes responses wrapped in total_count.
Screenshots
Not needed; the reproduction above is deterministic.
Package/Area
- Expressions
- Workflow Parser
- Language Service
- Language Server
Package Version
@actions/languageserver 0.3.61, as bundled by the VS Code GitHub Actions extension 0.32.3.
Additional context
- github/vscode-github-actions#278 (open) reports the same 30-environment limit for the extension's Settings tree view and notes that it also breaks validation. The open fix github/vscode-github-actions#476 paginates only the tree view (
src/treeViews/settings/environmentsNode.ts); the validation path is this package's value provider, so that PR does not resolve the diagnostic. - github/vscode-github-actions#402 and #377 here are different
environmentfalse positives (an environment that does not exist yet, and a reusable workflow whose caller owns the environment), not truncation.
Drafted by Claude (Anthropic AI assistant).
- Dominant language
- TypeScript
- Stars
- 193
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from actions/languageservices
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actions/languageservices#387 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
actions/languageservices#386 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
actions/languageservices#373 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
actions/languageservices#391 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
actions/languageservices#390 ·
All issues in actions/languageservices
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100