Skip to content

fix(archetype): Add EXCLUDED_* constants to ForeignKeyIndexAuditIT an… - #19

Merged
jeffjensen merged 1 commit into
mainfrom
fix/archetype-it-exclusion-constants
Aug 4, 2026
Merged

fix(archetype): Add EXCLUDED_* constants to ForeignKeyIndexAuditIT an…#19
jeffjensen merged 1 commit into
mainfrom
fix/archetype-it-exclusion-constants

Conversation

@jeffjensen

@jeffjensen jeffjensen commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

…d PrimaryKeyPresenceAuditIT

  • Give both generated ITs the same customization point every other example audit IT already has, instead of calling the no-exclusion overload directly.
  • PrimaryKeyPresenceAuditIT's EXCLUDED_TABLES is seeded with PrimaryKeyPresenceAudit.LIQUIBASE_BOOKKEEPING_TABLES rather than empty, since that default was previously applied silently by the no-arg overload.
  • Update CLAUDE.md so SchemaEntityValidationAuditIT is correctly named as the sole remaining example with no EXCLUDED_* constant.

Refs: 18

Claude-Session: https://claude.ai/code/session_01GgdNwS2yafWHbv3Hb425P9

Summary by Sourcery

Introduce explicit exclusion configuration constants for primary key and foreign key index audit integration tests in the archetype, and document the intended defaults and remaining no-exclusion example.

New Features:

  • Add EXCLUDED_TABLES constant to PrimaryKeyPresenceAuditIT to configure tables excluded from primary key presence checks.
  • Add EXCLUDED_CONSTRAINTS constant to ForeignKeyIndexAuditIT to configure foreign keys excluded from index presence checks.

Enhancements:

  • Seed PrimaryKeyPresenceAuditIT exclusions with Liquibase bookkeeping tables to make the default behavior explicit.
  • Update CLAUDE.md to reflect the new exclusion constants and clarify SchemaEntityValidationAuditIT as the sole example without EXCLUDED_* configuration.

Summary by CodeRabbit

  • Documentation
    • Clarified schema audit examples and their default exclusion behavior.
  • Bug Fixes
    • Updated primary-key validation examples to exclude Liquibase bookkeeping tables.
    • Updated foreign-key validation examples to explicitly allow deliberately unindexed constraints.
  • Tests
    • Improved integration-test configuration to accurately reflect intentional schema exclusions.

…d PrimaryKeyPresenceAuditIT

* Give both generated ITs the same customization point every other example audit IT already has, instead of
  calling the no-exclusion overload directly.
* PrimaryKeyPresenceAuditIT's EXCLUDED_TABLES is seeded with PrimaryKeyPresenceAudit.LIQUIBASE_BOOKKEEPING_TABLES
  rather than empty, since that default was previously applied silently by the no-arg overload.
* Update CLAUDE.md so SchemaEntityValidationAuditIT is correctly named as the sole remaining example with no
  EXCLUDED_* constant.

Refs: 18

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgdNwS2yafWHbv3Hb425P9
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR updates the generated catalog audit integration tests so they expose explicit EXCLUDED_* customization points like the other example audits, and adjusts documentation to explain the new defaults and the one remaining exception.

Sequence diagram for PrimaryKeyPresenceAuditIT using explicit EXCLUDED_TABLES

sequenceDiagram
    participant PrimaryKeyPresenceAuditIT
    participant PrimaryKeyPresenceAudit

    PrimaryKeyPresenceAuditIT->>PrimaryKeyPresenceAudit: assertClean(schema, EXCLUDED_TABLES)
    opt [EXCLUDED_TABLES seeded]
        PrimaryKeyPresenceAuditIT->>PrimaryKeyPresenceAudit: EXCLUDED_TABLES includes LIQUIBASE_BOOKKEEPING_TABLES
    end
Loading

File-Level Changes

Change Details Files
Introduce explicit exclusion constants in PrimaryKeyPresenceAuditIT and ensure Liquibase bookkeeping tables are excluded by default.
  • Add a java.util.Set-based EXCLUDED_TABLES constant to the IT, seeded with PrimaryKeyPresenceAudit.LIQUIBASE_BOOKKEEPING_TABLES.
  • Import PrimaryKeyPresenceAudit to access its LIQUIBASE_BOOKKEEPING_TABLES constant.
  • Update the audit assertion call to use the overload that accepts an exclusion set instead of the no-arg variant.
  • Clarify the class-level Javadoc to document the default exclusion of Liquibase bookkeeping tables and how to extend it.
archetype/src/main/resources/archetype-resources/src/test/java/catalog/PrimaryKeyPresenceAuditIT.java
Add an explicit exclusion constant for foreign key index audits so consumers can suppress intentional unindexed constraints.
  • Import java.util.Set and add an EXCLUDED_CONSTRAINTS constant initialized to Set.of().
  • Update the ForeignKeyIndexAuditAssertion call to use the overload that accepts an exclusion set instead of the no-arg variant.
  • Adjust the class-level Javadoc to mention the exclusion mechanism and its intended use.
archetype/src/main/resources/archetype-resources/src/test/java/catalog/ForeignKeyIndexAuditIT.java
Align documentation in CLAUDE.md with the new EXCLUDED_* behavior and identify the single IT that still has no exclusion constant.
  • Change wording from “most” to “nearly all” regarding EXCLUDED_* constants in example ITs.
  • Explain that PrimaryKeyPresenceAuditIT’s EXCLUDED_TABLES is pre-seeded with Liquibase bookkeeping tables to mirror the previous silent default and avoid footguns.
  • Document that SchemaEntityValidationAuditIT is the only remaining IT with no EXCLUDED_* constant because its assertClean() is global and argument-free.
CLAUDE.md

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

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b1a84971-9a09-4e3e-94e9-aca66341855e

📥 Commits

Reviewing files that changed from the base of the PR and between 7b4c86e and d4ddce8.

📒 Files selected for processing (3)
  • CLAUDE.md
  • archetype/src/main/resources/archetype-resources/src/test/java/catalog/ForeignKeyIndexAuditIT.java
  • archetype/src/main/resources/archetype-resources/src/test/java/catalog/PrimaryKeyPresenceAuditIT.java

📝 Walkthrough

Walkthrough

The archetype audit examples now use explicit exclusion sets. Foreign-key audits use an empty set, while primary-key audits exclude Liquibase bookkeeping tables. CLAUDE.md documents these conventions.

Changes

Audit exclusion configuration

Layer / File(s) Summary
Foreign-key exclusion configuration
archetype/src/main/resources/archetype-resources/src/test/java/catalog/ForeignKeyIndexAuditIT.java
ForeignKeyIndexAuditIT defines an empty EXCLUDED_CONSTRAINTS set and passes it to the audit assertion.
Primary-key exclusion configuration
archetype/src/main/resources/archetype-resources/src/test/java/catalog/PrimaryKeyPresenceAuditIT.java, CLAUDE.md
PrimaryKeyPresenceAuditIT excludes Liquibase bookkeeping tables. CLAUDE.md documents the exclusion conventions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies a real primary change: adding an EXCLUDED_* constant to ForeignKeyIndexAuditIT.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/archetype-it-exclusion-constants

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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 left some high level feedback:

  • Consider making EXCLUDED_TABLES and EXCLUDED_CONSTRAINTS non-empty examples (e.g., commented-out sample values) or clarifying in the Javadoc that Set.of() produces an immutable set that should be replaced, not mutated, to avoid confusion for consumers of the archetype.
  • If these exclusion sets are intended to be reused across multiple tests in generated projects, consider making the constants package-private or public and centralizing them to avoid duplication when additional audits are added.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider making `EXCLUDED_TABLES` and `EXCLUDED_CONSTRAINTS` non-empty examples (e.g., commented-out sample values) or clarifying in the Javadoc that `Set.of()` produces an immutable set that should be replaced, not mutated, to avoid confusion for consumers of the archetype.
- If these exclusion sets are intended to be reused across multiple tests in generated projects, consider making the constants package-private or public and centralizing them to avoid duplication when additional audits are added.

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.

@jeffjensen
jeffjensen merged commit 60fd09e into main Aug 4, 2026
6 checks passed
@jeffjensen
jeffjensen deleted the fix/archetype-it-exclusion-constants branch August 4, 2026 18:50
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.

1 participant