Skip to content

fix(ci variable list): print entity type

Jay McCure requested to merge jmc-7367 into main

Description

Since ci variable list and ci variable export can list variables for a group or a project, it can be confusing for the user to know what is being printed. In #7367 (closed) since the GITLAB_GROUP env variable was unknowingly set, the command would always print the group variables, when the user expected to see the project variables. This MR makes it clear which is being printed.

Four commands use the group override:

  • commands/variable/list/list.go -> this MR
  • commands/mr/list/mr_list.go -> already prints group/project of list
  • commands/issuable/list/issuable_list.go -> already prints group/project of list
  • commands/variable/export/export.go -> this MR

The user messages are sent to stderr (opts.IO.Logf goes to stderr) so we do not interrupt any automation.

Related Issues

Resolves #7367 (closed)

How has this been tested?Screenshot_2023-10-19_at_10.40.34

Screenshot_2023-10-20_at_11.11.43

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Jay McCure

Merge request reports