Skip to content

Commit b7bd24d

Browse files
authored
docs: add ncu-ci run documentation (#1060)
1 parent f510b8a commit b7bd24d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

docs/ncu-ci.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Commands:
1616
ncu-ci rate <type> Calculate the green rate of a CI job in the last 100
1717
runs
1818
ncu-ci walk <type> Walk the CI and display the failures
19+
ncu-ci run <prid> Start a node-test-pull-request CI job for a PR
1920
ncu-ci url <url> Automatically detect CI type and show results
2021
ncu-ci pr <jobid> Show results of a node-test-pull-request CI job
2122
ncu-ci commit <jobid> Show results of a node-test-commit CI job
@@ -125,6 +126,54 @@ Possible use cases:
125126
ncu-ci walk pr --json database.json
126127
```
127128

129+
### `ncu-ci run <prid>`
130+
131+
`ncu-ci run <prid>` starts a `node-test-pull-request` Jenkins job for a pull request.
132+
133+
`<prid>` can be one of the following:
134+
135+
- a numeric pull request id, for example `34127`
136+
- a pull request URL, for example `https://github.com/nodejs/node/pull/34127`
137+
- a commit URL for the head commit of the pull request, for example `https://github.com/nodejs/node/pull/34127/commits/35ea6ded7315cf9d0585a5d1cd7d09f358ca5993`
138+
139+
If you pass a GitHub URL, `ncu-ci` will infer the repository owner, repository name,
140+
and pull request id from the URL. When you pass a commit URL, it also uses the commit
141+
SHA as the expected tip commit.
142+
143+
By default, `ncu-ci run` only starts CI when it can verify that the tip of the PR head
144+
matches the latest approved commit. If that safety check cannot be satisfied, the
145+
command refuses to start CI.
146+
147+
Options:
148+
149+
- `--certify-safe <sha>`: explicitly set the commit SHA that must be at the tip of the PR head
150+
- `--check-for-duplicates`: check recent Jenkins runs and refuse to start a duplicate job for the same commit
151+
- `--owner <owner>`: GitHub repository owner, used when `<prid>` is not a GitHub URL
152+
- `--repo <repo>`: GitHub repository name, used when `<prid>` is not a GitHub URL
153+
154+
Examples:
155+
156+
Run CI for a PR number using repository information from config or flags:
157+
158+
```sh
159+
ncu-ci run 34127 --owner nodejs --repo node
160+
```
161+
162+
Run CI by passing the pull request URL:
163+
164+
```sh
165+
ncu-ci run https://github.com/nodejs/node/pull/34127
166+
```
167+
168+
Run CI for a specific approved head commit and avoid starting a duplicate Jenkins job:
169+
170+
```sh
171+
ncu-ci run https://github.com/nodejs/node/pull/34127/commits/35ea6ded7315cf9d0585a5d1cd7d09f358ca5993 --check-for-duplicates
172+
```
173+
174+
If the PR has the `v8 engine` label, `ncu-ci run` also triggers the `node-test-commit-v8-linux`
175+
job after the main PR CI job is started successfully.
176+
128177
### `ncu-ci pr <jobid>`
129178

130179
`ncu-ci pr <jobid>` returns information about the results of a `node-test-pull-request` job.

0 commit comments

Comments
 (0)