Skip to content

ci: let Sourcery skip rule-test fixtures - #306

Merged
uniqueg merged 1 commit into
devfrom
ci/sourcery-ignore-305
Oct 24, 2026
Merged

uniqueg merged 1 commit into
devfrom
ci/sourcery-ignore-305

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a versioned .sourcery.yaml whose ignore list skips the semgrep and ast-grep rule-test fixtures (.semgrep/*.py, .semgrep/*.test.yaml, .ast-grep/rule-tests/). These contain findings on purpose, but Sourcery reviews them and fails its check (see elixir-cloud-aai/trs-filer#149). The rule files themselves stay reviewed, because Sourcery's comments on them were useful. Sourcery's default ignores are kept, since setting ignore replaces them. The same file goes into foca, cloud-registry, proTES and trs-filer.

Syntax: the ignore field of the .sourcery.yaml reference (archived 2025-06), which says it "affects the IDE plugins, the CLI, and GitHub". The current docs only describe the dashboard's "Path Filters" (review settings) and don't mention .sourcery.yaml, so whether the file still applies to PR reviews must be checked on a PR that touches the fixtures.

Light lane: configuration only (one new YAML file, no code, no secrets, no workflows), so no reviewer subagents; I reviewed the diff myself.

Verification

  • pre-commit run --files .sourcery.yaml: all hooks passed (check yaml, end of files, trailing whitespace, semgrep, …)
  • CI: all checks passed (some image publish jobs skipped, as on every PR)

Open questions

None.

Closes #305

🤖 Generated with Claude Code

Summary by Sourcery

Enhancements:

  • Configure Sourcery to ignore intentional findings in semgrep and ast-grep rule-test fixtures while retaining review coverage for the rule definitions.

The semgrep and ast-grep rule tests contain findings on purpose, but
Sourcery reviews them and fails its check. Add a versioned
.sourcery.yaml whose ignore list skips the fixtures (keeping Sourcery's
default ignores); the rule files themselves stay reviewed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a repository-level .sourcery.yaml that preserves Sourcery’s defaults and skips Semgrep and ast-grep rule-test fixtures, preventing intentional findings in those fixtures from failing Sourcery checks while continuing to review the rules themselves.

File-Level Changes

Change Details Files
Add versioned Sourcery ignore configuration for intentional rule-test findings while preserving review coverage of the rule definitions.
  • Retain Sourcery’s documented default ignore paths because defining ignore replaces them.
  • Exclude Semgrep Python fixtures and test YAML files.
  • Exclude the ast-grep rule-test directory.
  • Keep the .semgrep and .ast-grep rule files themselves subject to Sourcery review.
.sourcery.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#305 Add a versioned Sourcery configuration that skips the Semgrep and ast-grep rule-test fixtures while keeping the rule files reviewed. ✅
#305 Apply the same Sourcery configuration change in foca, cloud-registry, proTES, and trs-filer. ❌ The diff adds a configuration file only in this repository and does not include changes for the four other named projects.

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

@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8af9c36) to head (028db7d).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #306   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines         2469      2469           
=========================================
  Hits          2469      2469           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 24, 2026 13:48

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit bf5c0e8 into dev Oct 24, 2026
19 checks passed
@uniqueg
uniqueg deleted the ci/sourcery-ignore-305 branch October 24, 2026 13:51
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.

ci: let Sourcery skip rule-test fixtures

1 participant