-
Notifications
You must be signed in to change notification settings - Fork 249
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
ci(repo): New CI pipeline #2331
Conversation
7b7d251
to
a59f95f
Compare
- `generate`: Generates various repo items | ||
- `workflows`: Generates GitHub actions workflows for all packages in the repo |
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.
sdk should be listed under generate
, right?
- `generate`: Generates various repo items | |
- `workflows`: Generates GitHub actions workflows for all packages in the repo | |
- `generate`: Generates various repo items | |
- `workflows`: Generates GitHub actions workflows for all packages in the repo | |
- `sdk`: Generates the AWS SDK for a given package |
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 marked the sdk
command as hidden for right now. It only works for me.
/// Skip package checks for Flutter packages when running in CI without | ||
/// Flutter, which may happen when testing Dart-only packages or specific | ||
/// Dart versions. |
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 don't think I follow this. Would this be a dart-only package that has flutter listed as a dependency for some reason?
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.
This is a roundabout way of saying "don't try to run flutter pub upgrade
when flutter
is not available"
import 'package:aft/aft.dart'; | ||
import 'package:path/path.dart' as p; | ||
|
||
/// Command for generating associated items in the repo. |
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.
Update comment
packages/aft/lib/src/models.dart
Outdated
/// The package's pubspec. | ||
final PubspecInfo pubspecInfo; | ||
|
||
/// The package flavor, e.g. Dart or Flutter. | ||
final PackageFlavor flavor; | ||
|
||
/// The integration test directory within the enclosing directory, if any | ||
Directory? get integTestDirectory { |
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.
This isn't used currently, correct? Are you workflows for integ tests could be generated as well?
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.
It's not currently used. Needed for aft test
though. I can remove it here.
2547004
to
38eef64
Compare
.github/workflows/flutter_vm.yaml
Outdated
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # 3.1.0 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # 2.7.0 |
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.
uber nit: isn't this 2.8.0 subosito/flutter-action@dbf1fa0?
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.
Whoops. Updated 👍
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.
Approved w some small nit/questions/callouts that are non-blocking.
One general question: When would it make sense to remove the tests from circle that are redundant here? Specifically thinking of flutter unit tests. I know you mentioned it's on the roadmap to remove circle runners when Dart impls finished but dk if we want to specifically remove the same tests being run in 2 places.
- next | ||
pull_request: | ||
paths: | ||
- 'packages/amplify_datastore/**/*.dart' |
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.
question: Would it make sense to also include interface paths to this pattern so that changes to the interface execute these tests?
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.
Yes, in the future this will be possible to do, specifically when #2068 is merged since it has the semantic understanding of the repo (which packages depend on which).
- next | ||
pull_request: | ||
paths: | ||
- 'packages/api/amplify_api/**/*.dart' |
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.
question: Is the reason for having the category flutter vm tests all be their own workflow that is seems difficult to enforce this pr/pattern thing any other way? Absent that, seems like a matrix would work nicely but not sure how you would do this via matrix. Seems to make sense, just trying to make sure I understand why.
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.
Not sure I understand the question. Each package gets its own workflow. Which workflows run depends on the structure of the package. The flutter_vm
workflow is chosen for any package which depends on Flutter.
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.
My bad for confusing phrasing (I also saw this bit/left this comment before I saw the autogeneration code). My point was that the similar workflow logic is running/repeated across these categories. You could run them via a matrix to save repitition like the integration tests but I'm not sure how you would stop one category from running on pushes to certain files with that pattern, so I thought that was why you did it this way. Knowing they are autogenerated would also be another reason.
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.
Yeah, since paths affect the workflow as a whole and there isn't a way to control this at any lower level from what I've seen. Since it's autogenerated, there's no real maintenance risk to 1 workflow vs. 50. It's also why all the workflow logic is centralized in flutter_vm
, so all these files do is control the paths
to run on, essentially.
We also have more information about the packages in aft
than we do once the workflow is running which is another reason we generate them.
os: | ||
# macos-latest currently points to macos-11 | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on | ||
- macos-12 |
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.
callout (no change needed inthis PR): This is going to consume lots of macos compute across its consumers, so just might be something to keep an eye on if we hit a limit at some point. Also dk if people run workflows on their fork like I do where you can only run 5 mac jobs at once.
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.
Good point. My thinking with these is that they will only run on pushes (not pull requests) so they can run asynchronously without blocking any real work. Open to further discussion, though (maybe run them on a schedule instead?)
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.
Sure, can discuss in other forum. For now I think this PR has appropriate change bc good to test these on pushes, could discuss optimizations later. At the root I think a lot of compute consumption is just running aft bootstrap
like we discussed for another change, so cutting down at that time would help a lot. The next thing to consider would be things like limiting matrix on pushes/schedules, etc... IMO.
final isDartPackage = package.flavor == PackageFlavor.dart; | ||
final workflowContents = StringBuffer( | ||
''' | ||
name: ${package.name} |
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.
nit/question: Should this include a comment that they are autogenerated in the output? I had no idea until I got here.
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.
Good point. Updated 👍
@@ -12,6 +12,9 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
// TODO(dnys1): Investigate DDC failures | |||
@Tags(['no-ddc']) |
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.
nit: Would we ever consider keeping tags in a centralized place as consts/enums? Like maybe in amplify_test? That way they're easier to keep track of/not repeat, etc...
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.
This is definitely temporary. At some point, if we have more permanent tags used throughout, that could definitely make sense.
@@ -11,7 +11,7 @@ environment: | |||
|
|||
dependencies: | |||
amplify_db_common_dart: ^0.1.0 | |||
drift: ^2.2.0 | |||
drift: ^2.0.0 |
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.
why is this changed here/other places?
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.
The changes are from this commit be12ace
- next | ||
pull_request: | ||
paths: | ||
- 'packages/amplify_core/**/*.dart' |
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.
Fore these patterns, I dk if would make more sense to specify what should NOT run the tests, like !**/*README.md
than trying to state what SHOULD and leave this open to errors of omission, but I do not feel strongly one way or the other.
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.
My feeling is that CI checks in PRs should do the absolute minimum amount of work to verify the change. This is best accomplished through an "opt-in" rule vs "opt-out". On push, CI checks run for any change and this is a better mechanism for catching things which weren't immediately obvious.
Adds base workflows for Dart & Flutter packages
Adds a new command for generating GitHub actions workflows
Updates goldens for new CI pipeline
Should be `master` instead of `main`
Generates GitHub Actions workflows for all packages in the repo
Removes mono_repo from the repository
Worker tests fail in DDC right now. Since they are never compiled in DDC mode when published, we don't need to worry about them for now.
Enables web tests in the `aws_signature_v4` package
`amplify_db_common` dependency constraints were set too high for minimum Dart target of 2.17.0
This was removed in `pkg:xml` where it happened automatically (renggli/dart-xml@366149f)
Allows packages to declare a `setup.sh` script to run before running tests to allow for pluggable package-specific setup work.
02bf809
to
542e6ce
Compare
mono_repo
dependency throughoutaft generate workflows
command for automatically generating workflows