Repository navigation
feat: add squads proposal flow - #177
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d0b4750d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds two manual GitHub Actions workflows and a helper script. The ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 40 minutes and 54 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/propose-program-upgrade.yml:
- Around line 149-161: The Squads action's keypair input must be the raw keypair
data in Uint8Array/JSON byte-array form (e.g., [1,2,...,32]) not a file path or
other secret string; ensure the env secret SQUADS_PROPOSER_KEYPAIR is stored as
that JSON byte array and is passed directly to the action's keypair input, or
add a preceding step (e.g., the "Write proposer keypair" step) that reads the
keyfile and converts/outputs the JSON byte-array string and then feed that
output into the Create Squads upgrade proposal action's keypair input; reference
the Create Squads upgrade proposal action's keypair input and the
SQUADS_PROPOSER_KEYPAIR secret to locate where to validate/convert the format.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4b33c1c7-6cca-4566-9a98-d330c231e1fb
📒 Files selected for processing (2)
.github/workflows/prepare-program-verification.yml.github/workflows/propose-program-upgrade.yml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c5b43446e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19cb3eeef5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/scripts/create-squads-upgrade-proposal.mjs:
- Around line 84-93: The confirmation results from connection.confirmTransaction
are ignored for both the vault transaction (vaultTransactionSignature) and the
proposal creation (proposalSignature); capture each call's returned
RpcResponseAndContext<SignatureResult>, check result.value.err for non-null
on-chain failures, and if an error exists log the signature and error details
(reference connection.confirmTransaction, vaultTransactionSignature,
proposalSignature, multisig.rpc.proposalCreate, SQUADS_TRANSACTION_INDEX) and
abort (throw or process.exit(1)) so the script does not continue exporting
SQUADS_TRANSACTION_INDEX after a failed on‑chain transaction.
In @.github/workflows/prepare-program-verification.yml:
- Around line 47-48: The workflow step "Install cargo-binstall" currently uses
the mutable ref cargo-bins/cargo-binstall@main; replace that with an immutable
commit SHA by updating the uses field (cargo-bins/cargo-binstall@<commit-sha>)
so the action is pinned to a specific commit; locate the step with the name
"Install cargo-binstall" and change the uses value from
cargo-bins/cargo-binstall@main to cargo-bins/cargo-binstall@<exact-commit-sha>.
In @.github/workflows/propose-program-upgrade.yml:
- Around line 3-10: The workflow currently triggers on pull_request which is
unsafe and causes PROPOSAL_NAME to be undefined because the job reads
inputs.proposal_name; remove the pull_request trigger from the on: block so the
workflow only runs via workflow_dispatch (and keep the existing inputs like
proposal_name), then ensure the job step that sets PROPOSAL_NAME (the
environment/step referencing inputs.proposal_name) continues to read from
github.event.inputs.proposal_name (workflow_dispatch) rather than expecting
pull_request data; verify that any usage of inputs.proposal_name or
github.event.inputs.proposal_name is only executed when the event is
workflow_dispatch.
- Around line 52-59: The workflow uses mutable refs for third-party actions
(dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2,
cargo-bins/cargo-binstall@main); replace each mutable tag with the corresponding
immutable commit SHA (e.g., dtolnay/rust-toolchain@<SHA>,
Swatinem/rust-cache@<SHA>, cargo-bins/cargo-binstall@<SHA>) so the actions are
pinned, verify the SHAs by checking each action repository’s commit you intend
to use, and update the workflow entries for those action uses accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4f6a591d-da98-482f-bd56-b7ab28b6f7a5
📒 Files selected for processing (3)
.github/scripts/create-squads-upgrade-proposal.mjs.github/workflows/prepare-program-verification.yml.github/workflows/propose-program-upgrade.yml
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b542acd44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e6a488d40
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
♻️ Duplicate comments (2)
.github/workflows/propose-program-upgrade.yml (2)
57-61:⚠️ Potential issue | 🟠 MajorPin third-party actions to immutable commit SHAs.
dtolnay/rust-toolchain@stableandSwatinem/rust-cache@v2are mutable references. Since this workflow handles mainnet secrets and signing authority, a retagged action could silently compromise the build. Pin these to specific commit SHAs.Example pinning (verify SHAs before use)
- name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716f41d5a4a7e495b85ead # stable - name: Cache Rust - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/propose-program-upgrade.yml around lines 57 - 61, Replace the mutable action refs with immutable commit SHAs: change uses: dtolnay/rust-toolchain@stable to uses: dtolnay/rust-toolchain@<commit-sha> and uses: Swatinem/rust-cache@v2 to uses: Swatinem/rust-cache@<commit-sha> (locate these by the uses lines for dtolnay/rust-toolchain and Swatinem/rust-cache in the workflow), verify and paste the exact commit SHAs from each action repo before committing so no mutable tag remains.
3-10:⚠️ Potential issue | 🔴 CriticalCritical: Remove the
pull_requesttrigger — mainnet writes on every PR.The
pull_requesttrigger is still present despite being flagged in a previous review. This workflow performs real mainnet operations (buffer upload, authority transfer, proposal creation) and should only run viaworkflow_dispatch. Additionally,inputs.proposal_nameis undefined forpull_requestevents, causing the proposal step to fail or use the fallback.Suggested fix
on: - pull_request: workflow_dispatch: inputs: proposal_name: description: "Squads proposal" required: true default: "Upgrade delegation program"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/propose-program-upgrade.yml around lines 3 - 10, The workflow incorrectly includes the pull_request trigger which causes unsafe mainnet writes and breaks the inputs contract (inputs.proposal_name isn't defined for PR events); remove the "pull_request:" key from the on: block so only "workflow_dispatch:" remains, and ensure the workflow references inputs.proposal_name only when run via workflow_dispatch (no additional PR-specific handling needed once pull_request is removed).
🤖 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/prepare-program-verification.yml:
- Around line 101-114: The file is missing a trailing newline; update the "Write
summary" step (the block that appends to "$GITHUB_STEP_SUMMARY" using the echo
{...} >> "$GITHUB_STEP_SUMMARY") so the file ends with a single newline
character—ensure the final line after the closing brace or the last echo is
terminated with '\n' (add a newline at EOF) to comply with POSIX conventions.
- Around line 18-28: Remove MAINNET_RPC_URL from the job-level env block so it
is not exposed globally (currently declared alongside SOLANA_VERSION and
PROGRAM_ID), and instead add MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
only to the env of the specific steps that require it (mirroring the approach
used in propose-program-upgrade.yml); update any step definitions that need RPC
access to include the variable in their env and verify no other steps rely on
the top-level MAINNET_RPC_URL.
In @.github/workflows/propose-program-upgrade.yml:
- Around line 207-220: The file's workflow step that appends the program upgrade
summary (the shell block that echoes values like $PROGRAM_ID,
$PROGRAM_BUFFER_ADDRESS, $GITHUB_STEP_SUMMARY, etc., under the "Write summary"
step) is missing a trailing newline at EOF; open that workflow file and ensure
the final line ends with a newline character (i.e., add an empty newline after
the closing brace/redirect >> "$GITHUB_STEP_SUMMARY") so the file conforms to
POSIX newline conventions.
---
Duplicate comments:
In @.github/workflows/propose-program-upgrade.yml:
- Around line 57-61: Replace the mutable action refs with immutable commit SHAs:
change uses: dtolnay/rust-toolchain@stable to uses:
dtolnay/rust-toolchain@<commit-sha> and uses: Swatinem/rust-cache@v2 to uses:
Swatinem/rust-cache@<commit-sha> (locate these by the uses lines for
dtolnay/rust-toolchain and Swatinem/rust-cache in the workflow), verify and
paste the exact commit SHAs from each action repo before committing so no
mutable tag remains.
- Around line 3-10: The workflow incorrectly includes the pull_request trigger
which causes unsafe mainnet writes and breaks the inputs contract
(inputs.proposal_name isn't defined for PR events); remove the "pull_request:"
key from the on: block so only "workflow_dispatch:" remains, and ensure the
workflow references inputs.proposal_name only when run via workflow_dispatch (no
additional PR-specific handling needed once pull_request is removed).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ee7d27a7-ea38-458d-893b-d152ea42ea7d
📒 Files selected for processing (2)
.github/workflows/prepare-program-verification.yml.github/workflows/propose-program-upgrade.yml
Summary by CodeRabbit