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

refactor(v7): make dockerutil internal/ public #1102

Merged
merged 4 commits into from
May 1, 2024
Merged

Conversation

Reecepbcups
Copy link
Member

closes #869 (part 2)

Copy link

vercel bot commented Apr 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
interchaintest-docs ⬜️ Ignored (Inspect) Visit Preview May 1, 2024 6:38pm

@Reecepbcups Reecepbcups marked this pull request as ready for review April 29, 2024 18:47
@Reecepbcups Reecepbcups requested a review from a team as a code owner April 29, 2024 18:47
@Reecepbcups Reecepbcups requested a review from jtieri April 29, 2024 18:47
@jtieri
Copy link
Member

jtieri commented Apr 29, 2024

Before i actually review the changes i just wanted to ask, does it make sense for all of this code to become public?

I can see the argument for making the internal/dockerutil package public because there are actually a lot of scenarios where you may want lower level access to the containers or volumes for container lifecycle management or reading/writing data, but i don't necessarily see a case where the blockdb or mocktesting packages are useful for developers working outside of the interchaintest repo.

iirc mocktesting is used for internal testing inside interchaintest, so i can't see why anyone would need to import code from this package. I also can't think of a reason devs would need to do anything with blockdb if interchaintest is already handling all of the database specific logic for you e.g. connecting to DB, the schemas, extracting chain related data, inserting data, etc. I can actually imagine making the blockdb package public could lead to weird behavior if devs try to call certain functions and also have BlockDatabaseFile set in Interchain.Build, for example you could end up trying to call ConnectDB explicitly after the internal logic in interchaintest has already initialized a connection and this would lead to resource contention due to sqlite not supporting more than 1 open connection per process very elegantly.

tl;dr: I'm in favor of making the Docker related code public but the rest of it seems useless from the perspective of developers making use of the testing framework and i think it would also create additional footguns in the case of blockdb since this code wasn't written in a way that it should be invoked outside of internal interchaintest functionality.

@Reecepbcups
Copy link
Member Author

These are good points. I was thinking developers could extend BlockDB, but this again could lead to more confusion when new contributors try using it directly improperly. Ill change this now

@jtieri
Copy link
Member

jtieri commented Apr 30, 2024

These are good points. I was thinking developers could extend BlockDB, but this again could lead to more confusion when new contributors try using it directly improperly. Ill change this now

It's possible that someone may find a usecase for this but i think until we have a clear user story it makes sense to keep the package internal so we don't clutter the public API exposed by the framework and also don't introduce additional footguns for users.

I don't think many people even know about the blockdb feature, could be a good candidate for a future blog post or maybe just we just write some better docs around it.

Copy link
Member

@jtieri jtieri left a comment

Choose a reason for hiding this comment

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

had the one comment but otherwise this looks good to me! i'll just approve now so you aren't blocked on me

version.go Outdated Show resolved Hide resolved
test_setup.go Outdated Show resolved Hide resolved
cmd/interchaintest/interchaintest_test.go Outdated Show resolved Hide resolved
@Reecepbcups Reecepbcups enabled auto-merge (squash) May 1, 2024 18:38
@Reecepbcups Reecepbcups changed the title refactor(v7): make internal/ public refactor(v7): make dockerutil internal/ public May 1, 2024
@Reecepbcups Reecepbcups merged commit 8d9730c into v7 May 1, 2024
16 checks passed
@Reecepbcups Reecepbcups deleted the reece/make-v7-public branch May 1, 2024 20:35
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