Page MenuHomePhabricator

[reports-service] Add basic config
ClosedPublic

Authored by bartek on Aug 18 2023, 12:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 3:48 PM
Unknown Object (File)
Sun, Oct 27, 3:48 PM
Unknown Object (File)
Sun, Oct 27, 3:48 PM
Unknown Object (File)
Sun, Oct 27, 3:42 PM
Unknown Object (File)
Oct 11 2024, 7:46 PM
Unknown Object (File)
Sep 30 2024, 3:22 PM
Unknown Object (File)
Sep 27 2024, 11:57 PM
Unknown Object (File)
Sep 26 2024, 1:52 PM
Subscribers

Details

Summary

Added standard config for localstack, logging and listening port for reports service, the same way as we do for other services.

Depends on D8864

Test Plan

cargo run, checked if cli args and localstack environment variable work

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Aug 18 2023, 6:53 AM
jon added inline comments.
services/reports/src/config.rs
18–28

As time goes on, I feel like this is anti-pattern. It's just convenient to have a global CONFIG which you can fetch anywhere some setting out of thin air. But really, I think we should just be parsing this in main and passing the respective configuration values to the part of the code which cares about them.

For example:

let cmd_args = config::AppConfig::parse()?;
let aws_config = config::load_aws_config(cmd_args.localstack_endpoint);
start_webserver(cmd_args.http_port, &aws_config);

Since this is already an established norm, I'm not going to block on it though.

This revision is now accepted and ready to land.Aug 18 2023, 1:06 PM

I agree with @jon, this was slightly confusing to me at the beginning when I started working on the services.

This revision was automatically updated to reflect the committed changes.