I am just starting into contributing to a tap, and...
# best-practices
t
I am just starting into contributing to a tap, and are faced with a general question: I personally moved away from installing dependencies on my machine to developing in a devcontainer. Since most projects for meltano, taps, targets currently don’t have devcontainer files defined, how does the community feel about adding that? It wouldn’t force contributors to actually use them, but it would open the option for those who prefer that way of working
a
Totally with you. In a recent PR on a tap, I just added my own dev container definition. When I offered to remove it from the PR or move it to another, the maintainers were happy to just keep it in.
But yes, i personally agree with you it's nice to have the min/default dev experience for the repo already included in the repo
t
nice to hear! I wasn’t sure how accepted devcontainers are at the moment
a
A community member created and published a "Meltano" dev container project. It would probably be valuable to have one published for "Meltano / Singer Python Connectors". It would also make a great addition to the SDK cookie cutters, I think.
My opinion (and others can disagree for valid reasons) is that devcontainer definitions aren't intrusive enough to not want them in a project.
Caveat is that, of course, each developer also will have their own workspace preferences and no single dev container would be optimized for every developer's preferences. I'm interested how IDEs will evolve here, if they'll open up ways for devs to personalize while still starting from the default.
t
I guess it would be great to have a split in settings here: • general project settings (e.g. a specific linter) -> to be committed to git • user specific preferences (e.g. a highlighting IDE plugin) -> gitignore
and once this becomes a common IDE feature: a common format for devcontainer definitions
a
Here's a simple one I created for
meltano-map-transform
, which is basically a hybrid tap and target: https://github.com/MeltanoLabs/meltano-map-transform/blob/main/.devcontainer/devcontainer.json
Some of those features (bandit?) could possibly be overkill but it works!
Also it includes Meltano as a dev container feature so the developer can freely use Meltano for testing without having to manually install it
t
nice one! I usually start with a custom Dockerfile that has
poetry install
as last step, but it is not so different from what you’re doing
a
Yeah, I'm experimenting with "features" as lightweight attachable components, as an alternative to the standard installation methods. Downside is that they don't (yet?) seem to have the same caching optimizations you get from including in your Dockerfile. Maintenance-wise, I'd rather not support custom Dockerfiles, but performance-wise, I think they still offer the best tuned "load time" after prebuilds and/or build caching are enabled. (Not based on scientific data, just my own anecdotal experiences so far.)
s
Just to add my 2 cents, because I’m basically not coding on my laptop anymore at all: Devcontainers are IMHO particularly great because tap & target dependencies are sooo heterogeneous, having things set up already is just a nice thing to have (and Python dependency management is still like an unsolved problem it seems to me sometimes :-D).
t
yay, more devcontainer fans, no cons so far 😉