Skip to content
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

feat!: change protobuf definitions #26

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

feat!: change protobuf definitions #26

wants to merge 4 commits into from

Conversation

airkei
Copy link
Contributor

@airkei airkei commented Jan 8, 2025

Why

https://tier4.atlassian.net/browse/RT4-13461
This PR is a part of protobuf support, this PR changes the protobuf definitions which will be used between ota-client and otaclient-iot-logging-server.
The initial implementation was merged in #23. This protobuf is still not used/released at the moment, thus safe to change without taking care of the backward compatibility.

What

  • add protobut package job in the release pipeline
  • change the protobuf definitions
  • copy the generated code under src/otaclient_iot_logging_server/v1/

Test

No test because this PR just changes the protobuf, doesn't change the behavior at all.

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/otaclient_iot_logging_server
   __init__.py30100% 
   __main__.py18194%49
   _common.py150100% 
   _log_setting.py271062%63, 65–66, 68–69, 73–74, 77–78, 80
   _sd_notify.py33875%42, 52, 57–59, 65–67
   _utils.py54296%73, 137
   _version.py80100% 
   aws_iot_logger.py1015545%65–67, 69–72, 75, 81–87, 90–92, 95–100, 104–107, 111–113, 116–118, 121–126, 139, 145–147, 149–153, 157, 197, 204–207
   boto3_session.py35974%50, 58–59, 61, 76–77, 81, 83, 91
   config_file_monitor.py44686%64–66, 83–85
   configs.py45197%74
   ecu_info.py37197%75
   greengrass_config.py97594%155, 266–269
   log_proxy_server.py441272%52, 77–79, 88–90, 92, 94–95, 100, 106
TOTAL56111080% 

Tests Skipped Failures Errors Time
44 0 💤 0 ❌ 0 🔥 11.197s ⏱️

@@ -59,7 +59,7 @@ proto_builds = [
[tool.black]
line-length = 88
target-version = [
'py38',
'py311',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noticed that otaclient-iot-logging-server set the target version as python3.11, thus modified.

uint64 timestamp = 2;
LogLevel level = 3;
string data = 4;
string ecu_id = 1; // target ECU ID
Copy link
Contributor Author

@airkei airkei Jan 8, 2025

Choose a reason for hiding this comment

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

ecu_id is necessary as input because it is used to set log stream.

@@ -14,7 +14,7 @@

syntax = "proto3";

service OtaClientLoggingService {
service OtaClientIoTLoggingService {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed.

@airkei airkei requested a review from Bodong-Yang January 8, 2025 08:24
@airkei airkei marked this pull request as ready for review January 8, 2025 08:24
@airkei airkei force-pushed the feat/fix_protobuf branch from 6a76b9f to 1773302 Compare January 9, 2025 00:18
@airkei airkei changed the title feat: change protobuf definitions feat!: change protobuf definitions Jan 9, 2025
@airkei airkei force-pushed the feat/fix_protobuf branch from 1773302 to af04d59 Compare January 9, 2025 06:53
Comment on lines +37 to +39
string ecu_id = 1; // target ECU ID
LogType log_type = 2; // log type
string message = 3; // log message
Copy link
Contributor Author

@airkei airkei Jan 9, 2025

Choose a reason for hiding this comment

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

At first, try to include level and timestamp fields.
But reconsider that it will be better to handle them in ota-client side(= otaclient-iot-logging-server doesn't care about log contents, level, and timestamp at all).
So removed these fields.
This realizes to change log format as necessary in ota-client without changing this repo.
What do you think?

@airkei airkei requested a review from Zhenfeng-Sun January 14, 2025 02:02
Comment on lines +33 to +38
- name: Build otaclient IoT logging server proto package
run: |
pushd proto
hatch build -t wheel
popd
cp proto/dist/*.whl dist
Copy link
Contributor Author

Choose a reason for hiding this comment

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

new part to build protobuf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

copied these files as v1 like ota-client.

@airkei airkei force-pushed the feat/fix_protobuf branch from af04d59 to 5c597d2 Compare January 28, 2025 06:25
@airkei airkei requested a review from a team as a code owner January 28, 2025 06:25
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.

1 participant