Skip to content
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

[WS CLI] Make env --scope=user compatible with GitLab groups #20279

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Oct 9, 2024

Description

Makes the "user scope" that the CLI lets you modify */** instead of the previous */*.

Related Issue(s)

Fixes ENT-847

How to test

  1. In your user settings, create a new environment variable with the scopes */**
  2. Open a workspace
  3. Execute the following (in the workspace):
gp env foo=bar --scope user

This should update the contents of your variable's value to bar. You probably didn't name your variable foo, so change that part if you want to see it work.

Check the dashboard for the update or simply do gp env

For backwards compat, also try having a differently-named environment variable with the old */* scope and try to update it with gp env --user. It should also work

Copy link
Contributor

This pull request 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.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label Oct 20, 2024
@filiptronicek filiptronicek removed the meta: stale This issue/PR is stale and will be closed soon label Oct 22, 2024
@roboquat roboquat added size/M and removed size/XS labels Oct 22, 2024
Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, tested both cases and they work flawlessly. ✔️

Awesome, thank you @filiptronicek ! 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to update these because they were flaky. When we create a workspace, we update its deletion eligibility time asynchronously and that created races in the tests. Now we call svc.updateDeletionEligibilityTime explicitly and synchronously, so that we get rid of that possible variance.

Copy link
Member Author

@filiptronicek filiptronicek Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also base the test expectations off of the creationTime the instances are created with because otherwise we're comparing a date at the beginning of the test with a date at the end of it, which can cause trouble when we're at the edge of a millisecond. We could improve by not relying on the instance's creationTime and storing it ourselves separately, but this will do for now.

@filiptronicek filiptronicek self-assigned this Oct 22, 2024
@roboquat roboquat merged commit 810f5e9 into main Oct 22, 2024
18 checks passed
@roboquat roboquat deleted the ft/gitlab-compatible-user-scopes-vars branch October 22, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants