Skip to content

ci(l1,l2): add issues: write permission to AI review caller workflow#6135

Merged
avilagaston9 merged 5 commits into
mainfrom
fix/ci-ai-review-permissions
Feb 6, 2026
Merged

ci(l1,l2): add issues: write permission to AI review caller workflow#6135
avilagaston9 merged 5 commits into
mainfrom
fix/ci-ai-review-permissions

Conversation

@avilagaston9

@avilagaston9 avilagaston9 commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

The AI review workflow (#6106) fails with startup_failure on every run. The caller workflow specified explicit permissions (contents: read, pull-requests: write), which restricts the maximum permissions available to nested reusable workflow jobs. The reusable workflows in lambdaclass/actions require additional permissions:

  • Kimi: pull-requests: write (already granted)
  • Codex post_feedback job: issues: write
  • Claude claude-review job: id-token: write

Missing any of these causes the entire workflow to fail at startup with no logs.

Description

Add the missing issues: write and id-token: write permissions to the caller workflow's permissions block.

Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync.

The Codex reusable workflow (ai-review-codex.yml) has a nested post_feedback
job that requests issues: write. When the caller workflow sets explicit
permissions without granting issues: write, GitHub blocks the entire workflow
at startup with: "The nested job 'post_feedback' is requesting 'issues: write',
but is only allowed 'issues: none'." This caused all AI review runs to fail
with startup_failure.
@avilagaston9 avilagaston9 changed the title ci: add issues: write permission to AI review caller workflow ci(l1,l2): add issues: write permission to AI review caller workflow Feb 5, 2026
@github-actions github-actions Bot added L1 Ethereum client L2 Rollup client labels Feb 5, 2026
@avilagaston9 avilagaston9 marked this pull request as ready for review February 5, 2026 18:59
@avilagaston9 avilagaston9 requested a review from a team as a code owner February 5, 2026 18:59
Copilot AI review requested due to automatic review settings February 5, 2026 18:59
@ethrex-project-sync ethrex-project-sync Bot moved this to In Review in ethrex_l1 Feb 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a workflow failure in the AI review workflow by adding the missing issues: write permission. The AI review workflow, introduced in PR #6106, fails with a startup_failure error because the reusable workflow's post_feedback job requires issues: write, but the caller workflow only granted contents: read and pull-requests: write.

Changes:

  • Add issues: write permission to the caller workflow permissions block

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps

greptile-apps Bot commented Feb 5, 2026

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR fixes a permission issue causing the AI review workflow to fail with startup_failure errors. The reusable Codex workflow requires issues: write permission for its post_feedback job, but the caller only granted contents: read and pull-requests: write.

  • Added issues: write permission to allow nested jobs to post feedback
  • This is the minimal change needed to resolve the workflow failure
  • The permission scope is appropriate for AI review workflows that need to comment on PRs and issues

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change is minimal, well-motivated, and directly addresses a documented failure. Adding issues: write permission is the correct solution for workflows that need to post feedback, and the scope is appropriate for AI review functionality.
  • No files require special attention

Important Files Changed

Filename Overview
.github/workflows/pr_ai_review.yaml Added issues: write permission to fix startup_failure error in nested job

Sequence Diagram

sequenceDiagram
    participant PR as Pull Request Event
    participant Caller as pr_ai_review.yaml
    participant Kimi as ai-review-kimi.yml
    participant Codex as ai-review-codex.yml
    participant Claude as ai-review-claude.yml
    participant GH as GitHub API

    PR->>Caller: Trigger (opened/ready_for_review)
    Note over Caller: permissions:<br/>contents: read<br/>pull-requests: write<br/>issues: write
    
    par Run AI Reviews
        Caller->>Kimi: Call reusable workflow
        Kimi->>GH: Post review comments
        and
        Caller->>Codex: Call reusable workflow
        Codex->>GH: Post feedback (needs issues: write)
        and
        Caller->>Claude: Call reusable workflow
        Claude->>GH: Post review comments
    end
    
    GH-->>PR: AI review feedback posted
Loading

avilagaston9 added 3 commits February 5, 2026 16:01
The caller workflow was specifying explicit permissions (contents: read,
pull-requests: write) which restricts the maximum permissions available to
nested reusable workflows. The Codex workflow needs issues: write and the
Claude workflow needs id-token: write, so each new requirement would need
to be added manually. Removing the block entirely lets the workflow use
the repo's default token permissions, matching the working setup in
lambdaclass/ethlambda.
The repo's default token permissions are read-only, so we must explicitly
grant every permission the reusable workflows need: contents: read and
pull-requests: write (Kimi), issues: write (Codex post_feedback job),
and id-token: write (Claude code action).
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🤖 Kimi Code Review

Review of PR #6135

File: .github/workflows/pr_ai_review.yaml

Issues Found:

  1. Permission escalation concern (Line 23-25):

    • Adding issues: write and id-token: write permissions appears to be unnecessary for a PR review workflow. The id-token: write permission is particularly concerning as it allows the workflow to mint OIDC tokens, which could be a security risk if compromised.
  2. Trigger scope expansion (Line 18):

    • Adding synchronize to the pull_request trigger means this workflow will run on every push to the PR branch, which could significantly increase CI load and costs for AI review services.

Recommendations:

  1. Remove unnecessary permissions:

    permissions:
      contents: read
      pull-requests: write
  2. Consider rate limiting for synchronize events:
    If synchronize is intentionally added, consider adding conditions to limit when the AI review runs (e.g., only on significant changes or when explicitly requested).

  3. Document the permission changes:
    If these permissions are genuinely needed, the PR description should explain why issues: write and id-token: write are required for an AI code review workflow.

The changes appear to be workflow configuration rather than core ethrex code, so there are no Ethereum-specific concerns in this diff.


Automated review by Kimi (Moonshot AI) · custom prompt

@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🤖 Codex Code Review

Focused review on .github/workflows/pr_ai_review.yaml only (no Rust/EVM changes in this PR).

Findings

  • Potential secret exposure on issue_comment trigger: The workflow runs with pull-requests: write, issues: write, and repository secrets, but there is no guard in this file to restrict comment authors. If the reusable workflows don’t enforce author_association checks internally, any commenter could trigger jobs that consume secrets. Consider adding an explicit job-level if: check (e.g., github.event.comment.author_association in [OWNER, MEMBER, COLLABORATOR]) or using pull_request_target-style gating. File: .github/workflows/pr_ai_review.yaml:16-26.
  • Least-privilege concern: id-token: write is granted but not obviously required by this workflow. If the reusable workflows aren’t using OIDC, drop this permission to reduce token issuance surface. File: .github/workflows/pr_ai_review.yaml:22-26.

Minor/Perf

  • synchronize triggers run on every push. If this is intentional, consider adding concurrency to cancel in-flight reviews on rapid pushes to avoid redundant runs. File: .github/workflows/pr_ai_review.yaml:16-18.

If the reusable workflows already enforce author checks and use OIDC, note that in the PR description to avoid confusion.


Automated review by OpenAI Codex · custom prompt

@avilagaston9 avilagaston9 added this pull request to the merge queue Feb 6, 2026
Merged via the queue into main with commit 8f35c2a Feb 6, 2026
59 checks passed
@avilagaston9 avilagaston9 deleted the fix/ci-ai-review-permissions branch February 6, 2026 13:53
@github-project-automation github-project-automation Bot moved this from In Review to Done in ethrex_l1 Feb 6, 2026
@github-project-automation github-project-automation Bot moved this to Done in ethrex_l2 Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client L2 Rollup client

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants