Skip to content

feat: parameterize pre-release prefix#25

Merged
flxapps merged 4 commits intomainfrom
feat/parameterize-pre-release-prefix
Feb 23, 2026
Merged

feat: parameterize pre-release prefix#25
flxapps merged 4 commits intomainfrom
feat/parameterize-pre-release-prefix

Conversation

@flxapps
Copy link
Collaborator

@flxapps flxapps commented Feb 23, 2026

Summary

This PR fixes pre-release version handling so the suffix is no longer implicitly tied to dev.
A new workflow input, pre_release_prefix, is now wired through to the version command and into version calculation logic.

Why this change

Pre-release versions were effectively hard-coded to a dev style suffix (for example 3.0.0-dev.1), which is too restrictive for different release flows.
The workflow now supports configurable prefixes while keeping a sensible default behavior.

What changed

  • Added/used pre_release_prefix as a workflow_call input in .github/workflows/pr_workflow.yaml:
    • Type: string
    • Default: "" (empty)
  • Updated the version step arguments in the PR workflow:
    • --pre-release is still only added when pre_release=true
    • --pre-release-prefix <value> is now added only when pre_release_prefix is non-empty
  • Propagated prefix handling in versioning code (lib/version/version.dart):
    • preReleasePrefix is part of the version(...) flow
    • forwarded to calculateNextVersion(...)

Resulting behavior

  • pre_release: true + pre_release_prefix: "dev"3.0.0-dev.1
  • pre_release: true + pre_release_prefix: ""3.0.0-1
  • pre_release: false ignores pre-release suffixing as before

Notes

  • Existing callers remain compatible because pre_release_prefix has a default empty value.
  • This keeps release semantics flexible across teams without forcing a single naming convention.

@github-actions
Copy link

Version Analysis

Next Version: 6.0.1

Changelog: 📄 View detailed changelog in job summary

Badge:
Version Badge

Copy link

Copilot AI left a comment

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 introduces parameterized pre-release version prefixes, removing the hard-coded "dev" suffix and allowing configurable pre-release version formats. Previously, pre-release versions were always formatted as 3.0.0-dev.1; now they default to 3.0.0-1 when no prefix is specified, or can use a custom prefix like 3.0.0-dev.1 when --pre-release-prefix dev is provided.

Changes:

  • Added pre_release_prefix workflow input and command-line option to both version and version-workspace commands
  • Updated pre-release version calculation logic to support configurable prefixes with proper separator handling
  • Updated existing tests to reflect new default behavior (no prefix) and added a test for custom prefix usage
  • Refactored code to eliminate duplicate baseRef calculation in version.dart

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/workflows/pr_workflow.yaml Added pre_release_prefix input parameter and conditional argument passing to version command
lib/version/version_command.dart Added --pre-release-prefix option with help text and getter, propagated to version function
lib/version/version_workspace_command.dart Added --pre-release-prefix option with help text and getter, propagated to versionWorkspace function
lib/version/version.dart Added preReleasePrefix parameter, forwarded to calculateNextVersion, and refactored to use effectiveBaseRef
lib/version/workspace_version.dart Added preReleasePrefix parameter and propagated it through to version function calls
lib/version/calculate_next_version.dart Implemented prefix normalization, separator logic, and dynamic suffix building for pre-release versions
test/commands/version_command_test.dart Updated existing test expectations to match new default behavior and added test for custom prefix

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

@github-actions
Copy link

Version Analysis

Next Version: 6.0.1

Changelog: 📄 View detailed changelog in job summary

Badge:
Version Badge

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

@flxapps flxapps merged commit 0a237bc into main Feb 23, 2026
8 checks passed
@flxapps flxapps deleted the feat/parameterize-pre-release-prefix branch February 23, 2026 13:20
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