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

[iota-indexer] Remove mysql-feature gated code from indexer, ungate postgres-feature code #4954

Merged

Conversation

tomxey
Copy link
Contributor

@tomxey tomxey commented Jan 21, 2025

Description of change

Remove all code gated by mysql-feature feature flag.
Always enable all code gated by postgres-feature feature flag, and remove the flag.

Links to any relevant issues

solves part of #4904

Type of change

  • Refactoring

How the change has been tested

cargo ci-clippy
cargo nextest run -p iota-graphql-rpc --features pg_integration --no-fail-fast --test-threads 1
cargo test --package=iota-indexer --profile simulator --features shared_test_runtime
cargo test --package=iota-indexer --features pg_integration -- --test-threads 1

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@tomxey tomxey self-assigned this Jan 21, 2025
Copy link

vercel bot commented Jan 21, 2025

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

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 9:24am
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 9:24am
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 9:24am
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 9:24am

@tomxey tomxey added sc-platform Issues related to the Smart Contract Platform group. infrastructure Issues related to the Infrastructure Team labels Jan 21, 2025
@tomxey tomxey force-pushed the sc-platform/remove-mysql-feature-flag-gated-code-from-indexer branch from eed1312 to 723daa6 Compare January 21, 2025 14:48
@tomxey tomxey marked this pull request as ready for review January 22, 2025 07:34
@tomxey tomxey requested review from a team as code owners January 22, 2025 07:34
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

looks good with minor suggestions

@@ -171,5 +171,5 @@ Note that you need an existing database for this to work. Using the DATABASE_URL

```sh
# Change the RPC_CLIENT_URL to http://0.0.0.0:9000 to run indexer against local validator & fullnode
cargo run --bin iota-indexer --features mysql-feature --no-default-features -- --db-url "<DATABASE_URL>" --rpc-client-url "https://api.devnet.iota.cafe:443" --fullnode-sync-worker --reset-db
cargo run --bin iota-indexer -- --db-url "<DATABASE_URL>" --rpc-client-url "https://api.devnet.iota.cafe:443" --fullnode-sync-worker --reset-db
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole Run with TiDB... section is now obsolete and can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in a6eb68e

stored.senders.first()
}
}) else {
let Some(Some(sender_bytes)) = ({ stored.senders.first() }) else {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Simplification

Suggested change
let Some(Some(sender_bytes)) = ({ stored.senders.first() }) else {
let Some(Some(sender_bytes)) = stored.senders.first() else {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in f501d28

Copy link
Contributor

@DaughterOfMars DaughterOfMars left a comment

Choose a reason for hiding this comment

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

I can't help but feel like maybe this is too much. Do we really not want to support this kind of extensibility in the future? We could just remove the feature and leave the generics to allow for the possibility.

@kodemartin
Copy link
Contributor

I can't help but feel like maybe this is too much. Do we really not want to support this kind of extensibility in the future? We could just remove the feature and leave the generics to allow for the possibility.

I am afraid I see little merit in keeping the generics just in case we will need it in the future. It adds complexity to the API, and makes it hard to reason about its use, or maintain it while working on or extending dependent components, when we only see a single database being supported.

@DaughterOfMars
Copy link
Contributor

I can't help but feel like maybe this is too much. Do we really not want to support this kind of extensibility in the future? We could just remove the feature and leave the generics to allow for the possibility.

I am afraid I see little merit in keeping the generics just in case we will need it in the future. It adds complexity to the API, and makes it hard to reason about its use, or maintain it while working on or extending dependent components, when we only see a single database being supported.

Am I wrong in thinking that users of the lib could add their own implementations? If that's the case, we are removing that option.

@kodemartin
Copy link
Contributor

kodemartin commented Jan 23, 2025

I can't help but feel like maybe this is too much. Do we really not want to support this kind of extensibility in the future? We could just remove the feature and leave the generics to allow for the possibility.

I am afraid I see little merit in keeping the generics just in case we will need it in the future. It adds complexity to the API, and makes it hard to reason about its use, or maintain it while working on or extending dependent components, when we only see a single database being supported.

Am I wrong in thinking that users of the lib could add their own implementations? If that's the case, we are removing that option.

You are not wrong, but the fact remains: This is just a possibility, and I am of the opinion that adding complexity to the API is best dictated by actual feature requests, or feedback. This is not the case here.

Also, this library is not the same as the ingestion framework (iota-data-ingestion-core) that is more oriented toward builders.

At any case, we can certainly revisit if the need arises.

@tomxey tomxey requested a review from DaughterOfMars January 23, 2025 09:31
@tomxey tomxey merged commit 78ab453 into develop Jan 23, 2025
39 checks passed
@tomxey tomxey deleted the sc-platform/remove-mysql-feature-flag-gated-code-from-indexer branch January 23, 2025 13:45
lzpap pushed a commit that referenced this pull request Jan 30, 2025
…ostgres-feature code (#4954)

* Remove mysql-feature gated code from indexer, ungate postgres-feature code

* Remove empty default features from Cargo.tomls

* Simplify code

* Remove TiDB readme section
lzpap pushed a commit that referenced this pull request Jan 30, 2025
…ostgres-feature code (#4954)

* Remove mysql-feature gated code from indexer, ungate postgres-feature code

* Remove empty default features from Cargo.tomls

* Simplify code

* Remove TiDB readme section
lzpap pushed a commit that referenced this pull request Jan 30, 2025
…ostgres-feature code (#4954)

* Remove mysql-feature gated code from indexer, ungate postgres-feature code

* Remove empty default features from Cargo.tomls

* Simplify code

* Remove TiDB readme section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues related to the Infrastructure Team sc-platform Issues related to the Smart Contract Platform group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants