Skip to content

[ci] Add explicit hardware marks and reusable pre-commit checks - #350

Open
yenuo26 wants to merge 3 commits into
ThinkFlowLab:mainfrom
yenuo26:codex/ci-hardware-platform-marks
Open

yenuo26 wants to merge 3 commits into
ThinkFlowLab:mainfrom
yenuo26:codex/ci-hardware-platform-marks

Conversation

@yenuo26

@yenuo26 yenuo26 commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Add a hardware-platform axis and explicit classification checks across Python tests, frontend unit files and browser journeys, without activating a reduced CI selection.

  • Register cpu, cuda, rocm, xpu and npu; explicitly tag current Python tests. Generic gpu, SKU and card-count marks are not supported.
  • Reject missing hardware marks, unknown marks and conflicting inherited classifications in a standard-library-only pre-commit checker. Runtime collection does not add marks. Existing unmarked-as-ready Python layer migration remains.
  • Add frontend/browser classification catalogs and selection/list commands. Preserve full default frontend execution, browser lane/fixture requirements and manual-only invocation rules.
  • Extract static checks into an independently dispatchable, reusable pre-commit.yml. Preserve static-before-heavy dependencies, documentation-only receipts and the stable release aggregate. Group supporting scripts under scripts/pre-commit/.
  • Keep development documentation bilingual and mark-check CLI output in English.

Latest main 526ece2a is merged, including #347 and #344. The documentation conflict preserves both security-scanning and classification guidance. Newly added Python, frontend and browser tests are registered with explicit CPU classifications; the new Markdown browser gate remains enabled.

Validation

On merge commit 3449083a:

  • Windows: 134 focused Python mark/profile/scope/aggregate/security cases passed, including ten real-file CLI scenarios covering valid inputs, missing/unknown/conflicting marks, partial parameter marks and catalog errors. Invalid cases return 1, valid input returns 0, and test bodies are not imported or executed.
  • Windows: 827 frontend unit tests passed. TypeScript --noEmit, mark/browser inventories, i18n, shared pre-commit checks (including actionlint), and staged diff checks passed.
  • WSL Python 3.12: 13 new text CLI/TestClient/listening-HTTP cases passed against the same local working-tree files. Windows execution of that subset was blocked by missing pillow_heif; the existing WSL environment supplied the application dependencies.

Full application pytest, browser UI/media journeys and real-provider acceptance were not run. Hosted Actions results remain to be checked. Windows Node 24.14.0 is older than the repository's pinned CI version.

Refs #273 (PR-4b, with cross-language classification and pre-commit workflow organization).

…and new scripts

- Added a pre-commit hook to check for explicit test marks in Python and JavaScript files.
- Updated `package.json` to include new test commands for unit tests and browser tests.
- Introduced `check_test_marks.py` for Python and `check-test-marks.mjs` for JavaScript to validate test classifications.
- Created `select_checks.py` to determine the scope of heavy checks based on the PR diff.
- Added new scripts for listing browser tests and running unit tests with specified layers and hardware.
- Updated `pyproject.toml` to register new pytest markers for hardware and CI layers.
- Enhanced documentation to reflect changes in test classification and validation processes.

Signed-off-by: wangyu <410167048@qq.com>
## summary

- Merge upstream CodeQL and Markdown text changes, preserving both
  security-scanning and cross-language classification documentation.
- Register CPU marks and frontend/browser catalog entries for the
  newly merged tests without changing their layer or gate behavior.

## validation

- 134 focused Python CI/security regression cases passed on Windows.
- 827 frontend unit tests passed; TypeScript and i18n checks passed.
- 13 text CLI cases passed in WSL against the local working tree.
- Shared pre-commit checks, actionlint and staged diff checks passed.

Refs: ThinkFlowLab#273
- Updated the `pre-commit.yml` workflow file to remove bilingual descriptions from the outputs, simplifying the language to English only for clarity.
- Adjusted the names of the output parameters to maintain consistency and improve readability.

No functional changes were made to the workflow logic.

Signed-off-by: wangyu <410167048@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci Continuous integration and checks type:ci Build, test and release automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant