-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aft): Version bump command (#2068)
* chore(aft): Make base commands sync There isn't any value with these being async since it's okay to block in this context. And sync makes everything easier to work with. commit-id:6743d9d4 * feat(aft): Changelog/version commands commit-id:0c17379d * fix(aws_common): Logger initialization Fixes an issue in logger initialization where the initial plugin is not registered to the root plugin. commit-id:063fbfe0 * fix(aft): Versioning algorithm and performance commit-id:c45852ad * chore(aft): Clean up commit-id:de10a06e * chore(aft): Update README commit-id:8261f867 * chore(aft): Update tests Expand e2e tests to incude changelog/pubspec changes commit-id:e9757240 * chore(aft): Update dependencies commit-id:4509edf2 * chore(aft): Bump dependencies commit-id:14f44d17 * chore(aft): Enforce changelog update includes commits Changelog updates should only be made with a non-empty list of commits. commit-id:4eccafce * chore(aft): Add `promptYesNo` helper commit-id:8544885f * chore(aft): Refine `isExample` Refine the definition of `isExample` to be more precise and not require workarounds. commit-id:51cc0ac0 * chore(aft): Change `aft version` to `aft version-bump` commit-id:0526b477 * chore(aft): Remove from mono_repo The package libgit2dart, while it can be used in Dart-only packages tricks pub into thinking it has a dependency on Flutter. mono_repo cannot handle this discrepancy. commit-id:ec27a8d2 * fix(aft): Publish constraints Fixes constraints around publishing checks and which packages to consider for publishing. commit-id:937ee042 * chore(aft): Publish command checks Improves publish command checks by removing `pubspec_overrides` and not splitting the pre-publish and publish commands for a package. * chore(aft): Add components and define version bump types * chore(aft): Clean up `deps` command Fix logging and merge `pub.dev` logic with `publish` * chore(aft): Add placeholders for version bump commit * chore(aft): Update logging settings * test(aft): Update e2e tests * More updates * chore(aft): More cleanup * chore(aft): Add propagation option * chore(aft): Remove `changelog` command * chore(aft): Clean up * chore(aft): Update wording in `aft.yaml` * chore(aft): Link packages before version bump * chore(aft): Follow Dart SemVer strategy Use build tag (`+`) for patch releases. * chore(aft): Fix analysis errors * fix(aft): Submodule `libgit2dart` Adds workaround for dart-lang/pub#3563 which requires using Flutter's `dart` command if a package lists a Flutter SDK constraint even if the package does not depend on Flutter. * fix(authenticator): ARB syntax Remove unncessary commas * chore(aft): Remove setup step * chore(aft): Copy libgit2 from Instead of trying to install it (since the latest version is not available in apt) * chore(aft): Reset after patch * chore(aft): Copy lib to /usr * fix(aft): `dev_dependency` conflicts When `dev_dependencies` contains versions of the published packages different than those on pub.dev (for example when using path deps or `any`), this causes issues during pre-publish verification. By simply keeping these constraints up-to-date as well, we lose nothing (since they are overridden in local development via linking), but gain stronger confidence in the pre-publish step. * chore(aft): Change workflow path for libgit2 * chore(aft): Fix tests in CI * chore(aft): Bump dependency Co-authored-by: Dillon Nys <dillon.andre.nys@gmail.com>
- Loading branch information
Showing
50 changed files
with
3,343 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ analyzer: | |
public_member_api_docs: ignore | ||
exclude: | ||
- '**/*.g.dart' | ||
- external/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Versioning Algorithm | ||
|
||
The `aft version-bump` command uses Git history + [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) formatting to determine a suitable next version for a package along with the required changes for depending packages. | ||
|
||
1. Let `packages` be the set of all packages in the repo which are publishable to `pub.dev`. | ||
2. For every package `P` in `packages`: | ||
1. Let `component` be the component of `P`, if any. | ||
2. Let `baseRef` be the commit of the last release of `P`. | ||
3. Let `headRef` be the releaseable commit of `P` (defaults to `HEAD`). | ||
4. Let `history` be the list of git commits in the range `baseRef..headRef` which affected `P`, i.e. those commits which included changes to files in `P`. | ||
5. Let `nextVersion = currentVersion`. | ||
6. For each `commit` in `history`: | ||
1. If `commit` is a version bump (i.e. `chore(version)`), ignore it. | ||
2. If `commit` is a merge commit, update dependencies based on the packages changed by the commit. | ||
1. The thinking here is that PRs should either be squashed into a single commit or merged as a set of independent commits capped off by a merge commit. The independent commits are isolated changes which are used to update changelogs and bump versions. The merge commit is then used solely for associating previous commits and updating constraints accordingly. | ||
3. If `commit` is a breaking change (i.e. `feat(auth)!`), set `bumpType = breaking`. | ||
1. else if `commit`'s type is `feat`, set `bumpType = nonBreaking`. | ||
2. else, set `bumpType = patch`. | ||
4. If `commit` is a noteworthy change (scope is one of `feat`, `fix`, `bug`, `perf`, or `revert` or it's a breaking change), set `includeInChangelog = true`. | ||
5. Let `proposedVersion = currentVersion.bump(bumpType)` | ||
6. Let `nextVersion = max(nextVersion, proposedVersion)` | ||
7. If `nextVersion > currentVersion`: | ||
1. Update `pubspec.yaml`, set `version = nextVersion` | ||
2. If `includeInChangelog`: | ||
1. Update `CHANGELOG.md` with an entry for `commit`. | ||
3. If `bumpType == breaking`: | ||
1. For every package `Q` which directly depends on `P`: | ||
1. Bump the version of `Q` with `bumpType = patch` and `includeInChangelog = false`. | ||
2. Update `Q`'s constraint on `P`. | ||
4. If `bumpType == breaking` or `bumpType == nonBreaking` and `component != null`: | ||
1. For every package `Q` in `component`: | ||
1. Bump the version of `Q` with the same `bumpType` as `P` and `includeInChangelog = false`. | ||
8. If `component` has a summary package: | ||
1. Update `CHANGELOG.md` in the summary package with `commit`. | ||
9. For every package `Q` which was affected by `commit`: | ||
1. Update `Q`'s constraint on `P` using `nextVersion`. |
Submodule libgit2dart
added at
34d492
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/pubspec.yaml b/pubspec.yaml | ||
index 5acda72..2831e58 100644 | ||
--- a/pubspec.yaml | ||
+++ b/pubspec.yaml | ||
@@ -8,7 +8,6 @@ homepage: https://github.com/SkinnyMind/libgit2dart | ||
|
||
environment: | ||
sdk: ">=2.18.0 <3.0.0" | ||
- flutter: ">=3.3.0" | ||
|
||
dependencies: | ||
args: ^2.3.0 | ||
@@ -23,16 +22,6 @@ dev_dependencies: | ||
lints: ^2.0.0 | ||
test: ^1.20.0 | ||
|
||
-flutter: | ||
- plugin: | ||
- platforms: | ||
- linux: | ||
- pluginClass: Libgit2dartPlugin | ||
- macos: | ||
- pluginClass: Libgit2dartPlugin | ||
- windows: | ||
- pluginClass: Libgit2dartPlugin | ||
- | ||
ffigen: | ||
output: "lib/src/bindings/libgit2_bindings.dart" | ||
headers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.