Skip to content

fix: rename IEntryRequirementExtension to IEntryValidator + add CI build check#75

Merged
loothero merged 3 commits intomainfrom
fix/game-components-compiler-error
Mar 8, 2026
Merged

fix: rename IEntryRequirementExtension to IEntryValidator + add CI build check#75
loothero merged 3 commits intomainfrom
fix/game-components-compiler-error

Conversation

@loothero
Copy link
Member

@loothero loothero commented Mar 8, 2026

Summary

  • Renames IEntryRequirementExtensionIEntryValidator (and dispatchers) across 7 files to match the external interfaces dependency which defines the trait as IEntryValidator
  • Pins the interfaces dependency to rev 3c5a1ef (the commit with IEntryValidator) across 4 Scarb.toml files
  • Adds scarb build --workspace step to both main-ci.yml and pr-ci.yml setup jobs to catch workspace-wide compilation errors before the test matrix runs

Why CI didn't catch this

Neither CI workflow had a standalone scarb build step. They relied on snforge test to implicitly compile, but the Scarb dependency cache (keyed on Scarb.toml/Scarb.lock hashes) could serve stale artifacts from when the external branch had the old trait names — masking the mismatch.

Test plan

  • scarb build passes with 0 errors
  • scarb fmt --check --workspace passes
  • snforge test entry_requirement passes
  • CI setup job now runs scarb build --workspace before test matrix

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added workspace compilation verification step to CI pipelines to ensure builds succeed before tests.
    • Pinned dependency to a fixed revision for improved build reproducibility and stability.

…ternal interface

The external `interfaces` dependency defines the trait as `IEntryValidator`,
but local code referenced `IEntryRequirementExtension` which doesn't exist.

Also adds `scarb build --workspace` to both CI workflows (main-ci.yml and
pr-ci.yml) to catch workspace-wide compilation errors early, before the
test matrix spins up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@loothero loothero requested a review from starknetdev as a code owner March 8, 2026 17:42
Copilot AI review requested due to automatic review settings March 8, 2026 17:42
@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@loothero has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 8 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c4e1da9e-4835-4dc1-b8bd-a98d15169cbb

📥 Commits

Reviewing files that changed from the base of the PR and between 49b4faf and f262733.

📒 Files selected for processing (3)
  • .github/workflows/main-ci.yml
  • .github/workflows/pr-ci.yml
  • AGENTS.md
📝 Walkthrough

Walkthrough

CI workflows now verify workspace compilation before tests. The interfaces dependency is pinned to a fixed revision across four Scarb.toml files. Entry requirement validation logic is refactored to use IEntryValidator dispatcher instead of IEntryRequirementExtension dispatcher throughout the codebase.

Changes

Cohort / File(s) Summary
CI Workflow Updates
.github/workflows/main-ci.yml, .github/workflows/pr-ci.yml
Added new pipeline steps to verify workspace compilation using scarb build --workspace before test execution.
Dependency Revision Pinning
Scarb.toml, packages/interfaces/Scarb.toml, packages/metagame/Scarb.toml, packages/test_common/Scarb.toml
Updated interfaces dependency from branch-based reference (branch = "next") to fixed revision pin (rev = "3c5a1ef") across all manifest files.
Entry Validator Interface Migration
packages/metagame/src/entry_requirement/entry_requirement_component.cairo, packages/metagame/src/entry_requirement/entry_requirement_store.cairo, packages/metagame/src/entry_requirement/tests/mocks/accepting_limited_entry_validator_mock.cairo, packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo, packages/metagame/src/entry_requirement/tests/mocks/rejecting_entry_validator_mock.cairo, packages/test_common/src/mocks/mock_entry_validator.cairo, packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo
Replaced IEntryRequirementExtensionDispatcher with IEntryValidatorDispatcher across component logic, store operations, and mock implementations. Updated error messages and impl declarations to reflect new validator interface context.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • starknetdev

Poem

🐰 Hop, hop—dependencies pinned so tight!
Validators dance, dispatchers take flight,
CI checks compile, all mocks align,
Interfaces refactored, now they shine!
Next branch is stable, revision divine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the what and why, but is missing several required template sections including Scope checkboxes, Change Type selection, Validation commands, Risk level, Breaking Changes, Assumptions, Exceptions, Workarounds, and Linked Issues. Complete the PR description by filling in all required template sections: mark Scope, select Change Type(s), document validation commands run, assess risk level, confirm breaking changes status, and populate other applicable sections.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: renaming IEntryRequirementExtension to IEntryValidator and adding a CI build check step.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/game-components-compiler-error

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 and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on harmonizing naming conventions and bolstering CI robustness. It renames an interface to match an external dependency, pins that dependency to a specific commit for stability, and introduces an explicit workspace-wide build check in the CI pipeline to prevent compilation issues from going unnoticed.

Highlights

  • Interface Renaming: The IEntryRequirementExtension interface and its associated dispatchers have been renamed to IEntryValidator across seven files to align with an external dependency.
  • Dependency Pinning: The interfaces dependency has been pinned to a specific commit (3c5a1ef) in four Scarb.toml files to ensure consistent versioning.
  • CI Enhancement: A scarb build --workspace step has been added to both main-ci.yml and pr-ci.yml CI workflows to proactively catch workspace-wide compilation errors.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Scarb.toml
    • Updated the 'interfaces' dependency from a branch reference to a specific commit hash.
  • packages/interfaces/Scarb.toml
    • Updated the 'interfaces' dependency from a branch reference to a specific commit hash.
  • packages/metagame/Scarb.toml
    • Updated the 'interfaces' dependency from a branch reference to a specific commit hash.
  • packages/metagame/src/entry_requirement/entry_requirement_component.cairo
    • Renamed 'IEntryRequirementExtensionDispatcher' and 'IEntryRequirementExtensionDispatcherTrait' to 'IEntryValidatorDispatcher' and 'IEntryValidatorDispatcherTrait' in use statements.
    • Updated error messages and comments to reflect the 'IEntryValidator' name.
  • packages/metagame/src/entry_requirement/entry_requirement_store.cairo
    • Renamed 'IEntryRequirementExtensionDispatcher' and 'IEntryRequirementExtensionDispatcherTrait' to 'IEntryValidatorDispatcher' and 'IEntryValidatorDispatcherTrait' in use statements.
    • Renamed 'IEntryRequirementExtensionDispatcher' to 'IEntryValidatorDispatcher' in dispatcher instantiation.
    • Updated error messages to reflect the 'IEntryValidator' name.
  • packages/metagame/src/entry_requirement/tests/mocks/accepting_limited_entry_validator_mock.cairo
    • Updated comments to refer to 'IEntryValidator'.
    • Renamed 'IEntryRequirementExtension' to 'IEntryValidator' in use statements.
    • Renamed 'EntryRequirementExtensionImpl' to 'EntryValidatorImpl' in the implementation block.
  • packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo
    • Updated comments to refer to 'IEntryValidator'.
    • Renamed 'IEntryRequirementExtension' to 'IEntryValidator' in use statements.
    • Renamed 'EntryRequirementExtensionImpl' to 'EntryValidatorImpl' in the implementation block.
  • packages/metagame/src/entry_requirement/tests/mocks/rejecting_entry_validator_mock.cairo
    • Updated comments to refer to 'IEntryValidator'.
    • Renamed 'IEntryRequirementExtension' to 'IEntryValidator' in use statements.
    • Renamed 'EntryRequirementExtensionImpl' to 'EntryValidatorImpl' in the implementation block.
  • packages/test_common/Scarb.toml
    • Updated the 'interfaces' dependency from a branch reference to a specific commit hash.
  • packages/test_common/src/mocks/mock_entry_validator.cairo
    • Updated comments to refer to 'IEntryValidator'.
    • Renamed 'IEntryRequirementExtension' to 'IEntryValidator' in use statements.
    • Renamed 'EntryRequirementExtensionImpl' to 'EntryValidatorImpl' in the implementation block.
  • packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo
    • Updated comments to refer to 'IEntryValidator'.
    • Renamed 'IEntryRequirementExtension' to 'IEntryValidator' in use statements.
    • Renamed 'EntryRequirementExtensionImpl' to 'EntryValidatorImpl' in the implementation block.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/main-ci.yml
    • .github/workflows/pr-ci.yml
Activity
  • The author provided a detailed summary explaining the changes and the rationale behind the CI update.
  • The author outlined a comprehensive test plan to verify the correctness of the implemented changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily renames IEntryRequirementExtension to IEntryValidator and its related dispatchers across the codebase to align with an external dependency. It also pins the dependency to a specific commit hash for better reproducibility, which is a good practice. The changes are consistent and well-executed. I've suggested a minor improvement for readability by aliasing the interface ID constant IENTRY_REQUIREMENT_EXTENSION_ID to IENTRY_VALIDATOR_ID where it's imported. This would make the code even more consistent with the renaming effort.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the metagame “entry requirement extension” integration with the upstream interfaces dependency by renaming the extension trait/dispatchers to IEntryValidator, pins the dependency to a specific commit that contains the rename, and strengthens CI by compiling the whole workspace before running the test matrix.

Changes:

  • Renamed IEntryRequirementExtension usages (and dispatchers/impl blocks) to IEntryValidator in entry-requirement code and related mocks.
  • Pinned the interfaces git dependency to rev = "3c5a1ef" across the workspace/packages.
  • Added a scarb build --workspace step to PR and main CI setup jobs to fail fast on compilation errors.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo Updates mock contract to implement IEntryValidator.
packages/test_common/src/mocks/mock_entry_validator.cairo Updates mock contract to implement IEntryValidator.
packages/test_common/Scarb.toml Pins interfaces dependency to the commit containing IEntryValidator.
packages/metagame/src/entry_requirement/tests/mocks/rejecting_entry_validator_mock.cairo Updates test mock to implement IEntryValidator.
packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo Updates test mock to implement IEntryValidator.
packages/metagame/src/entry_requirement/tests/mocks/accepting_limited_entry_validator_mock.cairo Updates test mock to implement IEntryValidator.
packages/metagame/src/entry_requirement/entry_requirement_store.cairo Switches dispatcher types to IEntryValidatorDispatcher* and updates related error text.
packages/metagame/src/entry_requirement/entry_requirement_component.cairo Switches dispatcher types to IEntryValidatorDispatcher* and updates related comments/error text.
packages/metagame/Scarb.toml Pins interfaces dependency to rev = "3c5a1ef".
packages/interfaces/Scarb.toml Pins interfaces dependency to rev = "3c5a1ef".
Scarb.toml Pins workspace/root interfaces dependency to rev = "3c5a1ef".
.github/workflows/pr-ci.yml Adds scarb build --workspace in setup job before the test matrix.
.github/workflows/main-ci.yml Adds scarb build --workspace in setup job before the test matrix.

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo (1)

5-5: Route this import through game_components_interfaces.

Pulling IEntryValidator from the raw interfaces git package keeps metagame coupled to a second interface source. If game_components_interfaces does not re-export the validator yet, add the re-export there first instead of importing interfaces directly from consumer crates.

Based on learnings: Must depend on game_components_interfaces for EntryRequirement types and IEntryValidator interface.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo`
at line 5, Change the import to use the re-export from
game_components_interfaces instead of the raw interfaces package: replace usage
of IEntryValidator and IENTRY_REQUIREMENT_EXTENSION_ID from
interfaces::entry_requirement_extension with the corresponding symbols
re-exported by game_components_interfaces; if game_components_interfaces does
not yet re-export IEntryValidator/IENTRY_REQUIREMENT_EXTENSION_ID, add those
re-exports in that crate first and then update this file to import
IEntryValidator and IENTRY_REQUIREMENT_EXTENSION_ID from
game_components_interfaces to remove the direct dependency on the interfaces
package.
packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo (1)

4-4: Use the repo interface wrapper in the shared mock too.

test_common should stay aligned with the repo’s canonical interface package; importing IEntryValidator straight from interfaces recreates a second source of truth for shared mocks.

Based on learnings: The interfaces package serves as the single source of truth for all game component interface definitions; other packages must import from here for cross-contract calls and SRC5 interface detection.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo` at line
4, The mock currently imports IEntryValidator and
IENTRY_REQUIREMENT_EXTENSION_ID directly from interfaces, creating a second
source of truth; change the import to the repository's canonical interface
wrapper (e.g., replace use
interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID,
IEntryValidator}; with an import from the repo interface wrapper such as use
repo_interface_wrapper::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID,
IEntryValidator};) and update any references in
mock_rejecting_entry_validator.cairo to use those symbols so the mock aligns
with the canonical interface package.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/main-ci.yml:
- Around line 141-142: Update the "Verify workspace compiles" step that runs
"scarb build --workspace" so its gating condition also triggers when top-level
workspace manifests change: change the step's if expression from only checking
needs.changes.outputs.packages to OR in the changes-action output that
represents top-level manifest changes (e.g.,
needs.changes.outputs.root_manifests or needs.changes.outputs.root) so it runs
when Scarb.toml or Scarb.lock at the repo root are modified; also ensure the
changes detection job includes those root files in its path list so the output
is set.

In @.github/workflows/pr-ci.yml:
- Around line 359-360: The CI step "Verify workspace compiles" never runs for
PRs touching only the repo-level Scarb.toml/Scarb.lock because the matrix
generator's packages filter doesn't treat workspace manifest changes as
test-bearing (has_tests=false); update the compute-matrix logic that sets the
has_tests flag so it flips to true when the root workspace manifest (Scarb.toml
or Scarb.lock) is modified, or alternatively extend the packages filter to
include the repo root manifest changes as a package change, ensuring the "Verify
workspace compiles" step (scarb build --workspace) runs for those PRs.

---

Nitpick comments:
In
`@packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo`:
- Line 5: Change the import to use the re-export from game_components_interfaces
instead of the raw interfaces package: replace usage of IEntryValidator and
IENTRY_REQUIREMENT_EXTENSION_ID from interfaces::entry_requirement_extension
with the corresponding symbols re-exported by game_components_interfaces; if
game_components_interfaces does not yet re-export
IEntryValidator/IENTRY_REQUIREMENT_EXTENSION_ID, add those re-exports in that
crate first and then update this file to import IEntryValidator and
IENTRY_REQUIREMENT_EXTENSION_ID from game_components_interfaces to remove the
direct dependency on the interfaces package.

In `@packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo`:
- Line 4: The mock currently imports IEntryValidator and
IENTRY_REQUIREMENT_EXTENSION_ID directly from interfaces, creating a second
source of truth; change the import to the repository's canonical interface
wrapper (e.g., replace use
interfaces::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID,
IEntryValidator}; with an import from the repo interface wrapper such as use
repo_interface_wrapper::entry_requirement_extension::{IENTRY_REQUIREMENT_EXTENSION_ID,
IEntryValidator};) and update any references in
mock_rejecting_entry_validator.cairo to use those symbols so the mock aligns
with the canonical interface package.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12513cbc-9996-4983-b354-d10bab1b350e

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcb819 and 49b4faf.

📒 Files selected for processing (13)
  • .github/workflows/main-ci.yml
  • .github/workflows/pr-ci.yml
  • Scarb.toml
  • packages/interfaces/Scarb.toml
  • packages/metagame/Scarb.toml
  • packages/metagame/src/entry_requirement/entry_requirement_component.cairo
  • packages/metagame/src/entry_requirement/entry_requirement_store.cairo
  • packages/metagame/src/entry_requirement/tests/mocks/accepting_limited_entry_validator_mock.cairo
  • packages/metagame/src/entry_requirement/tests/mocks/entry_validator_mock.cairo
  • packages/metagame/src/entry_requirement/tests/mocks/rejecting_entry_validator_mock.cairo
  • packages/test_common/Scarb.toml
  • packages/test_common/src/mocks/mock_entry_validator.cairo
  • packages/test_common/src/mocks/mock_rejecting_entry_validator.cairo

loothero and others added 2 commits March 8, 2026 10:55
Changes to workspace-level manifests (dependency bumps, lock file
updates) were not triggering the build or test pipelines because the
path filters only matched packages/**. This closes the gap that
allowed the original IEntryRequirementExtension build failure to
go undetected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@loothero loothero merged commit b9ac8e2 into main Mar 8, 2026
27 checks passed
@loothero loothero deleted the fix/game-components-compiler-error branch March 8, 2026 18:05
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.

2 participants