Skip to content

toml file accepts multiple proxies#156

Merged
hayleigh-dot-dev merged 2 commits into
lustre-labs:mainfrom
chuckberrypi:proxies
Feb 8, 2026
Merged

toml file accepts multiple proxies#156
hayleigh-dot-dev merged 2 commits into
lustre-labs:mainfrom
chuckberrypi:proxies

Conversation

@chuckberrypi

Copy link
Copy Markdown
Contributor

Adds feature suggested in Issue #148. I tried maintaining the cli interface as suggested in the discussion there, but I could not figure out a way to do so without duplicating reads of the config toml.

@hayleigh-dot-dev hayleigh-dot-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey thanks for opening this! I've left some comments that need to be resolved, but mostly looks good!

Comment thread src/lustre_dev_tools/dev/proxy.gleam Outdated
// CONSTRUCTORS ----------------------------------------------------------------

pub fn new(from: String, to: String) -> Result(Proxy, Error) {
pub fn new(from: String, to: String) -> Result(Proxy, Nil) {

Copy link
Copy Markdown
Contributor

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 typechecks anymore, we're annotating that this returns Nil errors but it doesn't!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops! Changed

Comment thread src/lustre/dev.gleam Outdated
proxy_from(flags) |> result.unwrap(""),
proxy_to(flags) |> result.unwrap(""),
))
let proxies =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because we're throwing away the result here that means we no longer report when a config is invalid which seems like an easy way to confuse folks if they have a typo in their toml!

Reporting all the errors sounds a bit too complicated to tackle here but we should at least report the first problem and bail out here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed it so that the extraction function now returns an error.Error, and Ok([]) if no proxy is provided rather than an error like it did earlier.

Comment thread src/lustre_dev_tools/dev/proxy.gleam
@chuckberrypi

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I think the new changes should resolve your comments, but let me know if further tweaks are needed!

@hayleigh-dot-dev

Copy link
Copy Markdown
Contributor

Yeah this looks great, thank you!

@hayleigh-dot-dev hayleigh-dot-dev merged commit 6f85960 into lustre-labs:main Feb 8, 2026
@chuckberrypi chuckberrypi deleted the proxies branch February 8, 2026 18:37
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