prplos/.gitlab/scripts
Petr Štetiar fe9c778e77 ci: scripts: add YAML manifest loader and package_apply subcommand
Currently testbed-cdrouter.py only supports importing packages from
opaque .gz binary exports via the package_import subcommand. This
requires staging, committing, and name-patching through the CDRouter
import API, and provides no way to define packages as readable,
version-controlled YAML.

So lets add a resolve_manifest() method that loads YAML package
manifests with full include resolution and a package_apply
subcommand that upserts packages on the CDRouter instance via the
packages API.

The manifest resolver has strict validation:
  - Key allowlist (name, description, includes, tests, options,
    dedup_tests); unknown keys are rejected
  - Forbidden keys (config, device, config_id, device_id)
  - Root manifest name must match its filename
  - Group manifests (under groups/) must not define name,
    description, or options
  - Type checks on all fields

Include resolution uses depth-first traversal with cycle
detection, path traversal rejection, and root-wins option merge.
Test deduplication is configurable via the root-only dedup_tests
boolean (defaults to false, preserving duplicates). Non-root
manifests (both includes and groups) must not define dedup_tests.

The package_apply subcommand performs deterministic upserts:
it always writes the complete manifest-driven state (testlist,
description, options) and only creates a new package on genuine
not-found errors from the CDRouter API.

Runtime config/device binding remains in the existing package_run
flow, keeping package manifests environment-agnostic.

References: PCF-2532
Assisted-by: codex:gpt-5.4:xhigh
Assisted-by: claude:opus-4-6:1m-context
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2026-04-21 16:00:15 +01:00
..
build.d ci: build: enable exception tracing on arm64 targets 2025-07-31 10:36:01 +00:00
dut-init ci: cdrouter: cram: update ProcessMonitor FailAction to RESTART if it is set to REBOOT (PPW-1234) 2026-03-23 09:25:41 +00:00
prplMesh scripts: prplmesh: bump easymesh certification test revision 2026-03-06 15:31:11 +01:00
cdrouter-package-convert.py ci: scripts: add CDRouter .gz to YAML package converter 2026-04-21 16:00:15 +01:00
cdrouter-pretty-failures.awk
helpers.sh ci: testbed,cdrouter: improve error visibility with colored logging 2025-11-07 06:00:20 +00:00
prpl-jira.py
README.md
requirements.txt
testbed-cdrouter.py ci: scripts: add YAML manifest loader and package_apply subcommand 2026-04-21 16:00:15 +01:00
testbed-device.py ci: testbed: fix UnicodeDecodeError in console log dump 2026-04-21 16:00:15 +01:00

Content

This directory contains files used mainly during testing on the GitLab CI.

requirements.txt

This requirements.txt file is used for specifying what Python packages are required to run the scripts in this directory. Usually used with pip install -f requirements.txt command.

prpl-jira.py

This helper Python script creates new or updates existing Jira ticket when something goes wrong during GitLab CI testing process. Currently only supports reporting of build test failures.

Needs Python version 3.6+ due to use of f-strings feature.

testbed-device.py

This helper Python scripts allows managing of device under test (DUT) via labgrid framework.