Skip to content

[CNSL-1934] Add pre-release pending deploy branch management#105

Open
linhcrl wants to merge 1 commit intocockroachdb:mainfrom
linhcrl:pre-release-branch-management
Open

[CNSL-1934] Add pre-release pending deploy branch management#105
linhcrl wants to merge 1 commit intocockroachdb:mainfrom
linhcrl:pre-release-branch-management

Conversation

@linhcrl
Copy link
Copy Markdown
Contributor

@linhcrl linhcrl commented Apr 11, 2026

Introduces two workflows to manage the release process:

  1. pending-deploy-pr.yml (repository_dispatch trigger):

    • Finds the latest pending-deploy-YYYYMMDD-hhmmss branch
    • Creates or reuses a PR to merge it into main
  2. pending-deploy-check.yml (pull_request trigger):

    • Validates pending deploy PRs before merge
    • Checks that Managed-service-commit-SHA trailers reference deployed commits
    • Blocks merge until all changes are confirmed deployed in managed-service
    • Posts PR comments detailing any undeployed commits

This ensures SDK releases only include changes that are live in production.


Relevant screenshots

PR opened by pending-deploy-pr.yml

Screenshot 2026-04-28 at 9 15 40 PM

Comment left by pending-deploy-check.yml on failed check

Screenshot 2026-04-28 at 9 10 05 PM

@linhcrl linhcrl changed the title [CNSL-1934] Add automated pending deploy branch management [CNSL-1934] Add pre-release pending deploy branch management Apr 13, 2026
@linhcrl linhcrl force-pushed the pre-release-branch-management branch from f81608f to 427284b Compare April 13, 2026 15:19
@linhcrl linhcrl force-pushed the pre-release-branch-management branch 5 times, most recently from f9a2f35 to cb4189b Compare April 29, 2026 01:10
@linhcrl linhcrl requested a review from fantapop April 29, 2026 01:16
@linhcrl linhcrl force-pushed the pre-release-branch-management branch from cb4189b to 3f5a6bc Compare April 30, 2026 20:46
Copy link
Copy Markdown
Contributor

@fantapop fantapop left a comment

Choose a reason for hiding this comment

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

I left some feedback. In general, this feels like a lot of logic to be inlining into these workflows and going untested. Did you consider the approach we took in the actions repo to separate out some of the logic to actual code files?

GH_TOKEN: ${{ secrets.MANAGED_SERVICE_TOKEN }}
run: |
# Get all release tags matching release-YYYY-MM-DD-N pattern
all_tags=$(gh api repos/cockroachlabs/managed-service/tags --paginate --jq '.[].name' | grep -E '^release-[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]+$')
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.

what does --paginate do here? Does that restrict us to the first page?

Comment on lines +75 to +77
> not_deployed.txt
> missing_trailer.txt
> unexpected_status.txt
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.

This is kind of a weird syntax... I guess if it works. Normally I would use touch

while IFS='|' read -r sha subject; do
echo "Checking commit $sha: $subject"

# Extract Managed-service-commit-SHA trailer from commit message
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.

I'm not really clear whats going on here. Is trailer the right terminology to be used?

Comment thread .github/workflows/pending-deploy-pr.yml Outdated
Comment on lines +31 to +35
- name: Fetch latest remote refs
run: |
# Ensure we have the latest branches and tags from origin
git fetch origin --tags --force
git fetch origin --prune
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.

I was surprised this step would be necessary in either workflow. Can you document why that is in a comment?

Comment thread .github/workflows/pending-deploy-pr.yml Outdated
git fetch origin --tags --force
git fetch origin --prune

- name: Find latest pending deploy branch
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.

It looks like a lot of the stuff from this workflow are copied from the other workflow. Maybe it would make sense to bundle this stuff into an action instead.

@linhcrl linhcrl force-pushed the pre-release-branch-management branch 18 times, most recently from 78434b0 to e52ef90 Compare May 6, 2026 22:06
Introduces two workflows to manage the release process:

1. pending-deploy-pr.yml (workflow_dispatch trigger):
   - Finds the latest pending-deploy-YYYYMMDD-hhmmss branch
   - Creates a PR to merge it into main

2. pending-deploy-check.yml (pull_request trigger):
   - Validates pending deploy PRs before merge
   - Checks that Managed-service-commit-SHA trailers reference deployed
     commits
   - Blocks merge until all changes are confirmed deployed in
     managed-service
   - Posts PR comments detailing any undeployed commits

This ensures SDK releases only reference deployed CC API changes.

Co-Authored-By: roachdev-claude <[email protected]>
@linhcrl linhcrl force-pushed the pre-release-branch-management branch from e52ef90 to 1b798ac Compare May 7, 2026 00:43
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.

2 participants