Make `lagoon list variables` return variables for all environments if required.

Open
#106 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Start at the lagoon list variables command entry point and reproduce both lagoon list variables -p some-project and the environment-specific form with -e master. Trace how project-level and environment-level variables are queried and rendered; done means no environment argument reports variables from all environments, labels project-level variables distinctly, and no longer errors when project-level variables are absent.

Written by the indexing model from the issue text.

Description

enhancement

Currently, if you try to list variables for a project, you get only the variables that have been added on the project level. If no variables have been specified on the project level, you get this:

lagoon list variables -p some-project
Error: graphql: Cannot read property 'id' of undefined

(which means that there are no variables on the project level - see #105)

I just found that if you do specify -e, you might find that there are actually variables on the environment level:

lagoon list variables -p some-project -e master
ID  	PROJECT         ENVIRONMENT	SCOPE 	VARIABLENAME 
1234	some-project	master     	global	CLAMAV_HOST	
5678	some-project	master     	global	CLAMAV_MODE

There is a --all-projects flag, but there is no --all-environments one, which is what I would like to be the default. In other words, I would expect that when I specify no environment, then a report of all variables for all environments is returned; for the variables that have been defined on a project level, I would expect that to be denoted in the ENVIRONMENT column (something like ALL ENVs?)

Dominant language
Go
Stars
28
Forks
14
Avg merge
1d 2h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uselagoon/lagoon-cli

All issues in uselagoon/lagoon-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.