Discussion about changes to public API #2
Replies: 3 comments 5 replies
-
This is an interesting insight! Can you share a story from Gusto to help folks understand how this plays out? |
Beta Was this translation helpful? Give feedback.
-
|
@alexevanczuk thanks for starting this discussion and for all your hard work to make this possible!
💯 I completely agree and this matches up with my experience in the GitHub monolith. The only risk I can see is if teams add calls that violate privacy even though there is a public method that would suit their purposes. This would add a deprecation to the publishing team's package even though they've done everything right. This might just be a matter of people communicating though rather than a technical problem. The publishing package could also set their privacy enforcement to "strict" which would at least allow them to be alerted via CODEOWNERS if someone tries to drop it to "true".
Agreed again. We haven't seen any value from this feature other than testing. Removing this feature really clarifies the purpose of the
We also use
This one is interesting. Personally, I really appreciate the clear demarkation of having a "public" folder separate from a "private" folder. Privacy is very important and feels "right" to leverage the directory structure to communicate it. That being said, Rails has already decided (eons ago) that directories are more like ways of "tagging" Ruby files to indicate their purpose and makes certain assumptions about these "tags". Rails was here first and we need to respect that. We're not going to get a |
Beta Was this translation helpful? Give feedback.
-
I feel the same way. Is there any appetite for inverting the idea of the list of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone! Now that we're wrapping up allowing packwerk to be extended, let's continue the discussion from Shopify/packwerk#219 on what changes we want to make to the privacy checking functionality. I'd love to help ensure we continue to support the community, so please share any and all concerns about the following changes and we can discuss how to address them.
Here are some changes that I think might be valuable. Please share any feedback about this as well as any ideas you have that are not listed here!
Breaking Changes
Invert violations in
package_todo.ymlfiles (formerly known asdeprecated_references.ymlflies)Right now
package_todo.ymlfiles show OUTBOUND privacy violations. After using privacy checking extensively at Gusto, we've found it feels a lot more sensible forpackage_todo.ymlfiles to show INBOUND privacy violations. We've found that addressing privacy violations on a package is the responsibility of the publishing package, not the consuming package (who is a client of the publishing package and should not be responsible for shaping the public API of a different system). We believe this will better orient incentives and tell a better story (namely – to improve a package, you only need to look at its ownpackage_todo.ymlfile.I believe this may be blocked on upstream changes into packwerk to allow checkers to have more control over where violations show up, but I want to gather feedback before pursuing that.
Remove the "enforce privacy for specific constants" feature
At Gusto, we do not use this feature because we find it a lot more valuable to think about packages as private by default rather than public by default. Using this features establishes a public by default mentality, since everything is public except for the listed constants. I believe that a focus on public by default as the golden path moving forward would allow us to remove some extra complexity, but I want to check in with folks if they're using this feature and find it valuable.
Two alternatives to removing this:
package.ymlkey (e.g.private_constants) would simplify the maintenance of theenforce_privacysetting and tidy things up a bit.Remove user defined public paths
Are folks using this one? At Gusto, we exclusively use
app/public, which is the default. I wanted to check in if folks are using this and found it helpful. I don't see an issue in maintaining this, but if folks are not using it and we're doing a major version bump, it would be nice to remove.New features
Sigil based public API promotion
We'd like a new way to declare a constant (i.e. a file) as public. Having a dedicated "public" folder (i.e. coupling public API designation to file location) has caused some issues and pain for folks. There are some tools out there, Rails included, which expect certain things in certain places, e.g.
services.This is especially relevant when it comes to nested packs (in the world of stimpack), since we'd like a way for a child pack to "promote" its public API to the parent pack. Here are some API ideas:
For making something public to the same pack
For making something public to a parent pack
Nested Pack Support
We want to optionally allow nested packs to ignore privacy violations within pack groups.
Beta Was this translation helpful? Give feedback.
All reactions