bottlerocket-os / bottlerocket-os/twoliter

relative paths does not work in Infra.toml for signing_keys

Open
#463 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
34
Forks
43
Avg merge
11h 13m
Merged PRs (30d)
16

Description

Here you call this function: https://github.com/bottlerocket-os/twoliter/blob/develop/tools/pubsys-config/src/lib.rs#L185C53-L185C67

Which according to docs;
https://docs.rs/url/latest/url/struct.Url.html#method.from_file_path

requires the path to be absolute. If you try to create an Infra.toml that refers to a key relative to it, (as you have an example for in the Infra.toml.example file) it will fail with the relatively unintuitive error: `Unable to build URL from signing key for repo 'default'`

The error could be improved by passing on the error from the inner error, and also perhaps the actual parameter that caused the error. I am unsure how you could handle this without not using the `url` crate as it doesn't seem to carry any functions to allow for relative paths - but I am also unsure why you would need to support an URI-style path to the file here?

Contributor guide

Open the contributing guide

Research direction

Start at tools/pubsys-config/src/lib.rs around line 185 and compare the signing_keys example in Infra.toml.example with Url::from_file_path documentation. Reproduce the failure using a relative signing-key path, then determine the expected path handling and error details; done means the configuration behaves as intended and reports the relevant parameter or underlying error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.