Skip to content

Updates from the package template - #423

Merged
nabobalis merged 5 commits into
mainfrom
cruft/update
Aug 17, 2026
Merged

Updates from the package template#423
nabobalis merged 5 commits into
mainfrom
cruft/update

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Fixes #422

This is an autogenerated PR, which will applies the latest changes from the SunPy Package Template.
If this pull request has been opened as a draft there are conflicts which need fixing.

To run the CI on this pull request you will need to close it and reopen it.

Summary by Sourcery

Update CI and pre-commit configuration to use OIDC-based Codecov reporting and move zizmor security checks into a dedicated GitHub Actions workflow.

CI:

  • Switch Codecov integration in CI workflows to use OIDC-based authentication and adjust permissions accordingly.
  • Update tox job environments and permissions in CI workflows for compatibility with the latest template.
  • Introduce a dedicated GitHub Actions workflow to run zizmor security analysis on pushes and pull requests.

Tests:

  • Adjust CI tox environments to target updated Python versions for core and platform-specific test jobs.

Chores:

  • Remove zizmor from the pre-commit configuration in favor of running it via GitHub Actions.

Summary by Sourcery

Modernize CI security scanning and coverage reporting to align with the latest package template.

New Features:

  • Add a dedicated GitHub Actions workflow for zizmor security analysis on pushes to main and pull requests.

Enhancements:

  • Update CI workflows to use OIDC-based Codecov reporting and current tox workflow configuration.
  • Move zizmor checks from pre-commit into GitHub Actions.

CI:

  • Grant CI jobs OIDC token permissions for Codecov uploads and update their Python test environments.

@github-actions github-actions Bot added the No Changelog Entry Needed Skip all changelog checks. label Aug 17, 2026
@sourcery-ai

sourcery-ai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Aligns the project with the latest SunPy package template by switching CI coverage reporting to Codecov OIDC, updating CI Python/tox targets, and moving zizmor security scanning from pre-commit to a dedicated GitHub Actions workflow.

File-Level Changes

Change Details Files
Migrate Codecov integration in CI workflows from token-based to OIDC-based authentication and align tox environments with the updated template.
  • Set GitHub Actions job permissions to grant id-token: write for Codecov reporting in core and test jobs.
  • Switch tox workflow inputs from coverage: codecov to coverage: codecov-oidc across CI jobs.
  • Remove usage of CODECOV_TOKEN secrets blocks where coverage is now provided via OIDC.
  • Update tox envs matrix to target py314 for core, py312/py313/py314-devdeps for test, and set docs workflow default Python to 3.13 while keeping docs-related envs.
.github/workflows/ci.yml
Move zizmor security scanning from pre-commit to a dedicated GitHub Actions workflow.
  • Remove zizmor pre-commit repo and hook configuration from the pre-commit config.
  • Add a new zizmor GitHub Actions workflow that runs on pushes to main and on pull requests, with appropriate security-events permissions.
  • Configure the zizmor workflow to check out the repository and run the zizmor GitHub Action at a pinned commit.
.pre-commit-config.yaml
.github/workflows/zizmor.yml
Update template metadata to reflect the latest package template state.
  • Refresh cruft metadata to track the current revision of the SunPy package template.
.cruft.json

Assessment against linked issues

Issue Objective Addressed Explanation
#422 Update the repository to match the latest SunPy Package Template so that the package auto-update workflow no longer fails (including updating CI, coverage, and security-check configuration as required by the template).

Possibly linked issues


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

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@nabobalis
nabobalis marked this pull request as ready for review August 17, 2026 16:47

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • Now that Codecov uses OIDC, consider removing the unused CODECOV_TOKEN secret from the repository settings to avoid carrying obsolete credentials.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that Codecov uses OIDC, consider removing the unused CODECOV_TOKEN secret from the repository settings to avoid carrying obsolete credentials.

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yml" line_range="35-36" />
<code_context>
 jobs:
   core:
     uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@8c8bb6c6c962542921f993d47d26df38dccd50b1  # v3.0.2
+    permissions:
+      id-token: write
     with:
       submodules: false
</code_context>
<issue_to_address>
**🚨 issue (security):** Consider also granting `contents: read` for jobs that rely on the reusable tox workflow.

Because the workflow sets `permissions: {}` at the top, this job is currently only granting `id-token: write`. If the reusable `tox.yml` workflow does a checkout (likely), it will also need `contents: read` from the calling job or steps may fail with permission errors. For jobs using the reusable `tox.yml` and Codecov OIDC upload, consider:

```yaml
actions:
  permissions:
    contents: read
    id-token: write
```
</issue_to_address>

### Comment 2
<location path=".github/workflows/zizmor.yml" line_range="9" />
<code_context>
+  pull_request:
+    branches: ["**"]
+
+permissions: {}
+
+jobs:
</code_context>
<issue_to_address>
**🚨 issue (security):** Top-level `permissions: {}` combined with checkout likely requires adding `contents: read` at job or workflow level.

With workflow-level `permissions: {}`, this job only restores `security-events: write`, so `actions/checkout` lacks `contents: read` and may fail. Either:

- Add at workflow level:
  ```yaml
  permissions:
    contents: read
  ```
  and keep `security-events: write` at the job level, or
- Define both at the job level:
  ```yaml
  permissions:
    contents: read
    security-events: write
  ```
</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.

Comment thread .github/workflows/ci.yml
Comment on lines +35 to +36
permissions:
id-token: write

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Consider also granting contents: read for jobs that rely on the reusable tox workflow.

Because the workflow sets permissions: {} at the top, this job is currently only granting id-token: write. If the reusable tox.yml workflow does a checkout (likely), it will also need contents: read from the calling job or steps may fail with permission errors. For jobs using the reusable tox.yml and Codecov OIDC upload, consider:

actions:
  permissions:
    contents: read
    id-token: write

pull_request:
branches: ["**"]

permissions: {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚨 issue (security): Top-level permissions: {} combined with checkout likely requires adding contents: read at job or workflow level.

With workflow-level permissions: {}, this job only restores security-events: write, so actions/checkout lacks contents: read and may fail. Either:

  • Add at workflow level:
    permissions:
      contents: read
    and keep security-events: write at the job level, or
  • Define both at the job level:
    permissions:
      contents: read
      security-events: write

@nabobalis
nabobalis merged commit 44f8df7 into main Aug 17, 2026
22 of 23 checks passed
@nabobalis
nabobalis deleted the cruft/update branch August 17, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Entry Needed Skip all changelog checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SunPy Package Template auto-update failed.

2 participants