-
Notifications
You must be signed in to change notification settings - Fork 0
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
Separate env and kafka packages #183
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cdfb2a9
to
c299cc8
Compare
c299cc8
to
aa37f9f
Compare
pbrisbin
approved these changes
Jul 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
freckle-env
, I'd really like to get away from this.Freckle.App.Env
was created at a timeenvparse
lacked a lot of things, so much so the the module fully implemented everything. Since then we've replaced its internals withenvparse
plus some things, and started working to upstream those things toenvparse
. I wonder if they'd accept everything we have here. Until such time, I thinkfreckle-env
a fine enough name. The only other thing that comes to mind isenvparse-extra
, which piggy backs on the convention ofwai-extra
orconduit-extra
.freckle-kafka
since you've made this entirely independent, it probably makes sense to not call thisfreckle-
, but I don't really know what other distinguishing features it has 🤔
I'll try a little. supki/envparse#24 |
This was referenced Jul 25, 2024
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've discussed breaking up
freckle-app
but not in much concrete detail, so this may be more a proposal than necessarily a finished task. Often I find I just have to start working on something like this to figure out where the right splits are.I think one fairly sure goal is to be able to stop installing Kafka on services that don't need it, so I took a look at how coupled our Kafka modules are to the rest of freckle-app and tried pulling it out into a
freckle-kafka
package. I guess it could depend onfreckle-app
, but I went a step further here and completely decoupled them so neither depends on the other.Probably a separate repository would be warranted, but doing the refactor all in this repo is easy. Didn't give much thought to the package names, can change them to whatever folks prefer. Modules names could also be reconsidered.
The dependencies of the kafka code on the rest of freckle-app were:
Freckle.App.Prelude
- this was easily replaced byRelude
.Freckle.App.Env
- to write definitions for environment variable parsers; this includes our ownTimeout
type, which makes dropping down to the underlyingenvparse
library not an attractive option. This prompted an additional package,freckle-env
, which in this PRfreckle-app
reexports to avoid any change for users.Freckle.App.Exception
- this was replaced by dropping down to the underlyingannotated-exception
library, though I copied the definition ofannotatedExceptionMessageFrom
into freckle-kafka.Yesod.Core.Lens
- Inlined trivial lens definitionsenvL
andsiteL
.Freckle.App.OpenTelemetry
- dropped down to the underlyinghs-opentelemetry-sdk
package, withproducerSpanArguments
andconsumerSpanArguments
being trivial inlines.Freckle.App.Async
- I avoided these dependencies by pushing the forking responsibility onto downstream users, though the changes to upgrade are trivial.produceKeyedOnAsync
just appliesvoid . async
, andrunConsumer
just applieswithTraceContext . immortalCreateLogged
. These are noted in the changelog.