Skip to content

Conversation

@emnul
Copy link
Contributor

@emnul emnul commented Dec 6, 2025

Refactors our setup/action.yml to use the setup-compact-action which does the same thing as our manual configuration while greatly simplifying the action.

Summary by CodeRabbit

  • Chores
    • Streamlined continuous integration workflow by simplifying build environment setup and removing redundant configuration steps
    • Updated GitHub Actions to use dedicated setup tools for more reliable and maintainable builds

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

@emnul emnul requested review from a team as code owners December 6, 2025 02:40
@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR refactors GitHub Actions workflows to externalize Compact compiler setup. It removes the gh-token input parameter and manual compiler installation logic from the setup action, replaces them with a dependency on midnightntwrk/setup-compact-action, and eliminates related environment variables from workflows.

Changes

Cohort / File(s) Summary
Setup action refactoring
.github/actions/setup/action.yml
Removed gh-token input/outputs; deleted multiple Compact setup steps (environment setup, caching, curl installation, validation); added single external action step using midnightntwrk/setup-compact-action@v0.26.0 with conditional guard.
Workflow environment variable removals
.github/workflows/checks.yml, .github/workflows/codeql.yml, .github/workflows/test.yml
Removed COMPACT_INSTALLER_URL environment variable block; removed gh-token input passing to Setup Environment action.
Workflow token removals
.github/workflows/release.yml
Removed gh-token input forwarding to Setup Environment composite action.
Test workflow step simplification
.github/workflows/test.yml (step-level)
Removed COMPILER_VERSION and LANGUAGE_VERSION from workflow env; renamed "Compile contracts (with retry)" to "Compile contracts" and removed token-passing with block.
Action version updates
.github/workflows/prepare-release.yml
Updated versions for checkout, corepack/setup-node, and related workflow action steps.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Key areas requiring attention:
    • Verify that midnightntwrk/setup-compact-action@v0.26.0 is a trusted external source and provides equivalent functionality to the removed manual setup steps (caching, installation, validation).
    • Confirm that removal of gh-token parameter does not break authentication or token-dependent operations in any downstream workflow steps.
    • Validate consistency of environment variable removals across all workflow files to ensure no dependent steps are left without required variables.

Possibly related PRs

  • fix(gh-actions): release PR requisted changes #284: Inverse refactoring that added the manual Compact compiler setup steps, inputs/outputs, and COMPACT_INSTALLER_URL environment variables that this PR removes and replaces with an external setup action.

Poem

🐰 The compiler setup now flies light,
No need for tokens in the night,
A helper action takes the call,
Simplifying workflows, once and for all! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: refactoring setup/action.yml to use the setup-compact-action, which aligns with the primary objective and the most significant change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

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: 1

🧹 Nitpick comments (2)
.github/actions/setup/action.yml (2)

46-46: Hardcoded version should be parameterized for maintainability.

The compact-version "0.26.0" is hardcoded in the action. To improve maintainability and reduce friction for version updates:

  • Consider accepting compact-version as an input parameter to the setup action with a sensible default
  • Or centralize version management in a dedicated file (e.g., .github/versions.json or similar)
  • This allows workflows to override the version without editing the action definition

Example parameterization:

 inputs:
   skip-compact:
     description: "Skip Compact compiler installation"
     required: false
     default: "false"
+  compact-version:
+    description: "Version of Compact compiler to install"
+    required: false
+    default: "0.26.0"

 runs:
   using: "composite"
   steps:
     - name: Setup Compact Compiler
       if: ${{ inputs.skip-compact != 'true' }}
       uses: midnightntwrk/setup-compact-action@4130145456ad3f45934788dd4a65647eb283e658
       with:
-        compact-version: "0.26.0"
+        compact-version: ${{ inputs.compact-version }}

1-2: Update action description to reflect new external dependency.

The description "Sets up the environment with yarn, Node.js, turbo, and Compact compiler" is accurate but could be more specific about the new external action dependency. Consider updating to:

description: "Sets up the environment with yarn, Node.js, turbo, and Compact compiler via setup-compact-action"

This makes the dependency explicit for users of the composite action.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 480dbe4 and 1019308.

📒 Files selected for processing (6)
  • .github/actions/setup/action.yml (1 hunks)
  • .github/workflows/checks.yml (1 hunks)
  • .github/workflows/codeql.yml (0 hunks)
  • .github/workflows/prepare-release.yml (1 hunks)
  • .github/workflows/release.yml (0 hunks)
  • .github/workflows/test.yml (1 hunks)
💤 Files with no reviewable changes (2)
  • .github/workflows/release.yml
  • .github/workflows/codeql.yml
⏰ 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). (1)
  • GitHub Check: Run Test Suite
🔇 Additional comments (4)
.github/workflows/prepare-release.yml (1)

16-26: Action version updates are appropriate.

The pinned action versions (checkout@v6.0.1, setup-node@v6.1.0) are routine maintenance updates with SHAs correctly pinned for reproducibility.

.github/workflows/test.yml (1)

40-41: Verify the removal of "with retry" semantics.

The step was renamed from "Compile contracts (with retry)" to "Compile contracts" and the with: block was removed. Please confirm whether this change intentionally removes explicit retry logic or if turbo compact has built-in resilience. If retries were important for reliability, consider whether turbo provides fallback mechanisms or if external retry wrapping is still needed.

.github/workflows/checks.yml (1)

23-26: Setup simplification is appropriate.

Removal of COMPACT_INSTALLER_URL and gh-token aligns with the external action approach. The quote style change is neutral.

.github/actions/setup/action.yml (1)

42-46: Assess the impact of removed validation and error-handling steps.

The previous manual setup likely included post-install validation checks (compiler/language version verification) and explicit error handling. The new external action may not provide equivalent guarantees. Confirm that:

  • The external action validates successful compiler installation
  • Setup failures are properly surfaced in workflow logs
  • There are no silent failures that could lead to incorrect compilation

Consider adding a verification step after the setup if the external action doesn't provide built-in validation.

- name: Compile contracts
run: turbo compact --filter=@openzeppelin/compact-contracts

- name: Run type checks

Choose a reason for hiding this comment

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

For changed tests compared to HEAD..main i believe you can do turbo test --affected or --filter options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for letting me know about that feature. I'll take a look and see if that's behavior we want

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.

3 participants