-
Notifications
You must be signed in to change notification settings - Fork 257
feat(aft): Version bump command #2068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
b775e2b
chore(aft): Make base commands sync
de1ab7b
feat(aft): Changelog/version commands
e44b881
fix(aws_common): Logger initialization
7da0a50
fix(aft): Versioning algorithm and performance
47b97f8
chore(aft): Clean up
4c1b36d
chore(aft): Update README
a4eb22b
chore(aft): Update tests
005559f
chore(aft): Update dependencies
4f364f2
chore(aft): Bump dependencies
a6a3579
chore(aft): Enforce changelog update includes commits
1f011c5
chore(aft): Add `promptYesNo` helper
a2c7470
chore(aft): Refine `isExample`
0dbd9f8
chore(aft): Change `aft version` to `aft version-bump`
8196961
chore(aft): Remove from mono_repo
1f6981a
fix(aft): Publish constraints
340e335
chore(aft): Publish command checks
57b4b03
chore(aft): Add components and define version bump types
9417e00
chore(aft): Clean up `deps` command
759f60f
chore(aft): Add placeholders for version bump commit
2257dda
chore(aft): Update logging settings
e32a2dc
test(aft): Update e2e tests
6fd0b4d
More updates
a82dd1a
Merge remote-tracking branch 'aws/next' into feat/aft/changlog
ef26f28
chore(aft): More cleanup
364b7ff
chore(aft): Add propagation option
db77a1a
chore(aft): Remove `changelog` command
7f71862
chore(aft): Clean up
1961050
Merge remote-tracking branch 'aws/next' into feat/aft/changlog
b2fe888
chore(aft): Update wording in `aft.yaml`
a48bab8
chore(aft): Link packages before version bump
dnys1 80cd383
chore(aft): Follow Dart SemVer strategy
dnys1 ae1ff5c
chore(aft): Fix analysis errors
dnys1 9c053cd
fix(aft): Submodule `libgit2dart`
dnys1 8d6234d
fix(authenticator): ARB syntax
dnys1 1415fb7
chore(aft): Remove setup step
dnys1 297f7c3
chore(aft): Copy libgit2 from
dnys1 018acaa
chore(aft): Reset after patch
dnys1 bed7229
chore(aft): Copy lib to /usr
dnys1 0d5a35f
fix(aft): `dev_dependency` conflicts
b42af79
Merge remote-tracking branch 'aws/next' into feat/aft/changlog
f5c7f6b
chore(aft): Change workflow path for libgit2
c1de801
chore(aft): Fix tests in CI
65b1f71
Merge remote-tracking branch 'aws/next' into feat/aft/changlog
2cc6576
chore(aft): Bump dependency
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
# Generated with aft. To update, run: `aft generate workflows` | ||
name: aft | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- stable | ||
- next | ||
paths: | ||
- 'packages/aft/**/*.dart' | ||
pull_request: | ||
paths: | ||
- 'packages/aft/**/*.dart' | ||
- 'packages/aft/**/*.yaml' | ||
- 'packages/aft/lib/**/*' | ||
- 'packages/aft/test/**/*' | ||
- '.github/workflows/dart_vm.yaml' | ||
- '.github/workflows/dart_native.yaml' | ||
- '.github/workflows/aft.yaml' | ||
schedule: | ||
- cron: "0 0 * * 0" # Every Sunday at 00:00 | ||
defaults: | ||
|
@@ -24,12 +19,34 @@ permissions: read-all | |
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/dart_vm.yaml | ||
with: | ||
working-directory: packages/aft | ||
native_test: | ||
if: ${{ github.event_name == 'push' }} | ||
needs: test | ||
uses: ./.github/workflows/dart_native.yaml | ||
with: | ||
working-directory: packages/aft | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # 3.1.0 | ||
with: | ||
submodules: true | ||
|
||
# Needed for `git` but only ever used locally. | ||
- name: Git Config | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Amplify Flutter" | ||
|
||
- name: Setup Dart | ||
uses: dart-lang/setup-dart@196f54580e9eee2797c57e85e289339f85e6779d # main | ||
with: | ||
sdk: stable | ||
|
||
- name: Get Packages | ||
working-directory: packages/aft | ||
run: | | ||
# Patch libgit2dart (see https://github.com/dart-lang/pub/issues/3563) | ||
( cd external/libgit2dart; git apply ../libgit2dart.patch ) | ||
dart pub upgrade | ||
mkdir linux | ||
cp external/libgit2dart/linux/*.so linux | ||
|
||
- name: Run Tests | ||
working-directory: packages/aft | ||
run: dart test |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As
changelog
andversion-bump
are separate commands, the release PR will always need to contain 2 commits - one for each?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the changelog command for now - it's all one command