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

ref: Split protocol types from client file #96

Merged
merged 5 commits into from
Oct 9, 2020
Merged

Conversation

rxlabz
Copy link
Contributor

@rxlabz rxlabz commented Oct 7, 2020

fix #84

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Split the base file in separated files/classes in a /model /protocol subfolder

💡 Motivation and Context

This new structure gives a better perspective of the plugin organisation

💚 How did you test it?

It passes the existing tests

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

dart/lib/src/io_client.dart Outdated Show resolved Hide resolved
@bruno-garcia
Copy link
Member

It's a good direction, I'd propose we call it protocol instead of model though

@bruno-garcia bruno-garcia changed the title fix : SentryClient refactoring ref: Split protocol types from client file Oct 7, 2020
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

LGTM. @marandaneto ?

@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 7, 2020

I will fix the analysis score.

@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 7, 2020

@bruno-garcia @marandaneto we are loosing 5 points because the changelog file is not in the package directory, can I move the current changelog.md in /dart ?
We're also losing 10 points due to some linting errors for @visibleForTestingmembers, I try to understand why :)

@bruno-garcia
Copy link
Member

@bruno-garcia @marandaneto we are loosing 5 points because the changelog file is not in the package directory, can I move the current changelog.md in /dart ?

That lint makes sense since all files included in the directory get pushed to pub.dev as part of the package. Except those on .gitignore. So right now we're missing a changelog

One alternative is a symlink from both sentry and sentry-flutter to the root.

Or perhaps best is to keep two changelogs, one on each package.
With the single changelog approach (ideal IMHO) we should fix the GH actions checks to verify the right file depending on what changes were made (if diff includes stuff under sentry-flutter than that changelog must have a new entry

@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 7, 2020

By "single changelog approach" you mean a changelog for each package ? If so I'm agree.
But wouldn't be simpler to have 2 distinct packages in pub.dev: sentry & sentry_flutter ? and maybe 2 Github repos or submodules ?

@marandaneto
Copy link
Contributor

marandaneto commented Oct 8, 2020

@rxlabz is there a way to overwrite the package-analysis changelog folder (to the root one only)? 2 changelogs IMO is suboptimal, I see a change happening that touch files in both folders, and we'd need to duplicate the changelog anyway.

@@ -2,6 +2,5 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export 'src/base.dart';
export 'src/browser.dart';
export 'src/io_client.dart';
Copy link
Contributor

Choose a reason for hiding this comment

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

@rxlabz do those file naming changes cause any breaking changes on the client's app? do they need to fix imports or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it has no impact unless you use a package internal path which is bad :)

@marandaneto
Copy link
Contributor

@rxlabz I'd suggest if not yet, that you run the sample again and check that everything is working properly as your description only mention "tests are passing".

@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 8, 2020

@marandaneto the 2 examples works well on my side, did you noticed any error ?

@marandaneto
Copy link
Contributor

@marandaneto the 2 examples works well on my side, did you noticed any error ?

no, not really, but you didn't check a few things on the PR template so I was afraid that you didn't run it.
I'd suggest to always review your PR and check I reviewed submitted code for example

Copy link
Contributor

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

LGTM.

ps: agreed to lower down the pub points to 85 and throw a task to be done at a later point, we'd need to move changelog around or find other solutions.

 - disable the 2 useless `invalid_use_of_visible_for_testing_member` causing -10pts
 - add 2 `dart:sync` imports sdk <=2.1.0
@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 8, 2020

@marandaneto @bruno-garcia I pushed a new commit to level up the score to 95/100

@rxlabz
Copy link
Contributor Author

rxlabz commented Oct 8, 2020

The analyzer score on my machine is 95/100 but only 90 on GitHub 🤔

@marandaneto
Copy link
Contributor

marandaneto commented Oct 8, 2020

The analyzer score on my machine is 95/100 but only 90 on GitHub 🤔

because this one on GH is for the flutter folder, you are probably changing the dart folder, I guess? so happy to merge.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

LGTM! We merge this then and figure out the 5 pub points later then as @marandaneto suggested. We'll be making many PRs before we publish anything anyway

@rxlabz rxlabz merged commit ccb2560 into main Oct 9, 2020
@rxlabz rxlabz deleted the fix/new_file_structure branch October 9, 2020 07:10
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.

SentryClient refactoring, move the protocol to its own dart files/classes
3 participants