-
Notifications
You must be signed in to change notification settings - Fork 4
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
refine(v3.7.x): refactor proxy_info.yaml and ecu_info.yaml config files parsing #286
Conversation
if bootloader_type is BootloaderType.AUTO_DETECT: | ||
bootloader_type = detect_bootloader() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: BootloaderType.UNSPECIFIC
is renamed to AUTO_DETECT
for better understanding. But AUTO_DETECT
is deprecated and should not be used in the future.
otaclient/app/log_setting.py
Outdated
# NOTE(20240306): for only god knows reason, although in proxy_info.yaml, | ||
# the logging_server field is assigned with an URL, and otaclient | ||
# expects an URL, the run.sh from autoware_ecu_system_setup pass in | ||
# HTTP_LOGGING_SERVER with URL schema being removed!? | ||
# NOTE: I will do a quick fix here as I don't want to touch autoware_ecu_system_setup | ||
# for now, leave it in the future. | ||
if iot_logger_url := os.environ.get("HTTP_LOGGING_SERVER"): | ||
# special treatment for not-a-URL passed in by run.sh | ||
# note that we only support http, the proxy_info.yaml should be properly setup. | ||
if not (iot_logger_url.startswith("http") or iot_logger_url.startswith("HTTP")): | ||
iot_logger_url = f"http://{iot_logger_url.strip('/')}" | ||
if iot_logger_url := str(proxy_info.logging_server): | ||
iot_logger_url = f"{iot_logger_url.strip('/')}/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: after we directly parse the logging_server
setting from proxy_info.yaml
, we don't need to read the environmental vars and the special treatment code can be removed.
Description
This PR refactors the implementation of
proxy_info.yaml
andecu_info.yaml
config files parsing. Now these two configs files are parsed and validated bypyyaml
andpydantic
. The implementation now also aligns with the documentation, see ecu_info.yaml specification and proxy_info.yaml specification for more details.Also, now the logic of parsing these two config files are separated from
otaclient.app
package and implemented atotaclient.config
package. For theotaclient
package levelconfig
package, see otaclient package scope configs infra for more details.Check list
Changes
Behavior changes
Does this PR introduce behavior change(s)?
Breaking change
Does this PR introduce breaking change?
Related links & tickets