Skip to content

feat: draft releases, version verification, and reusable workflows#287

Open
SoulPancake wants to merge 2 commits intomainfrom
feat/release-workflow-improvements
Open

feat: draft releases, version verification, and reusable workflows#287
SoulPancake wants to merge 2 commits intomainfrom
feat/release-workflow-improvements

Conversation

@SoulPancake
Copy link
Copy Markdown
Member

@SoulPancake SoulPancake commented May 4, 2026

Description

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow with automated version verification to ensure consistency before publishing.
    • Enabled draft pull requests for release preparation.
    • Improved pull request validation for better code quality standards.

@SoulPancake SoulPancake requested a review from a team as a code owner May 4, 2026 17:20
Copilot AI review requested due to automatic review settings May 4, 2026 17:20
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Walkthrough

This 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.

Changes

Release Workflow & Version Verification

Layer / File(s) Summary
Configuration
release-please-config.json
Added "draft": true to enable draft release pull requests.
Version Verification
.github/workflows/main.yaml
New verify-version job validates that Git tag, .release-please-manifest.json, and pyproject.toml versions match on tag pushes.
Publish & Release Integration
.github/workflows/main.yaml
publish job now depends on verify-version to block publishing until version consistency confirmed. Removed create-release job and added undraft-release job that delegates to openfga/sdk-generator/.github/workflows/undraft-release.yml@main.

PR Title Validation Refactor

Layer / File(s) Summary
Workflow Delegation
.github/workflows/pr-title-conventional-commit.yml
Replaced inline validate-pr-title job with a pr-title-check job that calls the reusable openfga/sdk-generator/.github/workflows/pr-title-check.yml@main workflow.

Possibly related PRs

  • openfga/python-sdk#262: Modifies release-please configuration and release workflows to improve release automation.
  • openfga/python-sdk#260: Modifies the PR title enforcement workflow by adding an inline pr-conventional-commits step.

Suggested reviewers

  • sergiught
  • rhamzeh

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly and accurately summarizes the three main changes: draft releases, version verification, and reusable workflows. It is concise, specific, and clearly reflects the core modifications in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/release-workflow-improvements

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-version job 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.

Comment thread .github/workflows/pr-title-conventional-commit.yml
Comment thread .github/workflows/main.yaml Outdated
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/')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SoulPancake - I agree with this :)

Comment thread .github/workflows/main.yaml
@SoulPancake SoulPancake requested a review from rhamzeh May 5, 2026 13:09
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 42cb963 and e249cb8.

📒 Files selected for processing (3)
  • .github/workflows/main.yaml
  • .github/workflows/pr-title-conventional-commit.yml
  • release-please-config.json

Comment on lines +120 to +125
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
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 5, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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 -20

Repository: 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:


🏁 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 yaml

Repository: openfga/python-sdk

Length of output: 44


🏁 Script executed:

# Look at release-please.yml to understand release workflow
cat -n .github/workflows/release-please.yml

Repository: 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 md

Repository: 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:


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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes it is still in the PR, We will merge this after that is merged in the sdk generator to main

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.

@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 @main once 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We will pin them eventually, still experimenting with the repo and other stuff etc.

Comment on lines +10 to +13
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
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 5, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 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 f

Repository: 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 yaml

Repository: openfga/python-sdk

Length of output: 44


🏁 Script executed:

cat -n ./.github/workflows/pr-title-conventional-commit.yml

Repository: 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 -50

Repository: 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 -10

Repository: 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 -40

Repository: 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 -20

Repository: 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes it is still in the PR, We will merge this after that is merged in the sdk generator to main

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.

@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.

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