feat: draft releases, version verification, and reusable workflows#287
feat: draft releases, version verification, and reusable workflows#287SoulPancake wants to merge 2 commits intomainfrom
Conversation
WalkthroughThis pull request updates release and PR validation workflows. It adds version consistency verification for tagged releases, configures Release Please to generate draft pull requests, replaces the release creation step with a reusable undraft workflow, and delegates PR title validation to a reusable workflow from the SDK generator repository. ChangesRelease Workflow & Version Verification
PR Title Validation Refactor
Possibly related PRs
Suggested reviewers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 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)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the release/CI automation to support draft releases, add a tag/manifest/pyproject version consistency gate before publishing, and replace some in-repo workflow logic with reusable workflows from openfga/sdk-generator.
Changes:
- Configure release-please to create draft releases (
"draft": true). - Switch PR title conventional-commit validation to a reusable workflow.
- Add a
verify-versionjob before publishing on tag pushes and replace the release finalization step with an undraft reusable workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| release-please-config.json | Enables draft behavior for release-please releases. |
| .github/workflows/pr-title-conventional-commit.yml | Replaces inline PR title validation with a reusable workflow. |
| .github/workflows/main.yaml | Adds version verification prior to publish and delegates undrafting to a reusable workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: | | ||
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | ||
| MANIFEST_VERSION=$(jq -r '.["."]' .release-please-manifest.json) | ||
| PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/') |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/main.yaml:
- Around line 120-125: The undraft-release job references a non-existent
workflow and will fail; update the job named undraft-release by either removing
the entire job block (undraft-release) or changing its uses value from
openfga/sdk-generator/.github/workflows/undraft-release.yml@main to the correct
workflow file openfga/sdk-generator/.github/workflows/release-please.yml@main
(and ensure any conditional/needs/permissions still apply) so the workflow
points to an existing release automation.
In @.github/workflows/pr-title-conventional-commit.yml:
- Around line 10-13: The referenced reusable workflow in the pr-title-check job
("uses: openfga/sdk-generator/.github/workflows/pr-title-check.yml@main") is
invalid and will fail at runtime; update the pr-title-check job by either
replacing the "uses" target with the correct reusable workflow path/name (or
correct repository) or remove the pr-title-check job and implement equivalent PR
title validation steps locally (e.g., a local step that validates commits/PR
title), ensuring changes are applied to the job named pr-title-check and its
"uses" entry.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8d9ebb7e-6bc8-4f21-820f-a0ddf72fa517
📒 Files selected for processing (3)
.github/workflows/main.yaml.github/workflows/pr-title-conventional-commit.ymlrelease-please-config.json
| undraft-release: | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: [publish] | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1 | ||
| with: | ||
| version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| uses: openfga/sdk-generator/.github/workflows/undraft-release.yml@main |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check whether undraft-release.yml declares required inputs
gh api repos/openfga/sdk-generator/contents/.github/workflows/undraft-release.yml \
--jq '.content' | base64 -d | grep -A 20 'on:'Repository: openfga/python-sdk
Length of output: 109
🏁 Script executed:
# First, check if there's any documentation or references to the workflow in the current repo
find . -type f -name "*.md" -o -name "*.yaml" -o -name "*.yml" | head -20Repository: openfga/python-sdk
Length of output: 626
🌐 Web query:
openfga/sdk-generator GitHub repository undraft-release workflow
💡 Result:
I could not find any “undraft-release” GitHub Actions workflow (or an “undraft-release” workflow job/action) in the openfga/sdk-generator repository using up-to-date web search results. What I did find instead: - openfga/sdk-generator is a generator repo (Mustache-based) responsible for generating OpenFGA SDKs from the OpenFGA OpenAPIv2 document, and it references that it contains workflows under.github/workflows/main.yml for CI checks, but nothing surfaced about an “undraft-release” workflow in the surfaced results. - Release automation in the OpenFGA SDK ecosystem appears to be handled via release-please and reusable workflows (example: documented in the Go SDK’s RELEASE.md and referenced by release automation PRs in SDK repos), rather than “undraft-release”. If you can share the exact repository URL, branch, or the filename where you believe “undraft-release” exists (or paste the workflow snippet), I can pinpoint it precisely.
Citations:
- 1: https://github.com/openfga/sdk-generator
- 2: [All SDKs] Automate SDK release process to enable Continuous Delivery sdk-generator#679
- 3: https://github.com/openfga/go-sdk/blob/main/RELEASE.md
- 4: https://github.com/openfga/sdk-generator/actions
- 5: https://pkg.go.dev/github.com/openfga/sdk-generator@v0.0.0-20251027215644-cface85fbe7c
🏁 Script executed:
cat -n .github/workflows/main.yaml | sed -n '110,135p'Repository: openfga/python-sdk
Length of output: 607
🏁 Script executed:
# Search for any references to undraft-release in the codebase
rg "undraft-release" .Repository: openfga/python-sdk
Length of output: 44
🏁 Script executed:
# Check if sdk-generator has this workflow (try different patterns)
# First, let's see what workflows are typically in similar org repos
rg "openfga/sdk-generator" . --type yamlRepository: openfga/python-sdk
Length of output: 44
🏁 Script executed:
# Look at release-please.yml to understand release workflow
cat -n .github/workflows/release-please.ymlRepository: openfga/python-sdk
Length of output: 1838
🏁 Script executed:
# Search for any documentation about releases or undraft in markdown files
rg -i "undraft|undraft-release" . --type mdRepository: openfga/python-sdk
Length of output: 44
🌐 Web query:
openfga sdk-generator undraft-release workflow GitHub Actions
💡 Result:
I couldn’t find any evidence of an “undraft-release” GitHub Actions workflow (or a file named like that) in openfga/sdk-generator. What I did find is that OpenFGA SDK releases are being automated using release-please, with repository-level workflows that delegate to a reusable workflow hosted in sdk-generator. 1) openfga/sdk-generator repo context - sdk-generator describes generator templates and CI checks, and is positioned as the place where shared automation logic/workflows can live for generating SDKs across languages.[1] 2) SDK release automation approach in OpenFGA - The sdk-generator issue discussing automated/continuous delivery explicitly calls out a “manual trigger” via GitHub Actions and automation for preparation/versioning/execution, but it does not mention “undraft-release”.[2] 3) Evidence of release-please wiring to sdk-generator (not undraft-release) - The Go SDK release automation infrastructure adds a workflow that is triggered on pushes to main and manual dispatch, and it delegates to an external reusable workflow located at openfga/sdk-generator/.github/workflows/release-please.yml (with bump type options and secrets). This is described in openfga/go-sdk issue #291.[3] - The js-sdk PR #362 similarly states it adds a GitHub Actions workflow “.github/workflows/release-please.yml” that delegates to a reusable workflow from sdk-generator, with configurable bump type and explicit release version.[4] - The Go SDK RELEASE.md documents that the project uses release-please via a workflow_dispatch-triggered GitHub Actions workflow and instructs users to run the “release-please” workflow manually, choosing bump type options like patch/minor/explicit.[5] Conclusion - For the specific query “openfga sdk-generator undraft-release workflow GitHub Actions”: I found no source-backed indication that such a workflow exists in sdk-generator. - The release automation workflow in use (based on multiple OpenFGA SDK repo docs/PR descriptions) is release-please, with sdk-generator providing a reusable release-please workflow.[3][4][5]
Citations:
- 1: https://github.com/openfga/sdk-generator
- 2: [All SDKs] Automate SDK release process to enable Continuous Delivery sdk-generator#679
- 3: feat: release automation configs go-sdk#291
- 4: chore(ci): release automation configs js-sdk#362
- 5: https://github.com/openfga/go-sdk/blob/main/RELEASE.md
Remove the undraft-release job—the referenced workflow does not exist.
openfga/sdk-generator/.github/workflows/undraft-release.yml does not exist in the sdk-generator repository. This job will fail at runtime with a "workflow not found" error. OpenFGA SDK release automation uses release-please.yml, not undraft-release.yml.
If release automation post-publish is needed, replace this with a reference to the correct workflow (release-please.yml), or remove it entirely if intentionally unused.
🤖 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/main.yaml around lines 120 - 125, The undraft-release job
references a non-existent workflow and will fail; update the job named
undraft-release by either removing the entire job block (undraft-release) or
changing its uses value from
openfga/sdk-generator/.github/workflows/undraft-release.yml@main to the correct
workflow file openfga/sdk-generator/.github/workflows/release-please.yml@main
(and ensure any conditional/needs/permissions still apply) so the workflow
points to an existing release automation.
There was a problem hiding this comment.
Yes it is still in the PR, We will merge this after that is merged in the sdk generator to main
There was a problem hiding this comment.
@SoulPancake, thanks for the clarification! That makes sense — merging the undraft-release.yml workflow into openfga/sdk-generator first and then landing this PR is the right sequencing to avoid a runtime "workflow not found" error.
A couple of things worth keeping in mind for that sequencing:
- Pin the reusable workflow to a commit SHA (e.g.,
openfga/sdk-generator/.github/workflows/undraft-release.yml@<sha>) rather than@mainonce it lands, for reproducibility and security — consistent with how the other actions in this workflow are pinned. - Consider adding a comment in the workflow file noting the dependency on the sdk-generator PR, so reviewers of this PR have context.
There was a problem hiding this comment.
We will pin them eventually, still experimenting with the repo and other stuff etc.
| pr-title-check: | ||
| permissions: | ||
| pull-requests: read | ||
| steps: | ||
| - name: PR Conventional Commit Validation | ||
| uses: ytanikin/pr-conventional-commits@639145d78959c53c43112365837e3abd21ed67c1 # v1.5.2 | ||
| with: | ||
| task_types: '["feat","fix","docs","test","refactor","ci","perf","chore","revert","release"]' | ||
| add_label: 'false' | ||
| uses: openfga/sdk-generator/.github/workflows/pr-title-check.yml@main |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check whether pr-title-check.yml declares required inputs
gh api repos/openfga/sdk-generator/contents/.github/workflows/pr-title-check.yml \
--jq '.content' | base64 -d | grep -A 20 'on:'Repository: openfga/python-sdk
Length of output: 109
🏁 Script executed:
# First, locate the pr-title-conventional-commit.yml file
find . -name "pr-title-conventional-commit.yml" -type fRepository: openfga/python-sdk
Length of output: 115
🏁 Script executed:
# Also search for any references to pr-title-check in the repository
rg "pr-title-check" --type yamlRepository: openfga/python-sdk
Length of output: 44
🏁 Script executed:
cat -n ./.github/workflows/pr-title-conventional-commit.ymlRepository: openfga/python-sdk
Length of output: 443
🏁 Script executed:
# Try to fetch the workflow file directly via curl
curl -s "https://raw.githubusercontent.com/openfga/sdk-generator/main/.github/workflows/pr-title-check.yml" | head -50Repository: openfga/python-sdk
Length of output: 76
🏁 Script executed:
# Also check if there are any recent releases or tags in sdk-generator
curl -s "https://api.github.com/repos/openfga/sdk-generator/releases?per_page=5" | jq '.[0:3] | .[] | {tag_name, created_at}'Repository: openfga/python-sdk
Length of output: 44
🏁 Script executed:
# Check the contents of the .github/workflows directory in sdk-generator
curl -s "https://api.github.com/repos/openfga/sdk-generator/contents/.github/workflows" | jq '.[] | .name'Repository: openfga/python-sdk
Length of output: 95
🏁 Script executed:
# Check available branches in sdk-generator
curl -s "https://api.github.com/repos/openfga/sdk-generator/branches" | jq '.[] | .name' | head -10Repository: openfga/python-sdk
Length of output: 429
🏁 Script executed:
# Search for pr-title-check files across all branches in sdk-generator
curl -s "https://api.github.com/search/code?q=repo:openfga/sdk-generator+filename:pr-title-check" | jq '.items | length'Repository: openfga/python-sdk
Length of output: 64
🏁 Script executed:
# Also check if maybe the file exists with a different name that handles PR titles
curl -s "https://api.github.com/repos/openfga/sdk-generator/contents/.github/workflows" | jq '.'Repository: openfga/python-sdk
Length of output: 2049
🏁 Script executed:
# Check what main.yaml contains - might be a reusable workflow
curl -s "https://raw.githubusercontent.com/openfga/sdk-generator/main/.github/workflows/main.yaml" | head -40Repository: openfga/python-sdk
Length of output: 1031
🏁 Script executed:
# Also check if maybe pr-title-check is defined inline somewhere
curl -s "https://raw.githubusercontent.com/openfga/sdk-generator/main/.github/workflows/main.yaml" | grep -i "title\|name:" | head -20Repository: openfga/python-sdk
Length of output: 660
Remove or replace the broken workflow reference: openfga/sdk-generator/.github/workflows/pr-title-check.yml does not exist.
The file pr-title-check.yml is not present in the openfga/sdk-generator repository (only main.yaml and release-please.yml exist in .github/workflows/). This workflow will fail at runtime. Either find the correct reusable workflow to use, implement PR title validation locally, or remove this job entirely.
🤖 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/pr-title-conventional-commit.yml around lines 10 - 13, The
referenced reusable workflow in the pr-title-check job ("uses:
openfga/sdk-generator/.github/workflows/pr-title-check.yml@main") is invalid and
will fail at runtime; update the pr-title-check job by either replacing the
"uses" target with the correct reusable workflow path/name (or correct
repository) or remove the pr-title-check job and implement equivalent PR title
validation steps locally (e.g., a local step that validates commits/PR title),
ensuring changes are applied to the job named pr-title-check and its "uses"
entry.
There was a problem hiding this comment.
Yes it is still in the PR, We will merge this after that is merged in the sdk generator to main
There was a problem hiding this comment.
@SoulPancake, understood! That makes sense — this PR has a cross-repo dependency on the openfga/sdk-generator PR that introduces pr-title-check.yml. As long as that workflow lands in sdk-generator@main before this PR is merged, the reference will resolve correctly at runtime.
One suggestion: it might be worth adding a comment in the workflow file or the PR description linking to the sdk-generator PR, so reviewers and future maintainers are aware of the dependency order. This helps avoid accidentally merging this PR before the prerequisite is in place.
✏️ Learnings added
Learnt from: SoulPancake
Repo: openfga/python-sdk PR: 287
File: .github/workflows/pr-title-conventional-commit.yml:10-13
Timestamp: 2026-05-05T13:18:36.072Z
Learning: In the `openfga/python-sdk` repository, the reusable workflow reference `openfga/sdk-generator/.github/workflows/pr-title-check.ymlmain` in `.github/workflows/pr-title-conventional-commit.yml` is intentionally referencing a file that does not yet exist in `openfga/sdk-generatormain`. It is being added via a separate PR in the sdk-generator repo, and this python-sdk PR is meant to be merged only after that sdk-generator PR lands on main. This is a deliberate cross-repo sequencing pattern, not a bug.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit