Improve Stable-RT kernel upgrade automation - #373
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to improve the Stable-RT kernel upgrade automation flow (notably the branch sync strategy) and adds detailed operator documentation for running the automation.
Changes:
- Replace rebase-based branch syncing with a hard reset to the remote branch to avoid stale rebase state.
- Simplify
JsonConfiginitialization and adjust the automation entrypoint accordingly. - Add a comprehensive Stable-RT automation README covering workflow, configuration, and troubleshooting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
scripts/dev/upstream_merge/README_kernel.md |
Adds end-to-end documentation for the Stable-RT kernel upgrade automation workflow and configuration. |
scripts/dev/upstream_merge/kernel_build_and_test.py |
Updates sync logic from rebase/pull to fetch+reset; tweaks PR description composition and config initialization. |
scripts/dev/upstream_merge/json_config.py |
Changes JsonConfig constructor and configuration fields used by the automation scripts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
4d418e4 to
c5f0720
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
scripts/dev/upstream_merge/json_config.py:12
- JsonConfig.init no longer accepts the work_item_id argument, but scripts/dev/upstream_merge/upstream_merge_and_test.py still calls JsonConfig(..., work_item_id=...). This will raise a TypeError at runtime; keep backward compatibility by making work_item_id an optional parameter.
def __init__(self, automation_conf_path):
scripts/dev/upstream_merge/json_config.py:53
- JsonConfig no longer sets self.work_item_id, but upstream_merge_and_test.py later reads json_config_obj.work_item_id when generating PR descriptions. This will raise an AttributeError at runtime; store the resolved work_item_id on the config object (preferring the explicitly passed value, falling back to the JSON file).
self.build_user = kernel_config.get("build_user") or self.build_host_user
self.pr_target_branch = config.get(
"pr_target_branch", self.target_branch)
self.ssh_target = kernel_config.get("ssh_target")
scripts/dev/upstream_merge/README_kernel.md:229
- The README's example automation_conf.json places kernel build settings (target_branch/kernel_src_dir/etc.) at the top level, but JsonConfig reads them from the nested "kernel_build" object. As written, the example config would leave kernel_build empty and the script will fail (e.g., os.path.abspath(None) for kernel_src_dir). Update the example to match the actual schema.
```json
{
"target_branch": "nilrt/master/6.18",
"kernel_src_dir": "/home/user/kernel-build/linux",
"arch": "x86_64",
c5f0720 to
98e9348
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scripts/dev/upstream_merge/json_config.py:16
- JsonConfig.init no longer accepts/sets work_item_id, but upstream_merge_and_test.py still calls JsonConfig(..., work_item_id=...) and later reads json_config_obj.work_item_id. This will raise a TypeError/AttributeError at runtime; keep backward compatibility by making work_item_id optional and storing it on the config object (falling back to the JSON value when not provided).
def __init__(self, automation_conf_path):
with open(automation_conf_path, "r", encoding="utf-8") as file:
config = json.load(file)
self.nilrt_branch = config.get("nilrt_branch")
self.meta_nilrt_branch = config.get("meta_nilrt_branch")
scripts/dev/upstream_merge/README_kernel.md:70
- The initial ```text code block (Target Branch / Working Branch example) is missing a closing fence, so the subsequent sections are rendered as part of the code block in Markdown. Close the code block immediately after the example output.
rt-merge-6.18
---
# CONFIGURATION FILE: `automation_conf.json`
Replace rebase-based branch sync with hard reset to origin state. Remove use of git pull --rebase before RT merge operations. Prevent stale rebase state from causing merge conflicts during automation execution. Signed-off-by: Jatin <jatin.bharti@emerson.com>
Add README for Stable-RT kernel upgrade automation. Document automation motivation and design goals. Describe end-to-end workflow from RT merge to validation. Signed-off-by: Jatin <jatin.bharti@emerson.com>
Changes
AB#4032155
Improve Stable-RT kernel upgrade automation
and add project documentation.
Testing
Process
next/ref.Suggested Reviewers: