ci: add sync-params workflow #1812
ci: add sync-params workflow #1812paulsohn wants to merge 35 commits intoautowarefoundation:mainfrom
Conversation
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
fac6446 to
6db6848
Compare
| rev: v4.0.0-alpha.8 | ||
| hooks: | ||
| - id: prettier | ||
| args: [--no-error-on-unmatched-pattern] |
There was a problem hiding this comment.
memo: this aligns with autowarefoundation/sync-file-templates#56 .
|
@paulsohn This action looks very useful. I'm not sure if this is possible, but how about saving the original parameters as comments, like - some_list: [10, 20] # OVERRIDE: [1, 2]
+ some_list: [10, 20] # OVERRIDE: [1, 2, 3, 4] |
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
| max_object_size: 2.0 | ||
| override_class_with_unknown: false | ||
| fusion_enabled_classes: | ||
| UNKNOWN: true | ||
| CAR: false | ||
| BUS: false | ||
| TRUCK: false | ||
| TRAILER: false | ||
| MOTORCYCLE: false | ||
| BICYCLE: true | ||
| PEDESTRIAN: true |
There was a problem hiding this comment.
This is the only field breaking changes so far.
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| rev: v4.0.0-alpha.8 | ||
| hooks: | ||
| - id: prettier | ||
| args: [--no-error-on-unmatched-pattern] |
There was a problem hiding this comment.
.pre-commit-config.yaml is marked as automatically synced from autowarefoundation/sync-file-templates (see header). Local edits like adding Prettier args are likely to be overwritten by the sync workflow; apply this change in the template repo instead (or update whatever sync mechanism manages this file).
| args: [--no-error-on-unmatched-pattern] |
There was a problem hiding this comment.
This should be actually merged with #1338 but currently no approvals are out there.
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Taeseung Sohn <taeseung.sohn@tier4.jp>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sasakisasaki
left a comment
There was a problem hiding this comment.
Tomorrow I'll continue my review. I guess I'll be understanding the behavior of the workflow tomorrow after doing some minor tests. Let me put a quick comment.
|
|
||
| - name: Create update PR | ||
| id: create-pr | ||
| uses: peter-evans/create-pull-request@v7 |
There was a problem hiding this comment.
Personally, I prefer to use gh utility as like this workflow rather than using a third party workflow.
|
Still reviewing, Let me put a comment tomorrow again 🙏 |
Description
Introduce
sync-paramsworkflow that updates configurated*.param.yamlwith custom overrides.As described in
sync-params.yamlin this PR, the configuration goes like this.In this case, the python run with category
python3 ./.github/scripts/sync_params.py perceptionclones the upstream repository to a temp directory, copies source(autoware_universe)/perception/autoware_image_object_locator/config/bbox_object_locator.param.yamlto each variant path - in this case only(autoware_launch)/autoware_launch/config/perception/object_recognition/detection/camera_vru_detection/near_range_camera_vru_detector.param.yamlwith a comment header, and duplicates the original file content as a comment block at the bottom of theIn variant files, leaf fields (i.e. scalar or list of scalars) can be marked overridden by having a comment starting with
{OVERRIDE}or{OVERRIDE: reason to override}(the reason can be any text without newlines or braces). In this case, the marked leaf field is overlaid upon the original. So if you want to override a certain value, add# {OVERRIDE}or# {OVERRIDE: reason}comment (or prepend the existing one with it).Example
suppose the upstream param file looks like:
and the corresponding downstream variant:
now suppose the upstream param file changes:
then after syncing, the downstream will be:
Check mode
The check-params workflow runs
sync_params.py --check <category>on every PR. In check mode the script performs the same computation as update mode - cloning upstream, applying overrides, building the expected variant content - but writes nothing to disk, and exits non-zero if any variant has drifted from its expected state.Check mode uses the SHA pinned in each variant's header (the
# Source:line) rather than the current upstream HEAD. Upstream changes between the pinned SHA and HEAD are intentionally ignored, because those are the responsibility ofupdate-params. A freshly synced variant will always pass check mode until someone edits it by hand without going through the sync workflow.Rationales on designs
Q. Why do we have categories instead of bumping all param files at once?
perception / localization / etc have different codeowners, so one large PR updating all param files across all categories will need many approvals to sync. The exact granularity is a subject to change (e.g. we can have
perception/object_recognitionandperception/predictioncategories split instead of one largeperceptioncategory) but it is beyond the scope of this PR.Q. Why should we duplicate a full copy footer of the upstream param file?
This is for visibility of updates of overridden leaf fields.
We can of course sync upstream source to variants directly, without duplicating the original as a comment footer. However when the upstream changes a leaf field, then the syncing PR might be ignorant to the context of the upstream change because the diff is suppressed by overriding mechanism.
For example, if the upstream param file has a field
and the downstream overrides it
and later the upstream changes the field to
some_list: [1,2,3,4]because the list size should be four, the sync PR will be signaled that the upstream has been changed, but that exact diff is suppressed so the reviewer might not realize or forget that the override value should be updated to length-4 list e.g.[10, 20, 30, 40]. Having a local copy on this repository exposes the exact diff to the sync PR.TODOs before getting approval of this PR
python3 .github/scripts/sync_params.py --check perceptionfor this.Future works beyond the scope of this PR
How was this PR tested?
Notes for reviewers
Effects on system behavior
None.