Skip to content

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

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

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

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 #227

🤖 Generated with Claude Code

Summary by Sourcery

Enhancements:

  • Add Sourcery configuration to exclude intentional semgrep and ast-grep rule-test fixtures from review 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 root .sourcery.yaml that preserves Sourcery’s defaults and skips Semgrep/ast-grep rule-test fixtures, whose intentional findings otherwise cause review checks to fail, while leaving the rule files subject to review.

File-Level Changes

Change Details Files
Add version-controlled 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 the defaults.
  • Exclude Semgrep Python fixtures and test YAML files, plus the ast-grep rule-test directory.
  • Apply the configuration at the repository root so Sourcery can use it for supported integrations.
.sourcery.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#227 Add a versioned .sourcery.yaml that excludes the Semgrep and ast-grep rule-test fixtures from Sourcery review. ✅
#227 Keep the rule files themselves reviewed and preserve Sourcery’s default ignored paths. ✅
#227 Apply the same configuration change across foca, cloud-registry, proTES, and trs-filer. ❌ The diff adds .sourcery.yaml only in this repository; it does not show changes in the other named repositories.

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 (e3a3b26) to head (16cd3b5).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #228   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines         1362      1362           
=========================================
  Hits          1362      1362           

☔ 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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".sourcery.yaml" line_range="3-17" />
<code_context>
+# Sourcery configuration; see
+# https://docs.sourcery.ai/Coding-Assistant/Reference/Configuration/sourcery-yaml/
+ignore:
+  # Sourcery's defaults (setting `ignore` replaces them)
+  - .git
+  - venv
+  - .venv
+  - env
+  - .env
+  - .tox
+  - node_modules
+  - vendor
+  # The semgrep and ast-grep rule tests contain findings on purpose; the
+  # rules themselves stay reviewed
+  - .semgrep/*.py
+  - .semgrep/*.test.yaml
+  - .ast-grep/rule-tests/
</code_context>
<issue_to_address>
**Sourcery still reviews fixtures**

When sourcery’s GitHub review integration no longer honors `.sourcery.yaml` `ignore` entries, sourcery’s GitHub review integration ignores this configuration, so the fixture findings remain in review and the check still fails.

Verify the behavior on a PR that touches these fixtures and, if the integration ignores this file, configure the supported review path filters instead.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: .sourcery.yaml:17


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

Comment thread .sourcery.yaml Resolved
@uniqueg
uniqueg merged commit 1c71c76 into dev Oct 24, 2026
19 checks passed
@uniqueg
uniqueg deleted the ci/sourcery-ignore-227 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