Skip to content

Switch autopush releases to use latest tag#554

Open
yiyche wants to merge 1 commit into
datacommonsorg:masterfrom
yiyche:feature/use-latest-tag-for-autopush
Open

Switch autopush releases to use latest tag#554
yiyche wants to merge 1 commit into
datacommonsorg:masterfrom
yiyche:feature/use-latest-tag-for-autopush

Conversation

@yiyche

@yiyche yiyche commented Jun 18, 2026

Copy link
Copy Markdown
Member
  • a quick script to update stable tag

@codacy-production

codacy-production Bot commented Jun 18, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 minor

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
CodeStyle 2 minor

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a promotion mechanism to stable releases. It adds a promote.sh script to promote a specified version to 'stable' in the Artifact Registry, updates the default _PROD_TAG in cloudbuild.yaml to latest, and documents the promotion process in the README. Feedback on the new script includes adopting set -euo pipefail for more robust error handling and double-quoting variables to prevent word splitting.

#
# Usage: [PROJECT_ID=<gcp_project_id>] ./promote.sh <version> [--dry-run]

set -e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

It is a best practice to use set -u (to exit on undefined variables) and set -o pipefail (to prevent errors in pipelines from being masked) along with set -e for more robust error handling in Bash scripts.

Suggested change
set -e
set -euo pipefail

Comment thread pipeline/workflow/promote.sh Outdated
Comment on lines +71 to +74
run_cmd gcloud builds submit . \
--config=update-version.yaml \
--project=$PROJECT_ID \
--substitutions=_VERSION=$VERSION,_PROD_TAG=stable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Variables should be double-quoted to prevent word splitting and globbing, especially when they are user-controlled or environment-provided (like $PROJECT_ID and $VERSION). This ensures the script behaves correctly even if these variables contain spaces or special characters.

Suggested change
run_cmd gcloud builds submit . \
--config=update-version.yaml \
--project=$PROJECT_ID \
--substitutions=_VERSION=$VERSION,_PROD_TAG=stable
run_cmd gcloud builds submit . \
--config=update-version.yaml \
--project="$PROJECT_ID" \
--substitutions="_VERSION=$VERSION,_PROD_TAG=stable"

@yiyche yiyche force-pushed the feature/use-latest-tag-for-autopush branch from 6ad93da to 13e9437 Compare June 18, 2026 00:37
@yiyche yiyche force-pushed the feature/use-latest-tag-for-autopush branch from 13e9437 to e43dc6f Compare June 18, 2026 01:57
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.

1 participant