-
Notifications
You must be signed in to change notification settings - Fork 94
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
Suppress vars
context validation in an environment set via an expression.
#96
Comments
The extension hits GitHub secret/ variable APIs to determine which secrets and variables are available to the workflow. Have you signed in to GitHub in the extension? If so can you try reloading VS Code |
Yes this is the problem. |
I'm signed in, but we have a few env vars that are set by previous steps -- not in the Would be nice to be able to either turn off this error globally, or suppress it on a line-by-line or full-file case. Similar to Typescript's |
I'm getting these throughout my project — five of them in this file, for example: https://github.com/prql/prql/blob/d09c3acad05b35b3f2565c51e045b689acea10b4/.github/workflows/release.yaml#L103 The secrets do exist — here's a screenshot from https://github.com/PRQL/prql/settings/secrets/actions I'm signed in on the GitHub Pull Requests extension. Should I be signed in on this extension too? How? (Searching for "Sign in" in the command palette doesn't find any additional hits). Thanks! |
@max-sixty if you select the Actions Extension tab, do you see a prompt to sign in? |
This sounds similar to the issues tracked in #41 or #47
Tracked in #123 |
It sounds like the request here is "disable The extension already does this for other contexts, such as |
vars
context validation when not logged in
My issue was a case of #121. All fixed now! |
Hi, sorry for the delay, I sometimes miss these. I AM logged in and the extension can see the variables fine. And yet the wall of yellow persists. So it seems unrelated to being logged in unless I am misunderstanding something. Secrets are working fine, it's just variables which seem borked. |
@RDavis3000 are those repository, environment, or org variables? If they are environment variables, can you include the portion of your workflow file where you set the environment for the job in your screenshot |
gh variable set -e DEV -f someFile.env This is how the reference is setup: |
Thabks for all of this context! The On line 17 of your workflow, you are setting your environment (presumably to We should suppress validation for variables if there is an environment set via an expression. We have #41 tracking doing this for secrets |
I was getting warnings when I wasn't logged in, so I logged in, restarted VSCode and it worked fine, the warnings are gone and I can see the completion for all secrets when I type However, the warnings are still showing in the "Problems" tabs. When I click on a problem in the "Problems" tab, even though I already have that file open just above (displaying the path relative to the workspace), it opens a new tab, with the full path as file name, and this file lists the warnings.. Related to #105 |
That makes sense, hopefully it gets tweaked soon :) |
vars
context validation when not logged invars
context validation in an environment set via an expression.
I've updated the title, I'm also quoting the relevant post here so whoever picks this up knows where to start the work:
|
In addition to suppressing these warnings when an environment can't be determined, I'd like to suggest the option of a hint here. I prefer a metadata-based approach so it doesn't affect the way builds work. However, if it's easier to evaluate expressions or parse inputs during static analysis, that might work depending on the situation. It would be great to be able to hint to bring back validation for secrets too, as it's very easy to make mistakes within nested actions.
|
The problem is still present in v0.26.2. The environment of our jobs is set via a workflow_dispatch:
inputs:
destination:
description: 'Promotion destination'
type: choice
required: true
default: ap
options:
- ap
- pr
[...]
environment: ${{ github.event.inputs.destination }} So, for every variable in an environment, I get the warning. But every variable defined at the repository level doesn't have the warning. |
Problem:
I am using a lot of repository environment variables, access via the vars context. The plugin is raising "Context access might be invalid:" warnings on every line which makes it difficult to spot actual issues and is making me sad.
Proposed solution:
I think that this functionality isn't relevant for vars/secrets contexts because there is no way for them to be discernible by the plugin.
It would be great to be able to configure the plugin to ignore these warnings in some circumstances (such as by a string pattern or by check boxes for various contexts. Or at least to be able to turn it off globally.
Additional context
Related to
[https://github.com//issues/67][https://github.com//issues/47]
Screenshot of my minimap to show you what I'm dealing with, all the yellow lines are this warning!
The text was updated successfully, but these errors were encountered: