Skip to content

ci: novatek: narrow to the legs a change can reach - #217

Merged
widgetii merged 1 commit into
openipcfrom
ci/novatek-owners
Nov 27, 2026
Merged

widgetii merged 1 commit into
openipcfrom
ci/novatek-owners

Conversation

@widgetii

Copy link
Copy Markdown
Member

Follow-up to #215: an owners table for novatek's 20 legs, like the one hisilicon has.

Each leg owns:

  • its fragment and device tree;
  • nand_config, for the -nand legs;
  • its image packer;
  • the board directory make olddefconfig resolves: na51089 for the NA51089, NA51055 and NS02501 legs alike, na51068, and na511xx for the NVR legs;
  • its die's board/novatek/<die>/, whose loader/ is built for it by build_loader.

ci-select.py now follows the /include/s of a claimed device tree. A -nand tree pulls in its NOR tree and nvt-nand.dtsi, and every tree pulls in its die's .dtsi.

Replayed over the last 40 openipc-novatek commits:

  • 3 build 2 legs instead of 20: the NS02501 loader twice, the NA51084 one once.
  • 3 more build fewer legs.
  • 6 are docs-only and already build nothing since ci: build only the legs a change can reach #215.
  • The rest widen to every leg, because they touch build.sh, arch/arm/mach-novatek, drivers or novatek.h.

I left sigmastar without a table. Every leg shares its board, header and mach-sigmastar, and the same replay narrowed 0 of 40 commits, so a table there would be maintenance for nothing.

Checked: --self-test passes for novatek, hisilicon and sigmastar.

The `owners` table build-hisilicon.yml has, for novatek's 20 legs. Each
leg owns its fragment and device tree, nand_config for the -nand legs,
its image packer, the board directory `make olddefconfig` resolves
(na51089 for the NA51089, NA51055 and NS02501 legs alike, na51068,
na511xx for the NVR ones), and its die's board/novatek/<die>/, whose
loader/ build_loader builds for it.

ci-select.py follows a claimed device tree's /include/s, so the -nand
trees bring in their NOR tree and nvt-nand.dtsi, and every tree its
die's .dtsi.

Replayed over the last 40 openipc-novatek commits, 3 build 2 legs
instead of 20 (the NS02501 loader twice, the NA51084 one once) and 3
more drop some legs; 6 were docs only, which build nothing already.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Narrow Novatek CI builds to affected legs

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Assign Novatek’s 20 build legs their board, configuration, device-tree, and image-packer
 dependencies.
• Follow device-tree includes so changes to shared trees select every affected leg.
• Preserve full builds for unclaimed paths, avoiding missed coverage when ownership is unknown.
Merge Risk 🟡 Medium

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed owner table and selector jointly determine which Novatek build artifacts and smoke tests run; the workflow consumes these matrices as one bounded validation capability rather than separate technical layers.
Sources

.github/scripts/ci-select.py[118-130]

def dts_closure(src, path):
    """A device tree and every file it reaches through /include/ (or
    #include) "...", relative to its directory: nt98560-nand.dts pulls in
    nt98560.dts and nvt-nand.dtsi, nt98560.dts pulls in na51089.dtsi."""
    seen, todo = set(), [path]
    while todo:
        rel = os.path.normpath(todo.pop())
        if rel in seen or not os.path.isfile(os.path.join(src, rel)):
            continue
        seen.add(rel)
        with open(os.path.join(src, rel), errors="replace") as handle:
            todo += [os.path.join(os.path.dirname(rel), inc)
                     for inc in DTS_INCLUDE.findall(handle.read())]

.github/ci/novatek.yml[63-75]

# What only some legs build, from which a change narrows to those legs.
# Every leg shares include/configs/novatek.h, arch/arm/mach-novatek and
# openipc_config, so those (and anything else not named here) reach every
# leg.
#   board: U-Boot's board directory, CONFIG_SYS_VENDOR/SYS_BOARD after
#          `make olddefconfig`: na51089 for the NA51089, NA51055 and
#          NS02501 legs alike, na51068, na511xx for the NVR legs
#   paths: the SoC's fragment and device tree (with what it /include/s:
#          the die's .dtsi, the NOR tree and nvt-nand.dtsi for -nand),
#          nand_config for the -nand legs, the image packer, and the die's
#          board/novatek/<die>/, whose loader/ build_loader builds for the
#          leg (a die directory that is also a U-Boot board, na51089,
#          over-claims: it costs legs, never coverage)
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before, ownership handled explicitly listed paths; after, each DTS/DTSI claim also expands through recursively discovered relative includes.
  • The new correctness condition is that include-graph traversal, path normalization, and owner aggregation select every affected leg without widening unrelated legs.
  • The owner table also introduces shared board and image-packer claims across multiple Novatek legs, so shared-path aggregation must remain consistent.
Sources

.github/scripts/ci-select.py[118-130]

def dts_closure(src, path):
    """A device tree and every file it reaches through /include/ (or
    #include) "...", relative to its directory: nt98560-nand.dts pulls in
    nt98560.dts and nvt-nand.dtsi, nt98560.dts pulls in na51089.dtsi."""
    seen, todo = set(), [path]
    while todo:
        rel = os.path.normpath(todo.pop())
        if rel in seen or not os.path.isfile(os.path.join(src, rel)):
            continue
        seen.add(rel)
        with open(os.path.join(src, rel), errors="replace") as handle:
            todo += [os.path.join(os.path.dirname(rel), inc)
                     for inc in DTS_INCLUDE.findall(handle.read())]

.github/ci/novatek.yml[63-75]

# What only some legs build, from which a change narrows to those legs.
# Every leg shares include/configs/novatek.h, arch/arm/mach-novatek and
# openipc_config, so those (and anything else not named here) reach every
# leg.
#   board: U-Boot's board directory, CONFIG_SYS_VENDOR/SYS_BOARD after
#          `make olddefconfig`: na51089 for the NA51089, NA51055 and
#          NS02501 legs alike, na51068, na511xx for the NVR legs
#   paths: the SoC's fragment and device tree (with what it /include/s:
#          the die's .dtsi, the NOR tree and nvt-nand.dtsi for -nand),
#          nand_config for the -nand legs, the image packer, and the die's
#          board/novatek/<die>/, whose loader/ build_loader builds for the
#          leg (a die directory that is also a U-Boot board, na51089,
#          over-claims: it costs legs, never coverage)
Potential damage 🟡 Medium 🩹 Recoverable

  • If the selector under-selects a required leg, CI can pass without validating an affected Novatek artifact; if it over-selects, validation remains broader than necessary.
  • Reverting the selector and rerunning CI restores validation coverage, with no firmware state or external device effect established.
  • Code rollback stops future misselection; affected commits require a rerun of the omitted build or smoke legs.
  • No automatic repair of missed validation is shown.
Sources

.github/scripts/ci-select.py[118-130]

def dts_closure(src, path):
    """A device tree and every file it reaches through /include/ (or
    #include) "...", relative to its directory: nt98560-nand.dts pulls in
    nt98560.dts and nvt-nand.dtsi, nt98560.dts pulls in na51089.dtsi."""
    seen, todo = set(), [path]
    while todo:
        rel = os.path.normpath(todo.pop())
        if rel in seen or not os.path.isfile(os.path.join(src, rel)):
            continue
        seen.add(rel)
        with open(os.path.join(src, rel), errors="replace") as handle:
            todo += [os.path.join(os.path.dirname(rel), inc)
                     for inc in DTS_INCLUDE.findall(handle.read())]

.github/ci/novatek.yml[63-75]

# What only some legs build, from which a change narrows to those legs.
# Every leg shares include/configs/novatek.h, arch/arm/mach-novatek and
# openipc_config, so those (and anything else not named here) reach every
# leg.
#   board: U-Boot's board directory, CONFIG_SYS_VENDOR/SYS_BOARD after
#          `make olddefconfig`: na51089 for the NA51089, NA51055 and
#          NS02501 legs alike, na51068, na511xx for the NVR legs
#   paths: the SoC's fragment and device tree (with what it /include/s:
#          the die's .dtsi, the NOR tree and nvt-nand.dtsi for -nand),
#          nand_config for the -nand legs, the image packer, and the die's
#          board/novatek/<die>/, whose loader/ build_loader builds for the
#          leg (a die directory that is also a U-Boot board, na51089,
#          over-claims: it costs legs, never coverage)
Assessed commit d6337a8
Diagram

graph TD
  A["Changed paths"] --> B{"No-build paths?"}
  B -->|No| C["Novatek owners"] --> D["Device-tree closure"] --> E{"Owner found?"} -->|Yes| F["Selected build legs"]
  B -->|Yes| G["No build"]
  E -->|No| H["All build legs"]
Loading
High-Level Assessment

Extend the existing ownership-based selector rather than add a separate Novatek selection mechanism. Keeping unclaimed paths on the full-build path prioritizes coverage; always building all 20 legs would forgo the demonstrated narrowing.

Files changed (2) +180 / -2

Enhancement (1) +23 / -2
ci-select.pyInclude transitive device-tree dependencies in ownership +23/-2

Include transitive device-tree dependencies in ownership

• Adds recursive resolution of quoted /include/ and #include directives for claimed device trees. Included files become ownership claims, so changes to a die’s DTSI or a NAND tree’s NOR and NAND includes select the dependent legs.

.github/scripts/ci-select.py

Other (1) +157 / -0
novatek.ymlDeclare ownership for all 20 Novatek build legs +157/-0

Declare ownership for all 20 Novatek build legs

• Adds per-leg claims for configuration fragments, device trees, image packers, resolved U-Boot board directories, and applicable die directories. NAND legs additionally claim nand_config, allowing changes to these paths to select affected legs instead of the full matrix.

.github/ci/novatek.yml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit 369bfe1 into openipc Nov 27, 2026
451 of 453 checks passed
@widgetii
widgetii deleted the ci/novatek-owners branch November 27, 2026 16: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