-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Get rid of unused transport feature. #1112
Conversation
I think we can merge this just need to fix CI |
I also can't catch how it should work. |
Yeah, looks like you need to regen, this should be done by running |
https://github.com/hyperium/tonic/blob/master/tonic-health/tests/bootstrap.rs this is the test that regens the codegen that you then have to commit after running the test. |
Yeah, but if the user of library will enable |
Thats a good point, I would say we want to generate it without the |
Okey. Done. |
Looks like what is being generated on CI isn't the same as what is committed and that is causing CI failures. |
Ow, yeah, it because I always enable rustfmt on save and it add additional spaces to commentary. I will fix it tomorrow. |
Yeah, okey, your tests running as Aaa, okey, I got it. You mean remove |
Seems like another CI failure https://github.com/hyperium/tonic/actions/runs/3337161875/jobs/5527464629 |
Yeah, because Okey, I just found that I can run pipelines in my fork, so I can settle down all errors without troubling you =) |
Arr, I can't get it who enable Seems that |
@LucioFranco - name: Run ignored tonic-health bootstrap test
run: test --all-features --package tonic-health --test bootstrap bootstrap -- --ignored --exact |
.github/workflows/CI.yml
Outdated
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions/checkout@master | ||
- name: Run tests | ||
run: cargo test --all --all-features | ||
- name: Run ignored tonic-health bootstrap test | ||
run: cargo test --all-features --package tonic-health --test bootstrap bootstrap -- --ignored --exact |
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 don't think this is supposed to be ignored? We want the test to run and it should generate the exact code that was committed? Does it not work like that?
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.
cargo test --ignored
run tests which are marked as #[ignored]
.
So scheme is next:
- running
test --all --all-features
in root directory with all packages causes totransport
feature on fortonic-builds
, which lead to overridingdev-dependencies
intonic-health
, which lead to rerunbootstrap.rs
withtransport
feature, which lead to generatingtransport
code; - so we ignore that
bootstrap
intest --all
, but run this test separately;
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 see what you're saying, I think the better approach here is to add a build_transport
feature that when transport
is enabled for build can disable it. So in the bootstrap test we can just tell it even if transport is enabled don't generate it. Here is the PR #1130 so once that is merged you can just add the build_transport(false)
setting to tonic-health
's bootstrap.rs and then remove the transport feature. Or if it works you can make it so that when health's transport feature is enabled it sets that to true etc.
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.
Ok I finally got the PR merged after 3 days of trying to fix a CI bug with it! So if you update this PR with that then we can move forward. We should back out the CI changes etc the test should pass now.
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.
Ok I finally got the PR merged after 3 days of trying to fix a CI bug with it! So if you update this PR with that then we can move forward. We should back out the CI changes etc the test should pass now.
Okey, now it have:
Run cargo test --all --all-features
Updating git repository `[https://github.com/tokio-rs/prost/`](https://github.com/tokio-rs/prost/%60)
error: failed to load source for dependency `prost-build`
Caused by:
Unable to update https://github.com/tokio-rs/prost/?branch=lucio/format
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.
The code changes seem fine to me but the ci changes I am not sure about.
Greetings!
Motivation
I don't use transport feature and I don't need it dependencies.
Solution
Disable unused transport feature in
tonic-reflections
andtonic-health
.