Repository navigation
chore: prepare repo for multiple branches - #54
Conversation
Reviewer's GuideConfigurationPass the intended branch or release tag through the CI, reusable tox, and publish workflows so jobs check out the correct ref.
Remove the Dependabot configuration and obsolete pre-commit message and skip settings.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="7" />
<code_context>
- pull_request:
push:
branches:
- - main
+ - '17'
+ pull_request:
</code_context>
<issue_to_address>
**Branches receive no CI checks**
When a push or pull request targets a branch other than `17`, `ci.yml` filters both events to `17`, so pushes and pull requests targeting `main` and other branches do not schedule `pre-commit`, `pylint`, or `tox`, leaving those branches without CI validation.
Remove the branch filters from both triggers so the workflow runs for pushes and pull requests to all branches.
Also at `.github/workflows/ci.yml:6`, `.github/workflows/ci.yml:9`.
</issue_to_address>
### Comment 2
<location path=".pre-commit-config.yaml" line_range="1-5" />
<code_context>
-ci:
- autoupdate_commit_msg: 'build(deps): pre-commit autoupdate'
- autofix_commit_msg: 'style: apply auto fixes with pre-commit'
- skip:
- - pylint
-
repos:
</code_context>
<issue_to_address>
**pre-commit.ci checks fail**
When pre-commit.ci runs the hooks without a `pylint` executable, the local `language: system` `pylint` hook is no longer skipped, so it invokes an executable the config does not install and the hosted check fails.
Restore `pylint` in the pre-commit.ci skip list or provision the executable for the hook.
</issue_to_address>
### Comment 3
<location path=".github/workflows/publish.yml" line_range="11" />
<code_context>
tox:
uses: $/.github/workflows/tox.yml
+ with:
+ checkout-ref: ${{ github.event.release.tag_name }}
pypi-upload:
</code_context>
<issue_to_address>
**Untested code gets published**
When the release tag is moved after tox checks it out but before the upload job checks it out, the tox job resolves the release tag when it checks out the source, then the upload job resolves that tag again after tox finishes. If the tag is moved between those checkouts, PyPI receives code that tox did not test.
Resolve the release tag to a commit SHA once and use that SHA for both testing and upload.
Also at `.github/workflows/publish.yml:20`.
</issue_to_address>Sourcery assessment
Approval pending. 3 findings to address first.
Blocking findings: .github/workflows/ci.yml:7, .pre-commit-config.yaml:5, .github/workflows/publish.yml:11
| pull_request: | ||
| push: | ||
| branches: | ||
| - main |
There was a problem hiding this comment.
🟠 High · Branches receive no CI checks
When a push or pull request targets a branch other than 17, ci.yml filters both events to 17, so pushes and pull requests targeting main and other branches do not schedule pre-commit, pylint, or tox, leaving those branches without CI validation.
Remove the branch filters from both triggers so the workflow runs for pushes and pull requests to all branches.
Also at .github/workflows/ci.yml:6, .github/workflows/ci.yml:9.
Prompt for AI agents
In `.github/workflows/ci.yml` at line 7:
**Branches receive no CI checks**
When a push or pull request targets a branch other than `17`, `ci.yml` filters both events to `17`, so pushes and pull requests targeting `main` and other branches do not schedule `pre-commit`, `pylint`, or `tox`, leaving those branches without CI validation.
Remove the branch filters from both triggers so the workflow runs for pushes and pull requests to all branches.
Also at `.github/workflows/ci.yml:6`, `.github/workflows/ci.yml:9`.| ci: | ||
| autoupdate_commit_msg: 'build(deps): pre-commit autoupdate' | ||
| autofix_commit_msg: 'style: apply auto fixes with pre-commit' | ||
| skip: | ||
| - pylint |
There was a problem hiding this comment.
🟡 Medium · pre-commit.ci checks fail
When pre-commit.ci runs the hooks without a pylint executable, the local language: system pylint hook is no longer skipped, so it invokes an executable the config does not install and the hosted check fails.
Restore pylint in the pre-commit.ci skip list or provision the executable for the hook.
Prompt for AI agents
In `.pre-commit-config.yaml` at lines 1-5:
**pre-commit.ci checks fail**
When pre-commit.ci runs the hooks without a `pylint` executable, the local `language: system` `pylint` hook is no longer skipped, so it invokes an executable the config does not install and the hosted check fails.
Restore `pylint` in the pre-commit.ci skip list or provision the executable for the hook.| tox: | ||
| uses: $/.github/workflows/tox.yml | ||
| with: | ||
| checkout-ref: ${{ github.event.release.tag_name }} |
There was a problem hiding this comment.
🟡 Medium · Untested code gets published
When the release tag is moved after tox checks it out but before the upload job checks it out, the tox job resolves the release tag when it checks out the source, then the upload job resolves that tag again after tox finishes. If the tag is moved between those checkouts, PyPI receives code that tox did not test.
Resolve the release tag to a commit SHA once and use that SHA for both testing and upload.
Also at .github/workflows/publish.yml:20.
Prompt for AI agents
In `.github/workflows/publish.yml` at line 11:
**Untested code gets published**
When the release tag is moved after tox checks it out but before the upload job checks it out, the tox job resolves the release tag when it checks out the source, then the upload job resolves that tag again after tox finishes. If the tag is moved between those checkouts, PyPI receives code that tox did not test.
Resolve the release tag to a commit SHA once and use that SHA for both testing and upload.
Also at `.github/workflows/publish.yml:20`.
Summary by Sourcery
Prepare repository automation to support branch-specific testing and releases.
Enhancements:
CI:
Chores: