Skip to content

Conversation

@munificent
Copy link
Member

The workflow for shipping dart_style used to be that we published a new version on pub and then rolled it into the Dart SDK. That meant that the dart_style version number in the SDK accurately described what was in dart_style.

A few years ago, we changed to rolling into the SDK first. That lets us validate dart_style inside google3 before irrevocably publishing, which is a good thing. But it has an unfortunate side effect. If you run dart format --version, it shows the previous version number of dart_style because the version number only gets bumped when we publish. This is really confusing if you're trying to debug the formatter in the SDK and it appears to be an older version than it actually is.

To fix that, I'm tweaking the workflow slightly. When we begin working on a new version of the formatter, we bump the version number in the pubspec to, say, 3.4.5-wip. At that point, we immediately update the version number constant shown by --version to "3.4.5" (the version it will be). That way, when it gets rolled into the SDK, it prints the upcoming version number.

When a version of dart_style is about to be published, we remove -wip from the pubspec but the constant printed by --version is already done.

To make this workflow a little less error-prone, I updated the grinder script to add tasks for starting a new patch, minor, and major version.

I also updated the docs for the old task now that we use the workflow automation for publishing.

The workflow for shipping dart_style used to be that we published a new version on pub and then rolled it into the Dart SDK. That meant that the dart_style version number in the SDK accurately described what was in dart_style.

A few years ago, we changed to rolling into the SDK first. That lets us validate dart_style inside google3 before irrevocably publishing, which is a good thing. But it has an unfortunate side effect. If you run `dart format --version`, it shows the *previous* version number of dart_style because the version number only gets bumped when we publish. This is really confusing if you're trying to debug the formatter in the SDK and it appears to be an older version than it actually is.

To fix that, I'm tweaking the workflow slightly. When we begin working on a new version of the formatter, we bump the version number in the pubspec to, say, 3.4.5-wip. At that point, we immediately update the version number constant shown by `--version` to "3.4.5" (the version it *will* be). That way, when it gets rolled into the SDK, it prints the upcoming version number.

When a version of dart_style is about to be published, we remove `-wip` from the pubspec but the constant printed by `--version` is already done.

To make this workflow a little less error-prone, I updated the grinder script to add tasks for starting a new patch, minor, and major version.

I also updated the docs for the old task now that we use the workflow automation for publishing.
@munificent munificent requested a review from kevmoo December 17, 2024 15:13
@munificent munificent merged commit b6e6bfc into main Dec 17, 2024
7 checks passed
@munificent munificent deleted the grind branch December 17, 2024 18:19
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