Add flutter-symbol upload command
What and why?
This adds a command - flutter-symbols upload - that locates symbol and mapping files for Flutter projects and uploads them with the proper information to Datadog intake.
This command handles upload iOS dSYMS, Android Proguard Mapping Files, and Dart Symbol Files, depending on the parameters specified. The command looks for the various files in their default locations post a Flutter build.
Note that Dart Symbol Files do not have a default location so that parameter is required.
How?
The command farms out to the dsyms upload command for the iOS portion, but implements uploaders for Android and Flutter. The Android implementation duplicates the functionality of the Datadog gradle plugin, but I think it's worth it to keep uploading simple for our users.
One thing of note is how this is tested -- I created an upload helper method that I can easily mock, that ensures that I pass the proper Multipart data to each upload request. I also created a helper method for performing a sub-command, which is mocked to test calling the dSYM upload.
Review checklist
- [x] Feature or bugfix MUST have appropriate tests (unit, integration)
- [ ] [Synthetics] New releases of
datadog-ciMUST be followed by a synthetics-ci-github-action release
Datadog Report
Branch report: jward/flutter-upload
Commit report: de7e073
:white_check_mark: datadog-ci-tests 0 Failed, 0 New Flaky, 1158 Passed, 0 Skipped, 46.72s Wall Time
@louiszawadzki Addressed your comments and also added pre-release / build number stripping. Should be ready for re-review.
Datadog Report
Branch report: jward/flutter-upload
Commit report: 7c1918f
:white_check_mark: datadog-ci-tests 0 Failed, 0 New Flaky, 1160 Passed, 0 Skipped, 50.26s Wall Time
Great PR! As this new command also supports iOS symbols, should the dsyms command be deprecated so there is only one way to upload DSYMs?
Great PR!
Thanks 🤗
As this new command also supports iOS symbols, should the
dsymscommand be deprecated so there is only one way to upload DSYMs?
No, we should keep it so there's only one way to upload dSYMs, if that makes sense.
The idea is that iOS users will use the dSYM command and not have to worry about any Flutter stuff, but Flutter users have to upload the same files with different required parameters, we just combined them for simplicity on the Flutter side, and to make sure the same codepaths are used in both cases.
All good then, thanks for the explanation :+1:
@m-rousse I think I addressed everything. Let me know if you see anything I missed!