Skip to content

fix(dev-lead): remove step-level INTENT_TYPE env overrides shadowing if: conditions - #186

Closed
don-petry wants to merge 1 commit into
mainfrom
fix/intent-type-step-env
Closed

don-petry wants to merge 1 commit into
mainfrom
fix/intent-type-step-env

Conversation

@don-petry

@don-petry don-petry commented May 15, 2026 •

Copy link
Copy Markdown
Collaborator

Root cause

Step-level env: overrides are included in the env context when GitHub evaluates the step's if: condition. This caused:

- name: Run fix-reviews
  if: env.INTENT_TYPE == 'fix-reviews'   # Always TRUE — step-level env wins
  env:
    INTENT_TYPE: fix-reviews             # This value is used in the if: check

All handler steps ran for every event regardless of actual intent. When intent was skip, the scripts would exit 1 because PR_NUMBER/ISSUE_NUMBER were empty.

Fix

Remove INTENT_TYPE: from step env: blocks in both dev-lead.yml and dev-lead-reusable.yml. The handler scripts already read INTENT_TYPE from GITHUB_ENV (set by dev-lead-intent.sh).

Also change the script fallback from ${INTENT_TYPE:-fix-reviews} to ${INTENT_TYPE:?error} so unset INTENT_TYPE is a loud failure rather than a silent wrong value.

Summary by CodeRabbit

  • Refactor
    • Simplified workflow environment variable configuration in CI/CD pipeline by removing redundant declarations.
    • Enhanced parameter validation to require critical environment variables be explicitly set by the workflow.

Review Change Stack

…w if: conditions

Step-level env: overrides are included in the env context when GitHub evaluates
the step's if: condition. This caused if: env.INTENT_TYPE == 'fix-reviews' to
always be true (because the step itself sets INTENT_TYPE=fix-reviews), so all
handler steps ran for every event regardless of actual intent.

Fix: remove INTENT_TYPE: <value> from step env: blocks. Scripts read INTENT_TYPE
from GITHUB_ENV (set by dev-lead-intent.sh) which has the correct value.
Copilot AI review requested due to automatic review settings May 15, 2026 18:30
@coderabbitai

coderabbitai Bot commented May 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 39e23eb1-3ef1-4f89-a638-098c5adddbe9

📥 Commits

Reviewing files that changed from the base of the PR and between 68331c6 and e7855f1.

📒 Files selected for processing (3)
  • .github/workflows/dev-lead-reusable.yml
  • .github/workflows/dev-lead.yml
  • scripts/dev-lead-fix-reviews.sh
💤 Files with no reviewable changes (2)
  • .github/workflows/dev-lead-reusable.yml
  • .github/workflows/dev-lead.yml

📝 Walkthrough

Walkthrough

This PR centralizes the INTENT_TYPE environment variable from step-local overrides to job-level environment. The script is updated to require the variable instead of defaulting to fix-reviews, and both the reusable and main workflow files remove their step-local INTENT_TYPE declarations, allowing conditions to depend on the job-provided value.

Changes

INTENT_TYPE environment centralization

Layer / File(s) Summary
Script parameter requirement enforcement
scripts/dev-lead-fix-reviews.sh
INTENT_TYPE is changed from a defaulting parameter to a required one; the script now aborts if the workflow does not provide the value.
Reusable workflow intent steps cleanup
.github/workflows/dev-lead-reusable.yml
Removes INTENT_TYPE from the step-local env blocks in all five intent-routed steps (fix-reviews, fix-bot-comment, human, human-pr, rebase), allowing them to inherit INTENT_TYPE from the job environment.
Main workflow intent steps cleanup
.github/workflows/dev-lead.yml
Removes INTENT_TYPE from the step-local env blocks in the five intent-routed steps (fix-reviews, fix-bot-comment, human, human-pr, rebase), aligning the main workflow with the reusable workflow contract.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: removing INTENT_TYPE environment variable overrides from step-level env blocks that were shadowing GitHub Actions if: conditions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/intent-type-step-env
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix/intent-type-step-env

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.

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 dev-lead workflow intent routing by removing step-level INTENT_TYPE overrides that could shadow the classifier output used by if: conditions, and makes the shared review handler fail loudly if the workflow does not provide an intent.

Changes:

  • Removed handler step INTENT_TYPE overrides from both dev-lead workflows.
  • Kept routing dependent on INTENT_TYPE emitted by dev-lead-intent.sh via GITHUB_ENV.
  • Changed dev-lead-fix-reviews.sh to require INTENT_TYPE instead of silently defaulting to fix-reviews.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
scripts/dev-lead-fix-reviews.sh Requires workflow-provided INTENT_TYPE before dispatching review-related handler logic.
.github/workflows/dev-lead.yml Removes step-level intent overrides from dev-lead handler steps.
.github/workflows/dev-lead-reusable.yml Applies the same routing fix to the reusable dev-lead workflow.

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the scripts/dev-lead-fix-reviews.sh script to make the INTENT_TYPE environment variable mandatory. The script now uses shell parameter expansion to ensure the variable is set by the workflow, preventing it from falling back to a default value. I have no feedback to provide as there were no review comments.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Superseded by #187 (clean rebase on main)

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.

2 participants