fix(reload): store paths to config files #1214

Merged
ginger merged 1 commit from oddlid/continuwuity:reload-fix into main 2025-12-17 19:52:30 +00:00
Contributor

Paths given via --config are now stored inside the config struct at
runtime, to make it possible to reload config without setting an env
var for the config file location.

Paths given via --config are now stored inside the config struct at runtime, to make it possible to reload config without setting an env var for the config file location.
fix(reload): WIP - store paths to config files
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m10s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 12m9s
4d74abe832
Paths given via --config are now stored inside the config struct at
runtime, to make it possible to reload config without setting an env
var for the config file location.
Author
Contributor

This is working now with my latest changes. I've built and run it locally to verify.
I rebased on main before I pushed, which seems to have messed up the display of what's really happened here a bit. Is there anything I should do about that?

This is working now with my latest changes. I've built and run it locally to verify. I rebased on main before I pushed, which seems to have messed up the display of what's really happened here a bit. Is there anything I should do about that?
oddlid force-pushed reload-fix from 0b4bf89a2e
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m18s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 8m1s
to 84a5283b8d
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Failing after 1m29s
Checks / Prek / Clippy and Cargo Tests (pull_request) Failing after 5m3s
2025-12-07 21:26:27 +00:00
Compare
fix(reload): Clippy adjustments
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m27s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m35s
51f62d1c4f
Jade approved these changes 2025-12-09 11:35:23 +00:00
Dismissed
Jade left a comment
Owner

This looks pretty much good to me!

This looks pretty much good to me!
src/main/clap.rs Outdated
@ -23,0 +22,4 @@
#[arg(
short,
long,
env = "CONDUIT_CONFIG",
Owner

I'm not entirely sure this is necessary or how it interacts with the order of config merges? Might belong as a separate change

I'm not entirely sure this is necessary or how it interacts with the order of config merges? Might belong as a separate change
Author
Contributor

It’s not necessary. I just added it for consistency. But if my assumptions are correct, adding this here, could enable us to remove the env merging in Config::load, since any of these env vars would now result in the —config option being set.
But yeah, maybe it’s better to have it in another PR that adds these env vars to clap and removes the merging in Config::load. Or I could add that too to this PR. You decide how you want it, and if you want to split it, I can adjust and make another PR.

It’s not necessary. I just added it for consistency. But if my assumptions are correct, adding this here, could enable us to remove the env merging in Config::load, since any of these env vars would now result in the —config option being set. But yeah, maybe it’s better to have it in another PR that adds these env vars to clap and removes the merging in Config::load. Or I could add that too to this PR. You decide how you want it, and if you want to split it, I can adjust and make another PR.
Author
Contributor

As for the order of config merges, it’s now sorted alphabetically in the reload admin command, with duplicate files removed, since I discovered that they would add up on each reload otherwise (if a file argument was given in the reload command).
Given reload on SIGUSR1, the file list stays the same, and no filtering should be needed. There still is a way to have duplicate files though, if they’re given at startup in duplicate ways through either/or cli flags and/or env vars. So if you send SIGUSR1 with such a list, the config merging will go through the same files several times. This is as it was since before.
Maybe we should look into filtering out duplicates in all code paths?

As for the order of config merges, it’s now sorted alphabetically in the reload admin command, with duplicate files removed, since I discovered that they would add up on each reload otherwise (if a file argument was given in the reload command). Given reload on SIGUSR1, the file list stays the same, and no filtering should be needed. There still is a way to have duplicate files though, if they’re given at startup in duplicate ways through either/or cli flags and/or env vars. So if you send SIGUSR1 with such a list, the config merging will go through the same files several times. This is as it was since before. Maybe we should look into filtering out duplicates in all code paths?
nex added this to the 0.5.0 milestone 2025-12-10 21:51:25 +00:00
oddlid force-pushed reload-fix from a15083efd2
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Has been cancelled
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
to 894eb47862
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m28s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 5m43s
2025-12-15 15:27:10 +00:00
Compare
Author
Contributor

I’ve now cleaned up and squashed. Please have another look, and if you’re satisfied, go ahead and merge. We can look more into issues discussed outside this scope later :)

I’ve now cleaned up and squashed. Please have another look, and if you’re satisfied, go ahead and merge. We can look more into issues discussed outside this scope later :)
oddlid requested review from Jade 2025-12-15 15:55:57 +00:00
oddlid force-pushed reload-fix from 894eb47862
All checks were successful
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 2m28s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 5m43s
to 867d0ab671
Some checks failed
Documentation / Build and Deploy Documentation (pull_request) Has been skipped
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m27s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m44s
Documentation / Build and Deploy Documentation (push) Successful in 52s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m47s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 6m50s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 6m55s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 17m0s
Release Docker Image / Build linux-amd64 (max-perf) (push) Successful in 13m59s
Release Docker Image / Build linux-arm64 (max-perf) (push) Successful in 14m7s
Release Docker Image / Create Max-Perf Manifest (push) Failing after 10s
Release Docker Image / Create Multi-arch Release Manifest (push) Failing after 8s
2025-12-16 14:58:35 +00:00
Compare
Jade approved these changes 2025-12-16 15:10:36 +00:00
Jade left a comment
Owner

Looks good to me :)

Looks good to me :)
nex approved these changes 2025-12-17 19:51:58 +00:00
ginger merged commit 867d0ab671 into main 2025-12-17 19:52:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity!1214
No description provided.