-
Notifications
You must be signed in to change notification settings - Fork 45
Skip validation for dynamic environment #178
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
base: main
Are you sure you want to change the base?
Skip validation for dynamic environment #178
Conversation
There was a problem hiding this 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 pull request addresses the inability of the variables context provider to correctly resolve variable names when a job's environment is set dynamically. The key changes include:
- Introducing a new variables context (variablesContext) to handle dynamic environments.
- Skipping validation by marking variablesContext.complete as false when the environment is dynamic or an expression.
- Duplicating the fix previously applied to the secrets context provider.
Copilot is a little off... I didn't introduce a new |
Great! This will solve the highest reacted issue in this repo. |
ea3b197
to
1ff96d2
Compare
There was a problem hiding this 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 fixes an issue in the variables context provider where the validator fails when handling dynamic environments, mirroring the fix previously applied to the secrets provider.
- In variables.ts, adds logic to skip validation by setting the context’s completeness flag to false when encountering a dynamic environment.
- In secrets.ts, corrects a typo in the inline comment regarding dynamic environments.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
languageserver/src/context-providers/variables.ts | Added logic to bypass variable validation for dynamic environments. |
languageserver/src/context-providers/secrets.ts | Fixed a spelling error in the comment for dynamic environment handling. |
Comments suppressed due to low confidence (1)
languageserver/src/context-providers/variables.ts:42
- [nitpick] Consider extracting the logic for skipping validation on dynamic environments into a shared helper function, as similar behavior is implemented in the secrets context provider.
variablesContext.complete = false;
fdb14e3
to
e1a46e7
Compare
There was a problem hiding this 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 skips variable validation for dynamically-set environments, mirroring the behavior already implemented for secrets. Key changes include:
- Adding logic in the variables context provider to mark dynamic environments as incomplete.
- Removing duplicate context initialization in variables.ts.
- Fixing a spelling mistake in the secrets context provider.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
languageserver/src/context-providers/variables.ts | Adds logic to skip variable validation for dynamic environments. |
languageserver/src/context-providers/secrets.ts | Corrects a spelling error in a comment regarding dynamic environments. |
e1a46e7
to
391a367
Compare
There was a problem hiding this 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 fixes the handling of dynamic environments for the variables context provider so that variable validation is skipped when the environment cannot be statically resolved.
- Introduces a dynamic environment check in the variables context provider.
- Mirrors existing dynamic environment handling implemented in the secrets provider, including a spelling correction in the comment.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
languageserver/src/context-providers/variables.ts | Added a dynamic environment check that skips validation by setting the context as incomplete. |
languageserver/src/context-providers/secrets.ts | Fixed a comment typo regarding "environment". |
Comments suppressed due to low confidence (1)
languageserver/src/context-providers/variables.ts:42
- Ensure that marking the variablesContext as incomplete in both the non-string and missing environment cases is the intended design for dynamic environment handling and that it won't inadvertently skip validation for valid configurations.
variablesContext.complete = false;
Apologies for the copilot spam. I had thought the checks were saying it needed a happy copilot review before sending it to the codeowners, but I realize now I had misinterpreted them. |
fixes: github/vscode-github-actions#222
When the environment of a job is dynamically set the validator is unable to resolve the variables names it has access to; this PR should cause the context provider to skip validation of the variables when this is the case.
This is a an issue that has been around for a while and has been fixed for the "secrets" context provider (see github/vscode-github-actions#41) but was seemingly not addressed for the "variables" context provider. I have duplicated the change to the variables provider.