CORE-918: Improve bump-version workflow for docs branch and dbt lock#2249
Conversation
Update docs on the docs branch in a separate job, run dbt deps --lock after bumping packages.yml, and merge PR creation into bump-version. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
👋 @elazarlachkar |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRefactors the bump-version GitHub Actions workflow: adds job permissions and Python 3.12 setup, consolidates dbt package version bump plus ChangesRelease Workflow Refactoring
sequenceDiagram
participant GitHubActions
participant GitRepo
participant dbt
participant CreatePRAction
GitHubActions->>GitRepo: checkout code, set CLI_VERSION/DBT_PACKAGE_VERSION/RELEASE_BRANCH
GitHubActions->>GitHubActions: setup Python 3.12, pip install dbt-core==1.8
GitHubActions->>GitRepo: modify elementary/monitor/dbt_project/packages.yml
GitHubActions->>dbt: run dbt deps --lock (elementary/monitor/dbt_project)
GitHubActions->>GitRepo: commit & push release branch
GitHubActions->>CreatePRAction: create PR to master (release branch -> master)
GitHubActions->>GitRepo: checkout docs ref, create release/docs-v<cli-version>
GitHubActions->>GitRepo: update docs/snippets/quickstart-package-install.mdx and docs/data-tests/dbt/upgrade-package.mdx
GitHubActions->>GitRepo: commit & push docs release branch
GitHubActions->>CreatePRAction: create PR to docs (docs release branch -> docs)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/bump-version.yml (1)
75-101:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMake the release branches rerunnable.
Both jobs use deterministic branch names and then do a plain
git push. If this workflow is rerun for the same version after the branch already exists remotely—for example, when PR creation flakes after the push—the new local commit will be rejected as a non-fast-forward update and the workflow can't recover cleanly.♻️ Minimal hardening
- - name: Create release branch - run: git checkout -b "$RELEASE_BRANCH" + - name: Create release branch + run: git checkout -B "$RELEASE_BRANCH" … - - name: Push code - run: git push origin "$RELEASE_BRANCH" + - name: Push code + run: git push --force-with-lease --set-upstream origin "$RELEASE_BRANCH" … - - name: Create docs release branch - run: git checkout -b "$DOCS_RELEASE_BRANCH" + - name: Create docs release branch + run: git checkout -B "$DOCS_RELEASE_BRANCH" … - - name: Push code - run: git push origin "$DOCS_RELEASE_BRANCH" + - name: Push code + run: git push --force-with-lease --set-upstream origin "$DOCS_RELEASE_BRANCH"Also applies to: 120-145
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/bump-version.yml around lines 75 - 101, The workflow fails when rerun because it creates a new local branch with git checkout -b and does a plain git push, which errors if the remote branch already exists; update the "Create release branch" step to use git checkout -B "$RELEASE_BRANCH" (to reset or recreate the local branch safely) and change the "Push code" step to git push --set-upstream origin "$RELEASE_BRANCH" --force-with-lease (to update the remote safely); apply the same changes for the equivalent steps around lines 120-145 so RELEASE_BRANCH, CLI_VERSION and DBT_PACKAGE_VERSION runs are rerunnable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/bump-version.yml:
- Around line 102-110: The workflow step named "Create pull request" currently
uses the archived action repo-sync/pull-request@7e79a9f5dc3..., which is an
unreliable dependency; replace this step with a maintained approach such as
actions/create-pull-request, using the same inputs (source_branch ->
destination_branch, pr_title, pr_body, github_token), or implement the PR
creation via a short sequence that checks out the branch and runs gh pr create
or actions/github-script to call the GitHub REST API; update the step that
references uses: repo-sync/pull-request@... and map the existing inputs
(source_branch, destination_branch, pr_title, pr_body, github_token) to the
chosen maintained alternative.
---
Outside diff comments:
In @.github/workflows/bump-version.yml:
- Around line 75-101: The workflow fails when rerun because it creates a new
local branch with git checkout -b and does a plain git push, which errors if the
remote branch already exists; update the "Create release branch" step to use git
checkout -B "$RELEASE_BRANCH" (to reset or recreate the local branch safely) and
change the "Push code" step to git push --set-upstream origin "$RELEASE_BRANCH"
--force-with-lease (to update the remote safely); apply the same changes for the
equivalent steps around lines 120-145 so RELEASE_BRANCH, CLI_VERSION and
DBT_PACKAGE_VERSION runs are rerunnable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4b5b1057-554e-4aed-bd94-5a4669a90c78
📒 Files selected for processing (1)
.github/workflows/bump-version.yml
Avoid installing the full project; 1.8 is the first supported dbt version. Co-authored-by: Cursor <cursoragent@cursor.com>
Use peter-evans/create-pull-request v8 for release and docs PR creation. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove add-paths so create-pull-request includes every modified file by default. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/bump-version.yml:
- Around line 103-110: The workflow currently pushes env.RELEASE_BRANCH /
env.DOCS_RELEASE_BRANCH and then calls peter-evans/create-pull-request@v8.0.0
with with.branch pointed at those already-created branches, which violates the
action’s intended branch lifecycle; either remove the manual git push and let
create-pull-request manage the branch (remove the push step and the with.branch
input so the action commits changes and creates the PR branch itself), or keep
the manual push but replace the create-pull-request step with a gh pr create
invocation (use gh pr create --base master for RELEASE_BRANCH and --base docs
for DOCS_RELEASE_BRANCH) so you’re opening a PR against an already-pushed
branch; apply the same chosen approach to both PR steps.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0ed26111-a119-4f60-9134-c16f530650c3
📒 Files selected for processing (1)
.github/workflows/bump-version.yml
Show CLI and dbt package versions in the bump-version commit message and PR title. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
docsbranch, updating package version in configurable doc pathsdbt deps --lockafter bumpingpackages.ymlsopackage-lock.ymlis included in the releasebump-versionjob with human-readable PR titlesrepo-sync/pull-requestwith newpeter-evans/create-pull-request@v8.0.0action.Test plan
update-docs-branchjob opens a PR todocswith updated snippet paths: Docs: bump dbt package to v0.1.1 #2256bump-versionjob opens a PR tomasterwith the new version: Release v0.0.994 #2257Made with Cursor
Summary by CodeRabbit