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

chore: streamline BUILD.bazel file for State Manager #4212

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stiegerc
Copy link
Contributor

@stiegerc stiegerc commented Mar 3, 2025

It had a target naming scheme at odds with everything else MR related. This has been mildly annoying me for some time.

I modelled it after its counterpart in the replicated state.

@github-actions github-actions bot added the chore label Mar 3, 2025
@stiegerc stiegerc changed the title chore: streamline Bazel BUILD file for State Manager chore: streamline BUILD.bazel file for State Manager Mar 3, 2025
@stiegerc stiegerc marked this pull request as ready for review March 3, 2025 20:40
@stiegerc stiegerc requested a review from a team as a code owner March 3, 2025 20:40
"@crate_index//:strum",
"@crate_index//:tempfile",
],
deps = DEPENDENCIES + DEV_DEPENDENCIES,
Copy link
Contributor

@ShuoWangNSL ShuoWangNSL Mar 4, 2025

Choose a reason for hiding this comment

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

It seems that DEPENDENCIES + DEV_DEPENDENCIES introduces unnecessary deps for state_manager_lib_tests and state_manager_integration_test respectively.

Copy link
Contributor

Choose a reason for hiding this comment

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

There are pros and cons for grouping dependencies. In the case of "state_manager_lib_tests", which are relatively simple unit tests, I prefer the current way to explicitly list them as there are just a few.

Copy link
Contributor Author

@stiegerc stiegerc Mar 4, 2025

Choose a reason for hiding this comment

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

Went through everything and managed to remove some redundant dependencies. Kept the DEV_DEPENDENCIES though since all the dependencies for state_machine_test are also required for state_machine_integration. There are some extras I listed separately for integration:

    deps = [":state_manager"] + DEPENDENCIES + DEV_DEPENDENCIES + [
        # Keep sorted.
        "//rs/registry/subnet_features",
        "//rs/state_machine_tests",
        "//rs/test_utilities/io",
        "//rs/test_utilities/metrics",
    ],

But since it also needs quite a few of the DEPENDENCIES and you have to compile :state_manager anyway, I think it's ok to leave it like this right?

Seems reasonable to me, but LMK if you insist on listing it separately. No strong opinion here since it's not that many anyways.

"@crate_index//:tempfile",
],
proc_macro_deps = MACRO_DEPENDENCIES + MACRO_DEV_DEPENDENCIES,
deps = [":state_manager"] + DEPENDENCIES + DEV_DEPENDENCIES,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

@ShuoWangNSL
Copy link
Contributor

The renaming part looks good to me as it follows the naming convention inside the monorepo. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants