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

rust: Rename BuildChunkedOCI struct to BuildChunkedOCIOpts #5273

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Feb 3, 2025

For consistency, but also because it can be confusing to have the enum variant be named the same as the underlying struct.

This caused a runtime issue for me that I can't reproduce anymore, but for posterity:

$ rpm-ostree experimental compose build-chunked-oci
thread 'tokio-runtime-worker' panicked at /var/home/jlebon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.27/src/builder/debug_asserts.rs:281:9:
Command build-chunked-oci: Argument group name must be unique

        'BuildChunkedOCI' is already in use
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: task 1 panicked with message "Command build-chunked-oci: Argument group name must be unique\n\n\t'BuildChunkedOCI' is already in use"

That way it's clearer what this clappy struct powers.
@cgwalters
Copy link
Member

cgwalters commented Feb 3, 2025

Hmm I believe you there's a bug but I am confused how it can fail for (just) you; we do have passing tests for this code in e.g. https://github.com/coreos/rpm-ostree/actions/runs/13121766353/job/36610259115?pr=5272

@cgwalters cgwalters enabled auto-merge February 3, 2025 21:18
For consistency, but also because it can be confusing to have the enum
variant be named the same as the underlying struct.

This caused a runtime issue for me that I can't reproduce anymore, but
for posterity:

```
$ rpm-ostree experimental compose build-chunked-oci
thread 'tokio-runtime-worker' panicked at /var/home/jlebon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.27/src/builder/debug_asserts.rs:281:9:
Command build-chunked-oci: Argument group name must be unique

        'BuildChunkedOCI' is already in use
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: task 1 panicked with message "Command build-chunked-oci: Argument group name must be unique\n\n\t'BuildChunkedOCI' is already in use"
```
@jlebon
Copy link
Member Author

jlebon commented Feb 5, 2025

OK yeah, I'm not sure what happened but I can't reproduce the runtime error anymore. I did upgrade my Rust toolchain in the meantime so possibly related? Still kept the changes though since it makes things a bit clearer, but also fine without it.

@jlebon
Copy link
Member Author

jlebon commented Feb 5, 2025

Searching the error message brings up clap-rs/clap#4279, which also confirms my suspicion that it's related to flattening. Though it looks like it was fixed a while ago.

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Let's definitely do this

Copy link

openshift-ci bot commented Feb 5, 2025

@jlebon: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/kola-upgrade 7ddb064 link true /test kola-upgrade
ci/prow/images 7ddb064 link true /test images

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@cgwalters cgwalters merged commit 2e0abb9 into coreos:main Feb 5, 2025
15 of 17 checks passed
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