Skip to content

Conversation

@cesarcoatl
Copy link
Member

@cesarcoatl cesarcoatl commented Dec 16, 2025

streamline ci

Summary by Sourcery

Update repository metadata and CI workflows to reflect the java-api repo rename and simplify packaging automation.

Enhancements:

  • Refresh packaging metadata URLs and descriptions for both main package and stubs to reference the new java-api repository structure.
  • Rename pre-commit hook labels for isort and flake8 to use generic package and stubs naming.
  • Relax Dependabot schedule for GitHub Actions updates to run quarterly and fix commit message include configuration.

CI:

  • Adjust CI workflow to run tox packaging and stub checks directly on pull_request events using shared reusable workflows.
  • Simplify the publish workflow to upload main and stubs packages to PyPI without chaining through separate CI and pr-build workflows.

Documentation:

  • Update README and stubs documentation links and badges to point to the renamed java-api repository and main branch.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 16, 2025

Reviewer's Guide

Updates repository metadata and CI/publishing workflows to reflect the repo rename from java-api-17 to java-api, streamlines CI by removing the pr-build indirection, and renames pre-commit hooks for clarity.

File-Level Changes

Change Details Files
Adjust CI workflow to run tox-based checks directly on pull requests and remove unused triggers.
  • Add tox-package job that runs tox via the shared tox-docker workflow only for pull_request events.
  • Add tox-stubs job that runs the shared tox workflow against the stubs directory for Python 3.9–3.12 only on pull_request events.
  • Remove workflow_call and workflow_dispatch triggers from the main CI workflow.
  • Keep pylint job wired to the shared pylint workflow without behavior changes.
.github/workflows/ci.yml
Simplify the publish workflow by inlining the build and updating step labels for clarity.
  • Remove dependencies on the CI and pr-build reusable workflows from the publish workflow.
  • Keep only the pypi-upload job, which now runs directly without needs dependencies.
  • Rename the upload steps to generic package and stubs wording, keeping the same PyPI upload action and secrets.
  • Delete the now-unused pr-build workflow file.
.github/workflows/publish.yml
.github/workflows/pr-build.yml
Update repository URLs and badges to reflect the new java-api repo name across docs and packaging metadata.
  • Update README badges and documentation links from java-api-17 to java-api, including CONTRIBUTING, CONTRIBUTORS, and LICENSE URLs.
  • Update setup.cfg project metadata (url, Source, Tracker) to point to the java-api repository and adjust the package description to drop the explicit '17'.
  • Update stubs README links to CONTRIBUTING, contributors, LICENSE, and the main java-api repo to use the new repository location.
  • Update stubs/pyproject.toml project URLs (Homepage, Source, Tracker) to the new java-api repo paths.
README.md
setup.cfg
stubs/README.md
stubs/pyproject.toml
Retitle pre-commit hook names to be repo-agnostic and adjust Dependabot schedule and commit message config.
  • Rename isort and flake8 hook names in .pre-commit-config.yaml from java-api/java-api-stubs specific names to generic package/stubs names.
  • Change Dependabot GitHub Actions update interval from weekly to quarterly to reduce churn.
  • Quote the include field in Dependabot commit-message configuration to "scope" for consistency.
.pre-commit-config.yaml
.github/dependabot.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • With the new tox-package and tox-stubs jobs gated on github.event_name == 'pull_request' and the removal of workflow_call/workflow_dispatch, CI for tox no longer runs on push to main or as a reusable workflow; confirm this reduced coverage is intentional or add corresponding conditions/triggers if you still want those paths exercised.
  • The publish.yml workflow now uploads directly to PyPI without depending on the previous ci/pr-build workflows, so if you still need artifacts built or validation performed before publishing, consider reintroducing those steps or explicitly building/verifying within pypi-upload.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- With the new `tox-package` and `tox-stubs` jobs gated on `github.event_name == 'pull_request'` and the removal of `workflow_call`/`workflow_dispatch`, CI for tox no longer runs on `push` to `main` or as a reusable workflow; confirm this reduced coverage is intentional or add corresponding conditions/triggers if you still want those paths exercised.
- The `publish.yml` workflow now uploads directly to PyPI without depending on the previous `ci`/`pr-build` workflows, so if you still need artifacts built or validation performed before publishing, consider reintroducing those steps or explicitly building/verifying within `pypi-upload`.

## Individual Comments

### Comment 1
<location> `.github/workflows/publish.yml:9` </location>
<code_context>
-    needs: ci
-    uses: ./.github/workflows/pr-build.yml
-
   pypi-upload:
-    needs: pr-build
     runs-on: ubuntu-latest
</code_context>

<issue_to_address>
**issue (bug_risk):** Removing the `needs` chain allows PyPI upload without any CI/pr-build gating.

`pypi-upload` will now run on every `release` event even if CI/pr-build fails. If you still want uploads blocked by tests/builds, please add an explicit dependency (e.g., on a check job or reusable workflow). If this decoupling is intentional, verify that nothing else still assumes the old gated behavior.
</issue_to_address>

### Comment 2
<location> `.github/workflows/ci.yml:10-12` </location>
<code_context>
-  workflow_dispatch:

 jobs:
+  tox-package:
+    if: ${{ github.event_name == 'pull_request' }}
+    uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6
+
+  tox-stubs:
</code_context>

<issue_to_address>
**question (testing):** Tox jobs are restricted to pull requests and will not run on pushes to `main`.

Because `tox-package` (and `tox-stubs`) is guarded by `if: ${{ github.event_name == 'pull_request' }}`, these checks won’t run on `push` events to `main`—only `pylint` will. If you want tox to run on direct pushes (e.g., release or admin pushes), consider adjusting the condition to also allow `push` to `main` (e.g., via `github.ref == 'refs/heads/main'`). If tox-on-PR-only is intentional, no change needed.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

needs: ci
uses: ./.github/workflows/pr-build.yml

pypi-upload:
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Removing the needs chain allows PyPI upload without any CI/pr-build gating.

pypi-upload will now run on every release event even if CI/pr-build fails. If you still want uploads blocked by tests/builds, please add an explicit dependency (e.g., on a check job or reusable workflow). If this decoupling is intentional, verify that nothing else still assumes the old gated behavior.

Comment on lines +10 to +12
tox-package:
if: ${{ github.event_name == 'pull_request' }}
uses: coatl-dev/workflows/.github/workflows/tox-docker.yml@v6
Copy link
Contributor

Choose a reason for hiding this comment

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

question (testing): Tox jobs are restricted to pull requests and will not run on pushes to main.

Because tox-package (and tox-stubs) is guarded by if: ${{ github.event_name == 'pull_request' }}, these checks won’t run on push events to main—only pylint will. If you want tox to run on direct pushes (e.g., release or admin pushes), consider adjusting the condition to also allow push to main (e.g., via github.ref == 'refs/heads/main'). If tox-on-PR-only is intentional, no change needed.

@cesarcoatl cesarcoatl merged commit e53434b into main Dec 16, 2025
5 checks passed
@cesarcoatl cesarcoatl deleted the chore/rename-repo branch December 16, 2025 16:56
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.

2 participants