-
Notifications
You must be signed in to change notification settings - Fork 34
feat: draft releases, version verification, and reusable workflows #287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,11 +60,37 @@ jobs: | |
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| slug: openfga/python-sdk | ||
|
|
||
| publish: | ||
| verify-version: | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: [test] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Verify versions match | ||
| run: | | ||
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | ||
| MANIFEST_VERSION=$(jq -r '.["."]' .release-please-manifest.json) | ||
| PYPROJECT_VERSION=$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])') | ||
|
|
||
| echo "Tag: $TAG_VERSION | Manifest: $MANIFEST_VERSION | pyproject.toml: $PYPROJECT_VERSION" | ||
|
|
||
| if [[ "$TAG_VERSION" != "$MANIFEST_VERSION" ]]; then | ||
| echo "ERROR: Tag version does not match manifest version" | ||
| exit 1 | ||
| fi | ||
| if [[ "$PYPROJECT_VERSION" != "$MANIFEST_VERSION" ]]; then | ||
| echo "ERROR: pyproject.toml version does not match manifest version" | ||
| exit 1 | ||
| fi | ||
| echo "All versions verified: $TAG_VERSION" | ||
|
|
||
| publish: | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| needs: [verify-version] | ||
|
|
||
| permissions: | ||
| id-token: write # Required for PyPI trusted publishing | ||
|
|
||
|
|
@@ -91,20 +117,9 @@ jobs: | |
| - name: Publish package | ||
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 | ||
|
|
||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| 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 | ||
|
Comment on lines
+120
to
+125
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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:
💡 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 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:
💡 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 Citations:
Remove the
If release automation post-publish is needed, replace this with a reference to the correct workflow ( 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A couple of things worth keeping in mind for that sequencing:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,15 +7,8 @@ on: | |
| - main | ||
|
|
||
| jobs: | ||
| validate-pr-title: | ||
| name: Validate PR Title | ||
| runs-on: ubuntu-latest | ||
| 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 | ||
|
SoulPancake marked this conversation as resolved.
Comment on lines
+10
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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: The file 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.