Skip to content

Conversation

@joamatab
Copy link
Contributor

@joamatab joamatab commented Dec 2, 2025

Summary by Sourcery

Add CI coverage for the gdsfactoryplus (gfp) test command in the GitHub Actions workflow.

CI:

  • Expose GFP_API_KEY from repository secrets as an environment variable for the test workflow.
  • Add a dedicated GitHub Actions job that installs dependencies and runs uv run gfp test on Python 3.12.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 2, 2025

Reviewer's Guide

Updates the GitHub Actions test workflow to inject a GFP API key into the environment and add a dedicated job that installs dependencies and runs the gfp test suite via uv on Python 3.12 Ubuntu runners.

File-Level Changes

Change Details Files
Expose GFP API key in CI environment for subsequent jobs.
  • Define a top-level env block in the test workflow YAML.
  • Map GFP_API_KEY environment variable to the secrets.GFP_API_KEY GitHub secret so jobs can access it.
.github/workflows/test.yml
Add a dedicated GitHub Actions job to run gdsfactoryplus tests via gfp using uv and pytest.
  • Introduce a test_gdsfactoryplus job targeting ubuntu-latest with Python 3.12 in the matrix.
  • Check out the repository and set up Python using actions/setup-python@v6.
  • Install uv via astral-sh/setup-uv@v7.
  • Install project dependencies using make install with a bash login shell.
  • Execute uv run gfp test as the main test command for this job.
.github/workflows/test.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

@github-actions github-actions bot added the ci Pull requests that update GitHub Actions code label Dec 2, 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 there - I've reviewed your changes - here's some feedback:

  • Consider scoping GFP_API_KEY to just the test_gdsfactoryplus job (or even a single step) instead of defining it at the workflow level, to minimize exposure of the secret.
  • The matrix definition in test_gdsfactoryplus only has one Python version and one OS; if you don't plan to expand it, you can simplify by inlining python-version: 3.12 and runs-on: ubuntu-latest without a matrix.
  • If test_gdsfactoryplus depends on the other test jobs completing successfully, consider adding a needs: clause so its execution order is explicit and future changes to the workflow don't accidentally change behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider scoping `GFP_API_KEY` to just the `test_gdsfactoryplus` job (or even a single step) instead of defining it at the workflow level, to minimize exposure of the secret.
- The `matrix` definition in `test_gdsfactoryplus` only has one Python version and one OS; if you don't plan to expand it, you can simplify by inlining `python-version: 3.12` and `runs-on: ubuntu-latest` without a matrix.
- If `test_gdsfactoryplus` depends on the other test jobs completing successfully, consider adding a `needs:` clause so its execution order is explicit and future changes to the workflow don't accidentally change behavior.

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.

@joamatab joamatab requested a review from nikosavola December 3, 2025 01:31
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Dec 3, 2025
@joamatab joamatab changed the title add test for gfp add test for GDSFactory+ Dec 3, 2025
Updated Python version handling and improved workflow steps.
@nikosavola nikosavola force-pushed the test_project_in_gfp branch 2 times, most recently from 9135993 to 77f20c9 Compare December 3, 2025 08:57
Comment on lines +55 to +67
test_gdsfactoryplus:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7.1.3
with:
python-version: ${{ matrix.python-version }}
- name: Test GDSFactory+
run: uv run --group gdsfactoryplus gfp test
Copy link
Member

Choose a reason for hiding this comment

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

The GDSFactory+ is running but failing. What is it exactly doing? It seems to fail at many sections where it assumes a layer or cross-section from the generic PDK would be available here. A SLAB90 layer in this PDK does not make sense for example.

.venv/lib/python3.12/site-packages/gdsfactory/pdk.py:713: in get_layer
    return get_active_pdk().get_layer(layer)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/gdsfactory/pdk.py:524: in get_layer
    raise ValueError(f"{layer!r} not in PDK {self.name!r} {layer_members}")
E   ValueError: 'SLAB90' not in PDK 'qpdk' OrderedDict({'M1_DRAW': <LayerMapQPDK.M1_DRAW: 1>, 'M1_ETCH': <LayerMapQPDK.M1_ETCH: 47>, 'M2_DRAW': <LayerMapQPDK.M2_DRAW: 3>, 'M2_ETCH': <LayerMapQPDK.M2_ETCH: 48>, 'AB_DRAW': <LayerMapQPDK.AB_DRAW: 49>, 'AB_VIA': <LayerMapQPDK.AB_VIA: 50>, 'JJ_AREA': <LayerMapQPDK.JJ_AREA: 13>, 'JJ_PATCH': <LayerMapQPDK.JJ_PATCH: 51>, 'IND': <LayerMapQPDK.IND: 52>, 'TSV': <LayerMapQPDK.TSV: 53>, 'DICE': <LayerMapQPDK.DICE: 38>, 'ALN_TOP': <LayerMapQPDK.ALN_TOP: 54>, 'ALN_BOT': <LayerMapQPDK.ALN_BOT: 55>, 'TEXT': <LayerMapQPDK.TEXT: 56>, 'LABEL_SETTINGS': <LayerMapQPDK.LABEL_SETTINGS: 30>, 'LABEL_INSTANCE': <LayerMapQPDK.LABEL_INSTANCE: 46>, 'SIM_AREA': <LayerMapQPDK.SIM_AREA: 57>, 'SIM_ONLY': <LayerMapQPDK.SIM_ONLY: 58>, 'WG': <LayerMapQPDK.WG: 59>})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flaport any idea why this is happening?

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

Labels

ci Pull requests that update GitHub Actions code dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants