Skip to content

chore: fix PR ABI validation workflow logic#108

Closed
Aliorpse wants to merge 1 commit intomainfrom
chore/fix-workflow
Closed

chore: fix PR ABI validation workflow logic#108
Aliorpse wants to merge 1 commit intomainfrom
chore/fix-workflow

Conversation

@Aliorpse
Copy link
Owner

This PR fixes the logic in the ABI validation workflow.

Previously, using process.exit(0) in the Check Review Status step only exited the script successfully but did not stop subsequent steps from running. This meant the ABI validation would run even if the PR wasn't fully approved.

The fix introduces an output variable should_run to control the execution of subsequent steps using if conditions.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 31, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the PR ABI validation workflow to gate the ABI Validation step on a new should_run output from the review-checking step instead of relying on process.exit(0), ensuring ABI checks only run for fully approved PRs.

Flow diagram for updated ABI validation gating in PR workflow

flowchart TD
    A[PR opened or updated] --> B[Run Check_Review_Status step]
    B --> C{steps.check_reviews.outputs.should_run == 'true'?}
    C -- true --> D[Run ABI_Validation step
./gradlew checkLegacyAbi -Pfull-build=true --no-configuration-cache]
    C -- false --> E[Skip ABI_Validation step]
    D --> F[Job completes]
    E --> F[Job completes]
Loading

File-Level Changes

Change Details Files
Gate ABI validation job execution on a should_run output from the review status check step instead of relying on process.exit to halt the workflow.
  • Introduce a should_run output in the Check Review Status step that is set based on whether the PR is fully approved
  • Update the ABI Validation step to run only when steps.check_reviews.outputs.should_run == 'true'
  • Remove reliance on process.exit(0) as a mechanism to prevent subsequent workflow steps from running
.github/workflows/pr_validation.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider setting a default value for should_run in the check_reviews step (e.g., via ::set-output on all code paths) so that the if: steps.check_reviews.outputs.should_run == 'true' condition behaves predictably even if the script exits early or encounters an unexpected branch.
  • You may want to consolidate the 'true' string comparison into a reusable convention (e.g., always emitting 'true'/'false' in the script and documenting that) to avoid subtle bugs if the output ever changes to true/false booleans or different casing.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider setting a default value for `should_run` in the `check_reviews` step (e.g., via `::set-output` on all code paths) so that the `if: steps.check_reviews.outputs.should_run == 'true'` condition behaves predictably even if the script exits early or encounters an unexpected branch.
- You may want to consolidate the `'true'` string comparison into a reusable convention (e.g., always emitting `'true'`/`'false'` in the script and documenting that) to avoid subtle bugs if the output ever changes to `true`/`false` booleans or different casing.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Aliorpse Aliorpse closed this Jan 31, 2026
@Aliorpse Aliorpse deleted the chore/fix-workflow branch January 31, 2026 15:57
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