Skip to content

fix(gitlab): remove deprecated --state flag from glab mr list#347

Open
Shanmukhcr7 wants to merge 1 commit into
kunchenguid:mainfrom
Shanmukhcr7:fix-glab-mr-list
Open

fix(gitlab): remove deprecated --state flag from glab mr list#347
Shanmukhcr7 wants to merge 1 commit into
kunchenguid:mainfrom
Shanmukhcr7:fix-glab-mr-list

Conversation

@Shanmukhcr7

Copy link
Copy Markdown

Fixes #313

Current versions of the glab CLI have removed the --state flag from the mr list command, which causes the pipeline pr step to crash with Unknown flag: --state.

Because glab mr list now defaults to only showing opened Merge Requests, we can simply drop the --state opened arguments to fix the crash.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43522f3802

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

args = append(args, "--target-branch", base)
}
args = append(args, "--state", "opened", "--output", "json")
args = append(args, "--output", "json")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update GitLab MR list test fixtures

With this invocation now omitting --state, the GitLab test command factory still only registers responses keyed with the old --state opened command (for example internal/scm/gitlab/gitlab_test.go:188 and :223). I checked GitLab's glab mr list docs: it defaults to open merge requests and lists --output, --source-branch, and --target-branch options but no --state option. Running go test ./internal/scm/gitlab now fails with unexpected command: glab mr list --source-branch ... --output json, so this change breaks the package CI until those fixtures are updated to the new CLI invocation.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab: pr step fails — glab mr list --state rejected by current glab (flag removed)

1 participant