Skip to content

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

Merged
rhamzeh merged 2 commits into
mainfrom
feat/release-workflow-improvements
May 7, 2026
Merged

feat: draft releases, version verification, and reusable workflows#396
rhamzeh merged 2 commits into
mainfrom
feat/release-workflow-improvements

Conversation

@SoulPancake

@SoulPancake SoulPancake commented May 4, 2026

Copy link
Copy Markdown
Member

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 automated version verification in the release pipeline to ensure consistency across configuration files before publishing.
    • Refactored PR title validation to use a shared workflow approach for improved maintainability.
    • Updated release workflow job dependencies and gating conditions for more reliable deployment processes.

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

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Walkthrough

The PR updates two GitHub Actions workflows: it adds version verification for tag-based releases in the main publishing pipeline and replaces an inline PR title validation job with a delegated reusable workflow call, including associated permission adjustments.

Changes

Release Verification and Publishing Flow

Layer / File(s) Summary
Version Verification
.github/workflows/main.yaml
New verify-version job extracts the tag version and validates it matches .release-please-manifest.json and package.json, failing the workflow if any mismatch is detected.
Publishing Orchestration
.github/workflows/main.yaml
publish job dependency chain changes from [build, test, audit] to verify-version, ensuring version checks pass before publishing.
Release Workflow
.github/workflows/main.yaml
create-release draft job is replaced with undraft-release, which delegates to an external reusable workflow and runs after publish.

PR Title Validation Workflow

Layer / File(s) Summary
Job Delegation
.github/workflows/pr-title-conventional-commit.yml
validate-pr-title job (using ytanikin/pr-conventional-commits) is replaced with pr-title-check, which calls the reusable workflow openfga/sdk-generator/.github/workflows/pr-title-check.yml@main.
Permissions
.github/workflows/pr-title-conventional-commit.yml
Job-level permissions updated to include pull-requests: read for the reusable workflow invocation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • openfga/js-sdk#353: Both PRs modify the same PR title validation workflow, replacing the inline job with a reusable workflow delegation.
  • openfga/js-sdk#362: The version verification and release automation changes in this PR build on release artifacts introduced in that PR.

Suggested reviewers

  • rhamzeh
  • emilic
🚥 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 main changes: adding version verification, draft release handling, and reusable workflows to the CI/CD pipeline.
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.

Copilot AI 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.

Pull request overview

This PR refactors CI/CD workflow definitions by moving PR-title validation and release undrafting into reusable workflows, and adds a version-verification gate before npm publishing. In the broader codebase, this centralizes release automation while tightening the release pipeline around tagged publishes.

Changes:

  • Replaced the inline PR title validation job with a reusable workflow from openfga/sdk-generator.
  • Added a verify-version job to compare release metadata before npm publish.
  • Replaced the local release-creation job with a reusable workflow that undrafts the release after publish.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/pr-title-conventional-commit.yml Swaps the local PR title validation job for a reusable workflow.
.github/workflows/main.yaml Adds version verification before publish and replaces release creation with reusable undraft logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/main.yaml
Comment thread .github/workflows/pr-title-conventional-commit.yml
@SoulPancake
SoulPancake enabled auto-merge May 5, 2026 13:10
@SoulPancake
SoulPancake disabled auto-merge May 5, 2026 15:32
@SoulPancake SoulPancake added github_actions Pull requests that update GitHub Actions code and removed github_actions Pull requests that update GitHub Actions code labels May 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/main.yaml (1)

133-140: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

env.NODE_VERSION is undefined — publish job runs on an unintended Node version.

The workflow only declares TARGET_NODE_VERSION (line 13). ${{ env.NODE_VERSION }} here expands to an empty string, so actions/setup-node falls back to whatever Node is preinstalled on the runner image rather than the pinned 24.x used by test and audit. Releases will be built/published against an unspecified Node major. Although this line predates the PR, the new verify-version → publish chain means every tag now flows through this misconfigured step.

🐛 Proposed fix
       - name: Set up node
         uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
         with:
-          node-version: ${{ env.NODE_VERSION }}
+          node-version: ${{ env.TARGET_NODE_VERSION }}
           registry-url: "https://registry.npmjs.org"
           scope: "@openfga"
           always-auth: false
           cache: "npm"
🤖 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 133 - 140, The workflow's
actions/setup-node step is using an undefined env variable env.NODE_VERSION
causing an unintended Node version; update that step to reference the declared
TARGET_NODE_VERSION (or set NODE_VERSION = TARGET_NODE_VERSION in the workflow
env) so node-version uses the pinned value (e.g., ${{ env.TARGET_NODE_VERSION
}}) and ensure the actions/setup-node invocation (the step using
actions/setup-node@...) uses that corrected variable.
🤖 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 177-182: Remove the failing job `undraft-release` from the
workflow YAML: delete the `undraft-release` job block (the job named
"undraft-release" that contains the `uses:
openfga/sdk-generator/.github/workflows/undraft-release.yml@main` reference and
its `if`, `needs`, and `permissions` keys) so the workflow no longer references
the non-existent `undraft-release.yml`; if undrafting is still required, instead
replace that `uses:` entry with a valid existing workflow path or add the
correct workflow file to the `openfga/sdk-generator` repo before re-adding the
job.

In @.github/workflows/pr-title-conventional-commit.yml:
- Around line 10-13: The reusable workflow reference for the job pr-title-check
points to openfga/sdk-generator/.github/workflows/pr-title-check.yml@main which
doesn't exist; fix by either adding the missing file pr-title-check.yml into the
target repo's .github/workflows directory or update the uses value to the
correct repo/path (or to a local reusable workflow reference ./
.github/workflows/pr-title-check.yml if the workflow should live in this repo),
and once the correct workflow location is set, replace the branch tag `@main` with
a specific commit SHA to pin the call per GitHub security guidance.

---

Outside diff comments:
In @.github/workflows/main.yaml:
- Around line 133-140: The workflow's actions/setup-node step is using an
undefined env variable env.NODE_VERSION causing an unintended Node version;
update that step to reference the declared TARGET_NODE_VERSION (or set
NODE_VERSION = TARGET_NODE_VERSION in the workflow env) so node-version uses the
pinned value (e.g., ${{ env.TARGET_NODE_VERSION }}) and ensure the
actions/setup-node invocation (the step using actions/setup-node@...) uses that
corrected variable.
🪄 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: b0fa0962-a4b5-40d3-b2c2-cfa9b5aaa9e1

📥 Commits

Reviewing files that changed from the base of the PR and between 6b03882 and 0e6af29.

📒 Files selected for processing (2)
  • .github/workflows/main.yaml
  • .github/workflows/pr-title-conventional-commit.yml

Comment thread .github/workflows/main.yaml
Comment thread .github/workflows/pr-title-conventional-commit.yml
@rhamzeh
rhamzeh added this pull request to the merge queue May 7, 2026
@rhamzeh
rhamzeh removed this pull request from the merge queue due to a manual request May 7, 2026
@rhamzeh
rhamzeh added this pull request to the merge queue May 7, 2026
@rhamzeh
rhamzeh removed this pull request from the merge queue due to a manual request May 7, 2026
@rhamzeh rhamzeh closed this May 7, 2026
@rhamzeh
rhamzeh deleted the feat/release-workflow-improvements branch May 7, 2026 04:38
@rhamzeh
rhamzeh restored the feat/release-workflow-improvements branch May 7, 2026 04:38
@rhamzeh rhamzeh reopened this May 7, 2026
@rhamzeh
rhamzeh added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 83bf30e May 7, 2026
9 checks passed
@rhamzeh
rhamzeh deleted the feat/release-workflow-improvements branch May 7, 2026 07:05
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