Skip to content
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

Support configuration arguments via --sentry-define #198

Merged
merged 28 commits into from
Apr 15, 2024

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Feb 12, 2024

📜 Description

Tried using Dart Environment Declarations, but failed for several reasons:

  • Can't run the plugin using dart run in a flutter app (integration test app)
denis@Deniss-MBP integration-test % dart run sentry_dart_plugin
The Flutter SDK is not available.
  • Values not read, only when specifying a dart source file 'dart run lib/main.dart'. Because of that we cannot use it in our plugin.

It seems plugins can use the arguments users pass, so I opted to implement our own declarations using a similar syntax:

--sentry-define=<KEY>=<VALUE>

With which users can pass any of our supported keys.

flutter packages pub run sentry_dart_plugin --sentry-define=release=app-internal-test@0.0.1

💡 Motivation and Context

Closes #81

💚 How did you test it?

  • Unit tests
  • Updated integration test

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against eee9ceb

@denrase denrase changed the title Support configuration via --define Support configuration arguments --sentry-define Feb 13, 2024
@denrase denrase changed the title Support configuration arguments --sentry-define Support configuration arguments via --sentry-define Feb 13, 2024
@eb-so
Copy link

eb-so commented Mar 7, 2024

Any new updates on this feature?

@denrase denrase marked this pull request as ready for review March 11, 2024 13:38
@denrase
Copy link
Collaborator Author

denrase commented Mar 11, 2024

@eb-so Sorry for the delay. I updated the PR and now it's ready for review.

@eb-so
Copy link

eb-so commented Mar 11, 2024

@eb-so Sorry for the delay. I updated the PR and now it's ready for review.

No worries, thanks for the update

lib/src/configuration_values.dart Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
lib/src/configuration_values.dart Show resolved Hide resolved
@denrase denrase requested a review from buenaflor March 19, 2024 14:14
@denrase
Copy link
Collaborator Author

denrase commented Mar 25, 2024

@stefanosiano Could you take a look here? 👀

@denrase
Copy link
Collaborator Author

denrase commented Apr 9, 2024

@buenaflor Could you re-review here to check if everything is as expected?

Copy link
Contributor

@buenaflor buenaflor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just gotta make sure this also works with the new release/dist pr

@denrase
Copy link
Collaborator Author

denrase commented Apr 9, 2024

@buenaflor Let's merge the other PR and then update here.

@buenaflor
Copy link
Contributor

buenaflor commented Apr 10, 2024

Needs updating of the comments as soon as #216 is merged

@denrase denrase merged commit b5dce98 into main Apr 15, 2024
9 checks passed
@denrase denrase deleted the feat/support-dart-define branch April 15, 2024 11:20
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.

Configuration via --dart-define
4 participants