Skip to content

Support scopes flag in gp env #6339

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

Closed
loujaybee opened this issue Oct 21, 2021 · 12 comments
Closed

Support scopes flag in gp env #6339

loujaybee opened this issue Oct 21, 2021 · 12 comments
Labels
component: gp cli component: ide meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request

Comments

@loujaybee
Copy link
Member

loujaybee commented Oct 21, 2021

Currently gp env allows you to set an environment variable, but it automatically sets the scope (of the environment variable) as the current repo, we should extend the command to allow any wildcard to be input.

Steps to replicate:

  • Go to a workspace
  • Run gp env SCOPE_TEST=temp
  • View the environment variable in the dashboard

e.g.

image

The default behaviour makes sense, but we should consider extending with a flag such as --scope=repo which will allow the user to specify the scopes of the environment variable.

Related: #6308 (comment)

@iQQBot
Copy link
Contributor

iQQBot commented Oct 26, 2021

/assign

@iQQBot
Copy link
Contributor

iQQBot commented Oct 26, 2021

@loujaybee i think it need discussion
For set env --scope=repo is better understood
How do we define the Get and Delete behaviors?

current unset

Note that you can delete/unset variables if their repository pattern matches the repository of this workspace exactly. I.e. you cannot delete environment variables with a repository pattern of */foo, foo/* or */*.

current get can get environment variables with a repository pattern of */foo, foo/* or */*.

Should we keep it the same? Or do we also need to add the --repo parameter?

@iQQBot
Copy link
Contributor

iQQBot commented Nov 5, 2021

@loujaybee have any ideas?

@iQQBot
Copy link
Contributor

iQQBot commented Dec 14, 2021

/unassign

@chuck-alt-delete
Copy link

chuck-alt-delete commented Jan 30, 2022

@iQQBot maybe on first iteration just add the ability to set scope for set and leave the rest unchanged?

nevermind — see next comment. I thought about it some more

@chuck-alt-delete
Copy link

chuck-alt-delete commented Jan 30, 2022

Maybe keep this in mind too:

We might someday want to pass a regex for the —scope parameter.

So maybe

  • set: create the env variable scoped to the given scope
  • Get: get all environment variables for which the current repo matches the scope (which is possibly regex)
  • Delete: delete env variable if the scope of that variable matches the —scope given, otherwise tell user that it was not deleted. This forces the user to understand the impact of deleting the variable.

@m-Bilal
Copy link

m-Bilal commented Mar 2, 2022

@loujaybee , @chuck-alt-delete Hi! I'm new to the Gitpod community. Can I please take this up?

@loujaybee
Copy link
Member Author

@m-Bilal sure thing 👍

@stale
Copy link

stale bot commented Jun 29, 2022

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.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Jun 29, 2022
@stale stale bot closed this as completed Jul 10, 2022
@axonasif
Copy link
Member

Not stale 😄

@axonasif axonasif reopened this Dec 23, 2022
@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Dec 23, 2022
@stale
Copy link

stale bot commented Apr 2, 2023

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.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Apr 2, 2023
@axonasif axonasif removed the meta: stale This issue/PR is stale and will be closed soon label May 3, 2023
@stale
Copy link

stale bot commented Sep 16, 2023

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.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Sep 16, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: gp cli component: ide meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants