Skip to content

Improve Stable-RT kernel upgrade automation - #373

Merged
chaitu236 merged 2 commits into
ni:nilrt/master/scarthgapfrom
jatinjb444:kernel-upgrade
Aug 27, 2026
Merged

Improve Stable-RT kernel upgrade automation#373
chaitu236 merged 2 commits into
ni:nilrt/master/scarthgapfrom
jatinjb444:kernel-upgrade

Conversation

@jatinjb444

@jatinjb444 jatinjb444 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Changes

AB#4032155
Improve Stable-RT kernel upgrade automation
and add project documentation.

Testing

  • RT merge completed successfully
  • Kernel build completed successfully
  • Kernel installation completed successful
  • Kernel reboot validation passed
  • DKMS rebuild completed successfully

Process

  • Replace rebase-based sync with git reset
  • Prevent stale rebase state during merges
  • Improve stability of RT merge workflow
  • Add Stable-RT automation README
  • Document workflow and configuration
  • Add troubleshooting guidance
  • This PR should be cherry-picked to the next/ ref.

Suggested Reviewers:

  • @ni/rtos

Copilot AI lite review requested due to automatic review settings August 25, 2026 08:41
@jatinjb444
jatinjb444 marked this pull request as ready for review August 25, 2026 08:43
@jatinjb444
jatinjb444 requested a review from a team as a code owner August 25, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 JsonConfig initialization 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.

Comment thread scripts/dev/upstream_merge/json_config.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
Comment thread scripts/dev/upstream_merge/kernel_build_and_test.py
Comment thread scripts/dev/upstream_merge/README_kernel.md
Copilot AI review requested due to automatic review settings August 25, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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",

Comment thread scripts/dev/upstream_merge/README_kernel.md
Copilot AI review requested due to automatic review settings August 25, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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>
@jatinjb444
jatinjb444 requested a review from a team August 27, 2026 13:24
@chaitu236
chaitu236 merged commit 4858462 into ni:nilrt/master/scarthgap Aug 27, 2026
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.

4 participants