Skip to content

Conversation

@joamatab
Copy link
Contributor

@joamatab joamatab commented Dec 20, 2025

Summary by Sourcery

Configure automated changelog generation and GFP tests in CI.

Build:

  • Add towncrier as a development dependency and configure it to run automatically before version bumps via tbump.

CI:

  • Add workflow-level concurrency control and GFP-specific test job with required API key in the GitHub Actions test workflow.

Documentation:

  • Configure towncrier-managed release notes, including a changelog template and marker in CHANGELOG.md for autogenerated entries.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 20, 2025

Reviewer's Guide

Adds a new GFP-specific test job to the GitHub Actions workflow and introduces automated changelog generation using towncrier integrated with tbump.

Flow diagram for tbump and towncrier changelog generation

flowchart LR
  Dev[Developer] --> Run_tbump[Run_tbump_for_new_version]
  Run_tbump --> Tbump_before_commit[tbump_before_commit_hook]
  Tbump_before_commit --> Towncrier_cmd[towncrier_build_with_new_version]
  Towncrier_cmd --> Read_fragments[Read_entries_from_changelog_d]
  Read_fragments --> Apply_template[Apply_changelog_template_jinja]
  Apply_template --> Update_changelog[Update_CHANGELOG_md_after_start_string]
  Update_changelog --> Git_commit[Commit_version_and_changelog_changes]
Loading

File-Level Changes

Change Details Files
Extend CI workflow to run GFP tests with proper concurrency control and environment configuration.
  • Add workflow-level concurrency group to cancel in-progress runs on the same ref
  • Expose GFP_API_KEY from repository secrets as a workflow environment variable
  • Define a new test_gfp job using Ubuntu, Python 3.12, uv for dependency management, and running uv run gfp test
.github/workflows/test_code.yml
Add and configure towncrier for automated changelog generation hooked into the release bump process.
  • Include towncrier as a development dependency
  • Configure tbump to run towncrier build before committing a new version
  • Add towncrier configuration pointing at .changelog.d and the main CHANGELOG file with project-specific formatting
  • Insert the towncrier start marker into the existing CHANGELOG
  • Add a Jinja2 changelog template to control section/category rendering of release notes
pyproject.toml
CHANGELOG.md
.changelog.d/changelog_template.jinja

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-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 20, 2025
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 - I've left some high level feedback:

  • Consider scoping GFP_API_KEY to only the test_gfp job instead of defining it at the workflow level if no other jobs require it, to reduce unnecessary secret exposure.
  • The Towncrier config uses issue_format and package values pointing to gdsfactory/gf180mcu and gdsfactory; double-check these match this repository’s actual org/repo and package name to avoid broken links or incorrect metadata in the generated changelog.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider scoping `GFP_API_KEY` to only the `test_gfp` job instead of defining it at the workflow level if no other jobs require it, to reduce unnecessary secret exposure.
- The Towncrier config uses `issue_format` and `package` values pointing to `gdsfactory/gf180mcu` and `gdsfactory`; double-check these match this repository’s actual org/repo and package name to avoid broken links or incorrect metadata in the generated changelog.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants