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

Colocate privacy API on Packwerk::Package #233

Merged
merged 1 commit into from
Oct 31, 2022

Conversation

alexevanczuk
Copy link
Contributor

@alexevanczuk alexevanczuk commented Oct 17, 2022

What are you trying to accomplish?

Much like #232, this moves us closer to #219 by colocating all concerns around privacy on Packwerk::Package by putting them in PrivacyChecker

What approach did you choose and why?

I did not yet remove the old API on Packwerk::Package, since that would be a breaking API change, which I'd like to do all at once when we move PrivacyChecker to its own gem. When that happens, that gem can have a nice and easy to use API that can replace the old APIs folks were using on Packwerk::Package.

What should reviewers focus on?

Let me know if this approach makes sense to you!

I'm wondering if I should just go ahead and remove the old API from Packwerk::Package. While it's probably best to assume folks are using it, I also wouldn't be surprised if very few or no clients are actually using them (packwerk itself is using them in very few places).

Type of Change

  • Bugfix
  • New feature
  • Non-breaking change (a change that doesn't alter functionality - i.e., code refactor, configs, etc.)

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • It is safe to rollback this change.

@alexevanczuk alexevanczuk requested a review from a team as a code owner October 17, 2022 00:25
@alexevanczuk alexevanczuk force-pushed the ae-colocate-privacy-api-on-package branch from bdb35a2 to 28b529a Compare October 19, 2022 20:56
@@ -11,6 +11,39 @@ class PrivacyChecker

VIOLATION_TYPE = T.let("privacy", String)

class << self
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to put this in a nested different class or module? This logic isn't really related to the checker, it belongs to the package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eventually, this whole class will implement a Packwerk::PluginInterface, which will connect it to the rest of the packwerk runtime. I think that it might make sense to better factor out the privacy implementation into more logical parts when it comes time to do that, but I was hoping at this stage to just move all privacy related things into a pile in one place so that it can be deleted from packwerk.

Let me know if you think think that makes sense as a stepping stone.

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer the logic be encapsulated somewhere else. It is hard for me to visualize the end goal of how the logic will be organized. For now, this is still part of Packwerk for the time being, so perhaps an easy and testable way to do is through a composite object that lives in the privacy namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay! I moved the logic to a PrivacyProtectedPackage.

@alexevanczuk alexevanczuk force-pushed the ae-colocate-privacy-api-on-package branch 2 times, most recently from 16f4479 to cc41029 Compare October 28, 2022 20:16
@alexevanczuk
Copy link
Contributor Author

@gmcgibbon Can you take another look?

@alexevanczuk alexevanczuk force-pushed the ae-colocate-privacy-api-on-package branch from 9fda03d to 9120df2 Compare October 31, 2022 17:36
@alexevanczuk alexevanczuk merged commit 618baf0 into main Oct 31, 2022
@alexevanczuk alexevanczuk deleted the ae-colocate-privacy-api-on-package branch October 31, 2022 17:39
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.

2 participants