Skip to content

Conversation

@andrew-fleming
Copy link
Contributor

@andrew-fleming andrew-fleming commented Nov 20, 2025

Fixes #308

This PR also fixes uncaught formatting issues

Summary by CodeRabbit

  • Chores
    • Updated package naming convention across project configuration, workflows, build scripts, and documentation.
    • Applied consistent formatting and style improvements throughout the codebase.

✏️ Tip: You can customize this high-level summary in your review settings.

@andrew-fleming andrew-fleming requested a review from a team as a code owner November 20, 2025 05:57
@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

Package name renamed from @openzeppelin-compact/contracts to @openzeppelin/compact-contracts across workflow configurations, package manifests, documentation, and test files. Minor string literal formatting and spacing adjustments applied throughout test files for consistency.

Changes

Cohort / File(s) Summary
Package Configuration
contracts/package.json, package.json
Package name property updated from @openzeppelin-compact/contracts to @openzeppelin/compact-contracts; script filters updated to reference new package name
GitHub Actions Workflows
.github/workflows/prepare-release.yml, .github/workflows/test.yml
Package filter references updated from @openzeppelin-compact/contracts to @openzeppelin/compact-contracts in version update and compile steps
Configuration & Build
turbo.json, README.md
Turbo dependency target and documentation examples updated to use new package name @openzeppelin/compact-contracts
Test Utility Files — String Literal Normalization
contracts/src/access/test/utils/address.ts, contracts/src/archive/test/utils/address.ts, contracts/src/security/test/utils/address.ts, contracts/src/token/test/utils/address.ts, contracts/src/utils/test/utils/address.ts, packages/simulator/test/fixtures/utils/address.ts
Empty string literals changed from "" to '' in convertFieldToBytes calls for consistent style
Test Cases — String Literal Normalization
contracts/src/access/test/AccessControl.test.ts, contracts/src/access/test/ZOwnablePK.test.ts, packages/simulator/test/integration/SampleZOwnable.test.ts
Empty string arguments updated from "" to '' for consistency
Test Doubles — Formatting
packages/compact/test/Compiler.test.ts, packages/compact/test/runCompiler.test.ts
Mock function bodies reformatted from () => { } to () => {} for compact styling
Export Syntax
packages/simulator/src/index.ts
Trailing comma added after IMinimalContract in type export block

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Most changes are homogeneous (same package name rename repeated across configs and workflows)
  • String literal formatting changes in test files are repetitive and low-risk
  • Package rename is straightforward with no logic changes
  • No complex architectural or behavioral modifications

Possibly related PRs

Suggested reviewers

  • emnul
  • 0xisk

Poem

🐰 A package name blooms anew,
From openzeppelin-compact to compact true,
All references align with grace,
String quotes tidy every place,
The workspace hops to its new name! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple out-of-scope formatting changes detected beyond the package name update: empty string literal normalizations from "" to '' in test files and mock function body formatting changes unrelated to issue #308. Remove formatting changes (string literals, mock function spacing) that are outside the scope of the package name update to keep the changeset focused on the primary objective.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update contracts package name' directly describes the primary change in the changeset, which is renaming the package from '@openzeppelin-compact/contracts' to '@openzeppelin/compact-contracts'.
Linked Issues check ✅ Passed All changes successfully address issue #308 requirements: package name updated in contracts/package.json, all workflow files, README, and configuration files from '@openzeppelin-compact/contracts' to '@openzeppelin/compact-contracts'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dec76fa and 1dcced2.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (18)
  • .github/workflows/prepare-release.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • README.md (3 hunks)
  • contracts/package.json (1 hunks)
  • contracts/src/access/test/AccessControl.test.ts (2 hunks)
  • contracts/src/access/test/ZOwnablePK.test.ts (2 hunks)
  • contracts/src/access/test/utils/address.ts (2 hunks)
  • contracts/src/archive/test/utils/address.ts (1 hunks)
  • contracts/src/security/test/utils/address.ts (1 hunks)
  • contracts/src/token/test/utils/address.ts (1 hunks)
  • contracts/src/utils/test/utils/address.ts (1 hunks)
  • package.json (1 hunks)
  • packages/compact/test/Compiler.test.ts (5 hunks)
  • packages/compact/test/runCompiler.test.ts (1 hunks)
  • packages/simulator/src/index.ts (1 hunks)
  • packages/simulator/test/fixtures/utils/address.ts (2 hunks)
  • packages/simulator/test/integration/SampleZOwnable.test.ts (2 hunks)
  • turbo.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
contracts/src/archive/test/utils/address.ts (5)
contracts/src/access/test/utils/address.ts (3)
  • encodeToAddress (36-38)
  • ZERO_ADDRESS (97-101)
  • encodeToPK (26-28)
contracts/src/security/test/utils/address.ts (3)
  • encodeToAddress (37-41)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
contracts/src/token/test/utils/address.ts (3)
  • encodeToAddress (36-38)
  • ZERO_ADDRESS (73-77)
  • encodeToPK (26-28)
contracts/src/utils/test/utils/address.ts (3)
  • encodeToAddress (37-41)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
packages/simulator/test/fixtures/utils/address.ts (3)
  • encodeToAddress (36-38)
  • ZERO_ADDRESS (97-101)
  • encodeToPK (26-28)
contracts/src/utils/test/utils/address.ts (2)
contracts/src/archive/test/utils/address.ts (3)
  • encodeToAddress (37-41)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
contracts/src/security/test/utils/address.ts (3)
  • encodeToAddress (37-41)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
contracts/src/security/test/utils/address.ts (2)
contracts/src/archive/test/utils/address.ts (2)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
contracts/src/utils/test/utils/address.ts (2)
  • ZERO_ADDRESS (77-81)
  • encodeToPK (26-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run Test Suite
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (23)
contracts/src/archive/test/utils/address.ts (1)

71-80: String-literal normalization in ZERO_KEY/ZERO_ADDRESS is safe

Changing the third convertFieldToBytes argument from "" to '' is purely stylistic here; the calls remain identical and consistent with the other address test utils.

contracts/src/utils/test/utils/address.ts (1)

71-80: ZERO_KEY/ZERO_ADDRESS quote-style tweak is non-functional

The convertFieldToBytes(32, 0n, '') updates preserve behavior and align this helper with the other address utility files in the suite.

packages/compact/test/runCompiler.test.ts (1)

52-54: No-op console.log mock remains correct

Using mockImplementation(() => {}) keeps console.log safely stubbed for all tests without changing any expectations.

contracts/src/security/test/utils/address.ts (1)

71-80: Consistent EMPTY string literal usage for ZERO_KEY/ZERO_ADDRESS

The convertFieldToBytes calls now use '' like the other test helpers; there’s no semantic impact, just consistent style.

contracts/src/access/test/ZOwnablePK.test.ts (1)

44-67: Commitment helpers unchanged aside from quote style

Updating convertFieldToBytes(32, counter, '') in buildCommitmentFromId and buildCommitment is purely stylistic and keeps the test helpers aligned with the shared address utilities.

contracts/src/token/test/utils/address.ts (1)

65-65: LGTM! String literal normalization.

The change from "" to '' standardizes empty string literals across the codebase, improving consistency.

contracts/src/access/test/AccessControl.test.ts (2)

3-3: LGTM! Import formatting improvement.

The import reordering maintains the same imported identifiers while improving readability.


27-31: LGTM! Consistent string literal style.

The standardization of empty string literals to '' across all role constant definitions improves code consistency.

packages/compact/test/Compiler.test.ts (2)

205-205: LGTM! Formatting consistency improvement.

The removal of unnecessary whitespace in empty arrow function bodies standardizes the codebase formatting.


337-337: LGTM! Consistent mock implementation formatting.

All mock implementations now follow the same compact formatting style for empty arrow functions.

Also applies to: 586-586, 665-665, 696-696

packages/simulator/test/integration/SampleZOwnable.test.ts (1)

56-56: LGTM! String literal standardization in test helpers.

The changes to single-quoted empty strings maintain consistency with the repository-wide formatting updates.

Also applies to: 87-87

packages/simulator/test/fixtures/utils/address.ts (2)

64-77: LGTM! Improved type annotation formatting.

The multiline return type annotation enhances readability for the complex union type.


89-89: LGTM! String literal consistency.

Aligns with the repository-wide string literal standardization.

contracts/src/access/test/utils/address.ts (2)

64-77: LGTM! Enhanced readability with multiline type annotation.

The complex union type is now more readable with the multiline formatting.


89-89: LGTM! Consistent string literal style.

Matches the repository-wide formatting standardization.

packages/simulator/src/index.ts (1)

7-13: LGTM! Trailing comma added for consistency.

The trailing comma in the export type block aligns with modern JavaScript/TypeScript formatting conventions and makes future diffs cleaner.

.github/workflows/test.yml (1)

33-33: LGTM! Package name updated correctly.

This change aligns with the PR objective (issue #308) to rename the contracts package from @openzeppelin-compact/contracts to @openzeppelin/compact-contracts. The workflow now correctly references the updated package name.

.github/workflows/prepare-release.yml (1)

66-66: Workspace reference updated correctly.

The yarn workspace command now targets the renamed package. This change is consistent with the package rename across the codebase.

package.json (1)

14-16: Script filters correctly target the renamed package.

The turbo run commands now filter on the updated package name for both compact and test operations. This is consistent with the package rename across the codebase.

README.md (2)

60-76: Documentation examples updated consistently with package rename.

The import paths in the code example correctly reflect the new package name structure. The pattern remains appropriate for the current workaround mentioned in the comment at line 63.


183-183: Turbo command filter updated correctly.

The command-line example now uses the correct package filter matching the root package.json scripts.

contracts/package.json (1)

2-2: Package name correctly renamed.

The published package name now matches the intended namespace. This is the foundational change that all other file updates reference.

turbo.json (1)

77-80: The review comment is based on misidentified package names and should be ignored.

The actual turbo.json shows two distinct packages in the dependsOn array (lines 78–79):

  • @openzeppelin-compact/compact#build (line 78)
  • @openzeppelin/compact-contracts#compact (line 79)

These are different packages serving different purposes, not a rename scenario. The review assumed line 78 contained @openzeppelin-compact/contracts#compact, but it actually contains @openzeppelin-compact/compact#build. No duplicate or obsolete references exist in the configuration.

Likely an incorrect or invalid review comment.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

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.

Change contracts package name

1 participant