Skip to content

Translator from pxu to yaml (New)#2316

Open
Hook25 wants to merge 14 commits intomainfrom
translator_pxu_yaml
Open

Translator from pxu to yaml (New)#2316
Hook25 wants to merge 14 commits intomainfrom
translator_pxu_yaml

Conversation

@Hook25
Copy link
Collaborator

@Hook25 Hook25 commented Feb 2, 2026

Description

With this PR we introduce a new migration tool to translate PXUs to YAML. This already translates the unit with the new schema, which will be formalized (and bugfixed probably) in a followup PR.

Support for comments is best effort. All inline comments should be supported. Header comments are supported. Comments on the top level (unindented commets) are not supported. Untranslatable comments yield a warning.

Jinja support is best effort. Jinja blocks the translation of fields, all fields that contain jinja template are translated as is. Given that jinja can technically modify the semantics (keys) of pxus, the translator, even dumping fields as they are, may break units. All jinja fields yield a warning.

The following fields are unchanged, lines with . are reduced to "" as that is the semantic of them:

  • description
  • description
  • summary
  • purpose
  • steps
  • prompt
  • hidden-reason
  • verification
  • template-summary

The following fields are now objects, no longer raw json (although json is an option, yaml > json)

  • data
  • siblings

The following fields are now a list:

  • environ
  • flags
  • after
  • salvages
  • depends
  • before
  • setup_include
  • include
  • bootstrap_include
  • nested_part
  • exclude
  • mandatory_include
  • requires
  • template-imports
  • imports
  • template-filter
  • certification_status_overrides
  • options

Inline overrides (which are effectively annotations in inclusions) are translated as such:

pxu:

include:
    job-baz certification-status=blocker

yaml:

include:
  - job-baz:
      certification-status: blocker

Resolved issues

Fixes: CHECKBOX-1393

Documentation

Documentation of the new schema is not part of this PR. All decisions takes are documented in line in the code.

Tests

Translator is tested

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 87.86408% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.41%. Comparing base (1040ed4) to head (ecfb150).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
checkbox-ng/checkbox_ng/launcher/translator.py 87.80% 17 Missing and 8 partials ⚠️

❌ Your patch check has failed because the patch coverage (87.86%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2316      +/-   ##
==========================================
+ Coverage   55.24%   55.41%   +0.17%     
==========================================
  Files         413      414       +1     
  Lines       44448    44675     +227     
  Branches     8194     8259      +65     
==========================================
+ Hits        24556    24758     +202     
- Misses      19032    19045      +13     
- Partials      860      872      +12     
Flag Coverage Δ
checkbox-ng 71.94% <87.86%> (+0.24%) ⬆️
checkbox-support 70.89% <ø> (ø)
provider-base 32.17% <ø> (ø)
provider-certification-client 57.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Hook25 Hook25 force-pushed the translator_pxu_yaml branch from a289b1d to bb9e0f4 Compare February 3, 2026 11:47
These fields are not supposed to be changed, must be transferred over as
is
@Hook25 Hook25 force-pushed the translator_pxu_yaml branch from bb9e0f4 to 301b54d Compare February 3, 2026 13:30
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