Skip to content

feat: release automation configs#312

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

feat: release automation configs#312
SoulPancake wants to merge 2 commits intomainfrom
feat/release-automation

Conversation

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Warning

Rate limit exceeded

@SoulPancake has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1176d417-2b71-4638-aa89-eb8fbd9aa041

📥 Commits

Reviewing files that changed from the base of the PR and between 00ad715 and 8cd7014.

📒 Files selected for processing (6)
  • .github/workflows/release-please.yml
  • .release-please-manifest.json
  • RELEASE.md
  • build.gradle
  • release-please-config.json
  • src/main/java/dev/openfga/sdk/constants/FgaConstants.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/release-automation

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.

Comment on lines +30 to +36
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
with:
bump-type: ${{ inputs.bump-type || 'auto' }}
release-version: ${{ inputs.release-version || '' }}
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 4 days ago

In general, to fix this issue you should explicitly declare a permissions block in the workflow (either at the root or per-job) that grants only the minimal scopes required for the job. This prevents the workflow from inheriting broader default GITHUB_TOKEN permissions from the repository or organization.

For this specific file, the safest and most compatible approach—without changing existing functionality—is to add a root-level permissions block that grants read-only access to repository contents, which is a common minimal baseline and aligns with the suggested “minimal starting point” in the warning. Because this workflow simply delegates to a reusable workflow via uses: openfga/sdk-generator/.github/workflows/release-please.yml@main and we cannot see its internals, we should not try to guess additional write scopes; if that reusable workflow needs more, it can (and should) request them itself. The change should be added near the top of .github/workflows/release-please.yml, for example immediately after the name: release-please line, so that it applies to all jobs defined in this workflow (including the release job).

No additional imports or methods are needed; only YAML configuration changes are required.

Suggested changeset 1
.github/workflows/release-please.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml
--- a/.github/workflows/release-please.yml
+++ b/.github/workflows/release-please.yml
@@ -1,5 +1,8 @@
 name: release-please
 
+permissions:
+  contents: read
+
 on:
   push:
     branches: [main]
@@ -30,7 +33,7 @@
     uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
     with:
       bump-type: ${{ inputs.bump-type || 'auto' }}
-      release-version: ${{ inputs.release-version || '' }}
+      release-version: ${{ inputs-release-version || '' }}
     secrets:
       APP_ID: ${{ secrets.APP_ID }}
       APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
EOF
@@ -1,5 +1,8 @@
name: release-please

permissions:
contents: read

on:
push:
branches: [main]
@@ -30,7 +33,7 @@
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
with:
bump-type: ${{ inputs.bump-type || 'auto' }}
release-version: ${{ inputs.release-version || '' }}
release-version: ${{ inputs-release-version || '' }}
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
Copilot is powered by AI and may make mistakes. Always verify output.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.04%. Comparing base (00ad715) to head (8cd7014).

❌ Your project status has failed because the head coverage (38.04%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #312      +/-   ##
============================================
- Coverage     38.05%   38.04%   -0.02%     
+ Complexity     1259     1258       -1     
============================================
  Files           198      198              
  Lines          7646     7646              
  Branches        885      885              
============================================
- Hits           2910     2909       -1     
  Misses         4598     4598              
- Partials        138      139       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SoulPancake SoulPancake marked this pull request as ready for review April 2, 2026 06:31
@SoulPancake SoulPancake requested a review from a team as a code owner April 2, 2026 06:31
Copilot AI review requested due to automatic review settings April 2, 2026 06:31
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 introduces release-please configuration and documentation to automate version bumps, changelog generation, and release PR creation for the OpenFGA Java SDK.

Changes:

  • Add release-please manifest/config and a reusable GitHub Actions workflow for releases.
  • Annotate version declarations to be discoverable by release-please.
  • Document the intended release process and versioning rules in a new release guide.

Reviewed changes

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

Show a summary per file
File Description
src/main/java/dev/openfga/sdk/constants/FgaConstants.java Adds a release-please version marker to the SDK version constant.
build.gradle Adds a release-please version marker to the Gradle project version.
release-please-config.json Adds release-please configuration (changelog sections, extra-files, pre-1.0 bump behavior).
.release-please-manifest.json Adds the initial release-please manifest version.
.github/workflows/release-please.yml Adds the release-please workflow (push + manual dispatch) using a reusable workflow.
RELEASE.md Adds documentation describing how to cut releases and troubleshoot release-please.

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


/** Version of the OpenFGA Java SDK. */
public static final String SDK_VERSION = "0.9.7";
public static final String SDK_VERSION = "0.9.7"; // x-release-please-version
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

FgaConstants.java is marked as auto-generated (and is listed in .openapi-generator/FILES). Editing generated sources directly is likely to be overwritten on the next regeneration; the x-release-please-version marker should be added in the generator templates (sdk-generator repo) or moved to a non-generated source so it remains stable across regenerations.

Suggested change
public static final String SDK_VERSION = "0.9.7"; // x-release-please-version
public static final String SDK_VERSION = "0.9.7";

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33
bump-type: ${{ inputs.bump-type || 'auto' }}
release-version: ${{ inputs.release-version || '' }}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This workflow runs on both push and workflow_dispatch, but it references the inputs.* context in the reusable-workflow with: block. On non-workflow_dispatch events (e.g. push), inputs can be undefined and cause the workflow to fail to evaluate. Consider switching to github.event.inputs.* with defaults, or conditionally setting with: values based on github.event_name (e.g. hardcode bump-type: auto on push).

Suggested change
bump-type: ${{ inputs.bump-type || 'auto' }}
release-version: ${{ inputs.release-version || '' }}
bump-type: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.bump-type || 'auto') || 'auto' }}
release-version: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.release-version || '') || '' }}

Copilot uses AI. Check for mistakes.

jobs:
release:
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The reusable workflow is referenced with @main. To reduce supply-chain risk and ensure reproducible releases, pin this to a specific commit SHA or a version tag of openfga/sdk-generator instead of a moving branch.

Suggested change
uses: openfga/sdk-generator/.github/workflows/release-please.yml@main
uses: openfga/sdk-generator/.github/workflows/release-please.yml@v0.4.0

Copilot uses AI. Check for mistakes.
],
"extra-files": [
{ "type": "generic", "path": "build.gradle" },
{ "type": "generic", "path": "src/main/java/dev/openfga/sdk/constants/FgaConstants.java" }
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

extra-files only lists build.gradle and FgaConstants.java, but this repo hard-codes the current version in other files (e.g. publish.gradle and multiple README.md dependency snippets). With the current config, release-please will bump only a subset, leaving inconsistent versions and potentially incorrect published metadata. Either add the other versioned files to extra-files or refactor them to derive from a single source of truth (e.g. project.version).

Suggested change
{ "type": "generic", "path": "src/main/java/dev/openfga/sdk/constants/FgaConstants.java" }
{ "type": "generic", "path": "src/main/java/dev/openfga/sdk/constants/FgaConstants.java" },
{ "type": "generic", "path": "publish.gradle" },
{ "type": "generic", "path": "README.md" }

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +5
This project uses [release-please](https://github.com/googleapis/release-please) via a
`workflow_dispatch`-triggered GitHub Actions workflow. This document explains how to cut
a release and what to watch out for.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The guide says releases use a workflow_dispatch-triggered workflow, but .github/workflows/release-please.yml also runs on push to main. Either update this documentation to describe the push behavior, or remove the push trigger if the intent is manual-only releases.

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +32
4. The GitHub Release and tag are created automatically on merge.

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This section claims “The GitHub Release and tag are created automatically on merge,” but the existing pipeline creates releases via .github/workflows/main.yaml and currently marks them as draft: true. Please clarify whether the release should be drafted vs published automatically, and which workflow is the source of truth to avoid duplicate/conflicting release creation.

Suggested change
4. The GitHub Release and tag are created automatically on merge.
4. On merge, `.github/workflows/main.yaml` automatically creates a **draft** GitHub Release and tag. This workflow is the single source of truth for creating GitHub Releases and tags; do not enable release creation in the release-please workflow to avoid duplicates.
5. When you are ready to publish, go to **Releases**, review the draft release created by `.github/workflows/main.yaml`, and click **Publish release**.

Copilot uses AI. Check for mistakes.
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.

4 participants