openharmony-ci
OpenHarmony CI
Overview
Use the bundled script first. It resolves the latest DCP event from an OpenHarmony PR, summarizes per-job CI status, and fetches logs only for failed jobs unless explicitly told otherwise.
Permission Preflight
- Treat this workflow as network-required by default.
- Before running the bundled script for
--pr,--pr-url,--event-id, artifact paths, or CI log URLs, request network permission up front. - Mention the likely endpoints in the permission request when helpful: GitCode via
oh-gc,dcp.openharmony.cn, andcidownload.openharmony.cn. - Do not intentionally run a first attempt just to confirm that network is required. The failure is usually predictable from the workflow itself.
Primary Path
Run the bundled script:
python3 scripts/openharmony_ci.py --pr <pr_number> --repo <repo>
The script sets XDG_CACHE_HOME=/tmp/openharmony-ci-cache for oh-gc by default so it does not try to write under ~/.cache in sandboxed environments. If you already need a different cache location, set XDG_CACHE_HOME before invoking the script and the script will respect it.
Supported inputs:
--pr <number>--pr-url <gitcode_pr_url>--event-id <dcp_event_id>
Useful flags:
--log-mode autoOnly fetch logs for failed jobs. This is the default and should remain the normal mode.--log-mode neverStatus only.--log-mode alwaysFetch logs for every job that exposes artifacts or log links.--jsonMachine-readable output.--download-dir <dir>Save downloaded log archives/files locally.
Expectations
- Prefer
--pror--pr-urlwhen the task starts from a GitCode PR. - The script reads
openharmony_cicomments withoh-gc, extracts the newest DCP event id, then queries DCP APIs. - In sandboxed or restricted environments, request network access before invoking the script because the primary path depends on external services.
- In restricted environments, prefer the bundled script over raw
oh-gccalls because it already redirects theoh-gccache to a writable temporary directory. - Judge pass/fail from DCP event data, not labels alone.
- If there are multiple failed jobs, report all of them.
- Treat jobs with a start time but no end result as
running, not failed. - On failures, follow artifact listings to logs automatically.
build.logmay redirect to another URL, andbuild.log.zipmay actually be a tar archive. - In the final answer, report both the DCP
overallresult and the per-job failures. Ifoverall=successbut some jobs are markedskiporfailed, say that explicitly instead of flattening it into a single verdict. - If a failed job shows
skip buildor a similar reason, include that reason verbatim and avoid implying that the whole PR failed unless the DCP overall result is also failed.
Fallback
If the script cannot be used, fall back to the manual workflow:
- Extract the DCP event id from the latest
openharmony_cibuild-start comment. - Query
https://dcp.openharmony.cn/api/codecheckAccess/ci-portal/v1/event/<event_id>. - If a failed job has
Artifacts, queryhttps://dcp.openharmony.cn/api/dataService/ci-portal/v1/files?directoryUrl=<ArtifactsPath>. - Download the chosen log from
https://cidownload.openharmony.cn/<path>.
Quick Examples
python3 scripts/openharmony_ci.py --pr 82764 --repo openharmony/arkui_ace_engine
python3 scripts/openharmony_ci.py --pr-url 'https://gitcode.com/openharmony/arkui_ace_engine/pull/82764' --json
python3 scripts/openharmony_ci.py --event-id 69c51ede64650f998b1d01a4 --log-mode auto
XDG_CACHE_HOME=/tmp/custom-oh-gc-cache python3 scripts/openharmony_ci.py --pr 82764 --repo openharmony/arkui_ace_engine
More from openharmonyinsight/openharmony-skills
openharmony-cpp
Expert coding guide for OpenHarmony C++ development. Use this skill when writing, refactoring, or reviewing C++ code for OpenHarmony projects. It enforces strict project-specific conventions (naming, formatting, headers) and critical security requirements (input validation, memory safety).
77openharmony-security-review
Use when reviewing OpenHarmony C++ system service code for security vulnerabilities, particularly IPC handlers, multithreaded components, or code handling sensitive user data
77oh-ut-generator
|
65cpp-core-guidelines-review
Parallel C++ Core Guidelines code review using multiple specialized sub-agents. Use when reviewing C++ code, modules, or files against C++ Core Guidelines to identify violations. Each sub-agent reviews against a specific guideline section (Functions, Classes, Resource Management, etc.) and outputs findings to separate markdown files in the review/ directory, followed by a consolidated summary.
59ohos-chromium-security-review
|
55openharmony-build
This skill should be used when the user asks to "编译 OpenHarmony", "build OpenHarmony", "编译完整代码", "执行编译", "编译 OpenHarmony 代码", "快速编译", "跳过gn编译", "fast-build", "编译测试", "编译测试用例", "build ace_engine_test", "编译 sdk", "编译 SDK", "build sdk", "build SDK", "编译 ohos-sdk", "编译测试列表", "build test list", "按列表编译测试", "编译指定测试", or mentions building the full OpenHarmony system, fast rebuild, test compilation, SDK compilation, or building tests from a target list. Handles complete build process including build execution, success verification, and failure log analysis with primary focus on out/{product}/build.log.
55