Project-specific environment variables are no longer available in workspaces
Bug description
When you setup a new project-specific environment variable and uncheck the "Hide Variable in Workspaces" checkbox to make it available to workspaces, the environment variable is only accessible in prebuild and not accessible in the workspace. This was working a few weeks ago and appears to have stopped working without any changes made on our end. I also tried recreating the environment variable and making visible to workspaces again and that didn't work. There appears to be a regression on the Gitpod side, unless this is deprecated feature.
Steps to reproduce
- Create a new project-specific environment variable and uncheck "Hide Variable in Workspaces"
- Run a prebuild of the project and echo the environment variable in a "before" start task. You will see the environment variable during the prebuild.
- Start a new workspace off of the prebuild. When the "before" start tasks runs again, the environment variable will now have an empty value.
This bug was repeatable across multiple projects, on new projects, and with new environment variables being set using new prebuilds and new workspaces.
Workspace affected
salesrabbit-localfpcomm-8dmliwvatmm
Expected behavior
I would expect the environment variable to be available in the workspace with the value that was set in the Gitpod project settings for environment variables.
Example repository
salesrabbit-localfpcomm-8dmliwvatmm
Anything else?
No response
Hey @najens ,
thanks for reporting.
Start a new workspace off of the prebuild. When the "before" start tasks runs again, the environment variable will now have an empty value.
Just to verify: How exactly are you starting that new workspace off a prebuild? Asking because it might lead to different behavior.
Also, when starting a regular workspace from a repository, I see all my environment variables are present as expected. But will re-test with prebuilds now. :+1:
Update: Tried, but can't reproduce :thinking:
@najens Are you using GitLab? And possibly a nested project? I don't see how that should affect this behavior, but that would be a new approach for reproducing this... :+1:
@geropl We are using Gitlab and mainConfiguration in the .gitpod.yml file to store the steps for setting up the local environment in a separate repository from where all of our code lives. I have triggered new workspaces from within Gitlab as well as from Gitpod UI. In the instances where I have triggered a new workspace from a prebuild, I've been clicking the green New Workspace (with this prebuild) button after the prebuild has completed.
@geropl - We're also experiencing this issue. We spin up GitPod instances using the built-in integration with GitLab, and starting something this week variables configured at either the project or the user level no longer inject properly into GitPod. Multiple internal projects at my org have reported the same issue.
@PatrickRice-KSC Are you using the mainConfiguration feature as well?
@geropl - We are not, no 😕
I'm also a maintainer on https://gitlab.com/gitlab-org/terraform-provider-gitlab , which has a gitpod file, and that project works appropriately and properly inherits variables. Maybe something with public vs private repositories?
@geropl - Any ideas here, or any additional information we could provide to help troubleshoot? This still seems to be impacted our projects.
@geropl This also continues to affect our projects. Every time we create a new workspace, we have to manually set all of the project specific environment variables in the terminal and then manually re-run each of the before and init steps for several tasks that depend on the environment variables in order to get our development services up and running. I'd also be happy to provide any more details that may help troubleshoot.
My issue seems to be resolved for project variables now (not sure what would have resolved it, but figured I'd update the issue). For user variables, the documentation for GitLab has been updated to state that scoping requires "*/**" instead of "*/*", which resolved the user variable issue for everyone.
Just wanted to chime in for anyone else who may find this issue.
I have a project in Github, and I see the same things. Setting up project variables ('visible') in Gitpod, but the workspace doesn't receive these variables. A few days (weeks?) ago it still worked. I am not sure what changed?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.