Skip to content

PREQ-7525: Accept plain-text success from multiRepoPromote - #330

Merged
tomverin merged 1 commit into
masterfrom
bugfix/tom/PREQ-7525-promote-plaintext-success
Jul 23, 2026
Merged

PREQ-7525: Accept plain-text success from multiRepoPromote#330
tomverin merged 1 commit into
masterfrom
bugfix/tom/PREQ-7525-promote-plaintext-success

Conversation

@tomverin

@tomverin tomverin commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Regression in 1.8.6 (#329): promote_multi() required a JSON object response, but multiRepoPromote.groovy returns plain text on success (Promoted <build> <number> from …).
  • Concrete failure: sonarqube-unification promote — artifacts were promoted, then the job failed with Unexpected non-JSON response.
  • Fix: treat responses starting with Promoted as success; still fail on JSON errors and other non-JSON bodies (e.g. Bad Gateway).
  • Jira: PREQ-7525

Test plan

  • shellspec spec/promote_spec.sh --shell bash (35 examples, 0 failures)
  • shellcheck promote/promote.sh
  • CI on this PR
  • After release 1.8.7 + v1 update, re-run multi-repo promote (e.g. sonarqube-unification)

The plugin returns "Promoted …" on HTTP 200, not JSON. 1.8.6 treated
that as failure and broke multi-repo promote consumers.
@tomverin
tomverin requested a review from a team as a code owner July 23, 2026 16:44
Copilot AI review requested due to automatic review settings July 23, 2026 16:44
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jul 23, 2026

Copy link
Copy Markdown

PREQ-7525

@gitar-bot

gitar-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Updates promote_multi() to accept plain-text success responses starting with 'Promoted ', fixing the JSON parsing regression caused by the artifactory user plugin update. No issues found.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@tomverin
tomverin enabled auto-merge (squash) July 23, 2026 16:47

Copilot AI 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.

Pull request overview

Adjusts the Artifactory multi-repo promotion step to tolerate the multiRepoPromote plugin’s real-world success output (plain-text Promoted ...) while preserving failure detection via JSON errors, addressing a regression introduced in 1.8.6.

Changes:

  • Update promote_multi() to treat plain-text responses starting with Promoted as success.
  • Keep failing behavior for JSON responses that contain non-empty .errors, and for unexpected non-JSON bodies.
  • Update/extend ShellSpec coverage to reflect plain-text success responses from multiRepoPromote.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
promote/promote.sh Accepts Promoted ... plain-text as success while retaining JSON errors handling and robust error reporting for unexpected bodies.
spec/promote_spec.sh Updates mocks/expectations for plain-text success and adds a dedicated test case for the Promoted ... response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/promote_spec.sh
@sonarqubecloud

Copy link
Copy Markdown

@tomverin
tomverin merged commit 3c6565f into master Jul 23, 2026
22 checks passed
@tomverin
tomverin deleted the bugfix/tom/PREQ-7525-promote-plaintext-success branch July 23, 2026 16:48
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.

3 participants