ci: add release-please, dependabot, and PR title validation#626
ci: add release-please, dependabot, and PR title validation#626
Conversation
Replace manual tag-based release workflow with release-please for automated changelog generation and version bumps via conventional commits. Add Dependabot for weekly dependency scanning with auto-merge for minor/patch updates. Add PR title validation to enforce conventional commit format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Dependabot configuration and auto-merge, enforces conventional PR titles, replaces tag-based release flow with Release Please-driven automation (including publish workflow), updates CITATION handling, removes Renovate and a release-notes extraction script, and adjusts packaging exclusions for Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dependabot as Dependabot
participant GH_Actions as GitHub Actions
participant FetchMeta as dependabot/fetch-metadata
participant GH_CLI as gh CLI
participant Repo as Repository
Note over Dependabot,Repo: Dependabot opens PR
Dependabot->>GH_Actions: pull_request event
GH_Actions->>FetchMeta: run fetch-metadata
FetchMeta-->>GH_Actions: outputs.update-type
alt update-type != version-update:semver-major
GH_Actions->>GH_CLI: gh pr merge "$PR" --auto --squash
GH_CLI-->>Repo: merge PR
else semver-major
GH_Actions-->>Repo: no auto-merge (manual review)
end
sequenceDiagram
autonumber
participant Dev as Developer Push
participant GH as GitHub Actions
participant RP as release-please
participant Publish as Publish workflow
participant PyPI as PyPI
participant Verify as Verify step
participant Docs as Docs Deploy
participant Repo as Repository
Dev->>GH: push to main (or release-please triggers)
GH->>RP: run release-please action
RP-->>GH: outputs (release_created, tag_name, version)
alt release_created == "true"
GH->>Publish: call publish workflow (tag_name)
Publish->>PyPI: build & upload package
PyPI-->>Verify: release available
Verify-->>Publish: install & import check
Publish-->>GH: publish success
GH->>Repo: update CITATION.cff (date-released) and push to main
GH->>Docs: deploy docs for tag_name
else
GH-->>Repo: no release-triggered downstream jobs
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/pr-title.yaml (2)
3-5: Thesynchronizetrigger is unnecessary for title validation.PR titles don't change when new commits are pushed. Removing
synchronizewould avoid redundant workflow runs.Proposed change
on: pull_request: - types: [opened, edited, synchronize, reopened] + types: [opened, edited, reopened]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-title.yaml around lines 3 - 5, The pull_request workflow currently lists types: [opened, edited, synchronize, reopened] in the pull_request trigger; remove the unnecessary "synchronize" event from that array so the trigger becomes types: [opened, edited, reopened] under the pull_request block to avoid redundant runs for new commits.
16-25: Consider addingrevertandstyletypes.The conventional commits specification also includes
revert(for reverting previous commits) andstyle(for formatting/whitespace changes). If contributors use these, the PR will be rejected.Proposed addition
types: | feat fix refactor test docs chore ci build perf + revert + style🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/pr-title.yaml around lines 16 - 25, Update the PR title workflow's types list to include the missing conventional commit types by adding "revert" and "style" to the existing types block (the YAML key "types" in the workflow). Modify the list under the types multi-line string where values like "feat", "fix", "refactor", etc. are declared so that "revert" and "style" appear alongside them, ensuring PRs using these conventional commit types won’t be rejected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release.yaml:
- Around line 145-150: The shell command using `git diff --staged --quiet || git
commit -m "chore: update CITATION.cff date-released" && git push origin main`
has operator precedence that causes `git push` to run even when no commit
occurs; change the logic to group the commit-and-push together so push only runs
when a commit was created, for example replace that pipeline with `git diff
--staged --quiet || (git commit -m "chore: update CITATION.cff date-released" &&
git push origin main)` or equivalently use an if-check around `git commit`/`git
push` so the commit-and-push are executed atomically (reference the `git diff
--staged --quiet`, `git commit -m "chore: update CITATION.cff date-released"`,
and `git push origin main` commands).
In @.release-please-config.json:
- Around line 1-14: Update the release-please config by changing the
release-type value in the package entry for "." from "python" to "simple":
locate the "release-type" key in the JSON (the package block that includes
"package-name": "flixopt", "changelog-path": "CHANGELOG.md", and "extra-files":
["CITATION.cff"]) and replace "python" with "simple" so Release Please will
create git tags and update CHANGELOG.md compatible with setuptools_scm-driven
versioning.
---
Nitpick comments:
In @.github/workflows/pr-title.yaml:
- Around line 3-5: The pull_request workflow currently lists types: [opened,
edited, synchronize, reopened] in the pull_request trigger; remove the
unnecessary "synchronize" event from that array so the trigger becomes types:
[opened, edited, reopened] under the pull_request block to avoid redundant runs
for new commits.
- Around line 16-25: Update the PR title workflow's types list to include the
missing conventional commit types by adding "revert" and "style" to the existing
types block (the YAML key "types" in the workflow). Modify the list under the
types multi-line string where values like "feat", "fix", "refactor", etc. are
declared so that "revert" and "style" appear alongside them, ensuring PRs using
these conventional commit types won’t be rejected.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: de0d0630-661c-4250-9a3e-964926e5c604
📒 Files selected for processing (7)
.github/dependabot.yml.github/workflows/dependabot-auto-merge.yaml.github/workflows/pr-title.yaml.github/workflows/release.yaml.release-please-config.json.release-please-manifest.jsonCITATION.cff
- pr-title.yaml: add release-please branch trigger so the check passes on release-please PRs (required if "PR Title" is a required check) - release-please-manifest: seed at 6.2.0rc0 (latest tag, not 6.1.0) - release.yaml: fix shell precedence bug in update-citation-date job - Remove dead scripts/extract_release_notes.py (no longer used) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add `v*.*.*` tag trigger so manually pushed tags run the full build/publish pipeline and create a GitHub prerelease - Introduce `release-info` hub job that unifies release-please and tag-push paths for downstream jobs - Switch release-type from "python" to "simple" (setuptools_scm derives version from git tags, no static version files to bump) - Skip docs deploy and citation update for prereleases - pr-title.yaml: drop redundant `synchronize` trigger, add `revert` and `style` types Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release.yaml:
- Around line 142-143: The VERSION shell assignment in the GitHub Actions run
step should use a quoted expansion to avoid word-splitting or surprises when
needs.release-info.outputs.version is empty or contains special characters;
update the run step so the VERSION variable assignment uses a quoted expansion
of needs.release-info.outputs.version (refer to VERSION and
needs.release-info.outputs.version in the run block).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3bc0fd01-9e67-4e58-95c1-04f9fcb3a3ec
📒 Files selected for processing (3)
.github/workflows/pr-title.yaml.github/workflows/release.yaml.release-please-config.json
✅ Files skipped from review due to trivial changes (1)
- .release-please-config.json
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/pr-title.yaml
Adopt the blueprint pattern: release.yaml handles release-please on main, publish.yaml is a reusable workflow with two triggers: - workflow_call: called by release-please for stable releases - push tags v*: manual tag push for prereleases The github-release job only runs on tag push (release-please creates its own release). Prerelease detection uses PEP 440 patterns (rc/alpha/beta) instead of semver hyphens. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Start verify-pypi retry at 30s instead of 10s (PyPI propagation) - Add clarifying comment on github-release condition Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
git push origin v6.2.0rc1triggers the full test → build → publish → verify pipeline and creates a GitHub prereleasefeat:,fix:,refactor:, etc.)Architecture
Follows the python-project-blueprint pattern with two workflows:
release.yaml— Runs on push tomain. release-please creates/updates a release PR; on merge, callspublish.yamlviaworkflow_call, then updatesCITATION.cffdate and deploys docs.publish.yaml— Reusable workflow with two triggers:workflow_call: called by release-please for stable releasespush: tags: ["v*"]: manual tag push for prereleasesOther changes
.github/dependabot.yml— Weekly scans for Actions + pip.github/workflows/dependabot-auto-merge.yaml— Auto-squash-merge minor/patch Dependabot PRs.github/workflows/pr-title.yaml— Conventional commit validation (includesrevertandstyletypes).release-please-config.json/.release-please-manifest.json— release-please config withrelease-type: "simple"(compatible withsetuptools_scm)CITATION.cff— Addedx-release-please-versionmarker for automatic version updatesrenovate.jsonandscripts/extract_release_notes.pySetup required
RELEASE_BOT_APP_ID/RELEASE_BOT_PRIVATE_KEY) is reused for release-pleasemainTest plan
git tag v6.2.0rc1 && git push origin v6.2.0rc1→ tests → PyPI publish → GitHub prerelease🤖 Generated with Claude Code
Summary by CodeRabbit