Skip to content

Add bool check for exiting the script with error code if no PRs are found#3007

Open
markovskipetar wants to merge 1 commit intomasterfrom
refactor_calculate_next_version
Open

Add bool check for exiting the script with error code if no PRs are found#3007
markovskipetar wants to merge 1 commit intomasterfrom
refactor_calculate_next_version

Conversation

@markovskipetar
Copy link
Copy Markdown
Collaborator

@markovskipetar markovskipetar commented Apr 3, 2026

Add the bool check exit_with_error_if_no_prs in the automated_release.calculate_next_version.yml. If the value is true, the script will exit with exit code 1 if no PRs are found, otherwise it will fallback to the default increment_type=patch for next version

@markovskipetar markovskipetar added the patch Small change, should increase patch version label Apr 3, 2026
default: true
type: boolean
description: "Whether to exit with error if no PRs found between branches"

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.

Trailing whitespace on this line. Please remove it.

Suggested change

echo "Error: No PRs found between branches"
exit 1
fi

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.

Trailing whitespace on this blank line inside the run block. Please remove it.

Suggested change

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 3, 2026

ArcticDB Code Review Summary - PR 3007

This PR adds an exit_with_error_if_no_prs boolean input to the calculate_next_version reusable workflow. When false, the workflow falls back to a default patch increment instead of failing when no PRs are found between branches.

Compatibility: No breaking changes. New input has required=false and default=true, preserving existing behaviour for all current callers. Workflow-only change with no on-disk format or Python API impact.

Correctness: The fallback path correctly sets both increment_type=patch and tag outputs before exit 0, so the downstream get-next-version step receives valid inputs. The shell comparison EXIT_WITH_ERROR equals true is correct for GitHub Actions boolean inputs surfaced via env vars.

Code Quality - NEEDS FIX: Two trailing-whitespace lines introduced at line 23 (after the description field) and line 67 (blank line inside the run block). Inline comments with one-click fix suggestions have been posted.

Testing: Internal CI workflow change with no unit or integration tests expected. Suggestion: consider a caller that exercises exit_with_error_if_no_prs=false to verify the fallback end-to-end.

Security: No hardcoded credentials. Pre-existing pattern where tag values are interpolated directly into the shell script via GitHub Actions expressions is unchanged.

PR Title and Description - NEEDS FIX: (1) PR description typo scrip should be script. (2) PR title has a trailing space.

Documentation: New input has an inline description field in the workflow YAML which is sufficient for a reusable workflow parameter.

@markovskipetar markovskipetar changed the title Add variable 'exit_with_error_if_no_prs' in 'calculate_next_version' Add bool check for exiting the script with error code if no PRs are found Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Small change, should increase patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants