Skip to content

Commit eb33037

Browse files
fixed a false positive pre-commit check failure issue
1 parent d9f09fc commit eb33037

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

‎private-cicd/docs/CREATE-PRESUBMIT-JOB.md‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -629,13 +629,10 @@ openssl pkcs8 -topk8 -inform PEM -outform PEM \
629629
head -1 converted-github-app.pem
630630
```
631631

632-
The first line must be:
632+
The first line must be the unencrypted PKCS#8 PEM header
633+
(five hyphens, BEGIN, a space, PRIVATE KEY, five hyphens).
633634

634-
```text
635-
-----BEGIN PRIVATE KEY-----
636-
```
637-
638-
`BEGIN RSA PRIVATE KEY` is not the converted PKCS#8 form expected by the
635+
A PKCS#1 RSA PEM header is not the converted PKCS#8 form expected by the
639636
Jenkins GitHub App credential.
640637

641638
### 9.4 Add the App credential to Jenkins
@@ -1227,8 +1224,8 @@ Use `SOURCE_MODE=discover`. Do not ask GitHub to redeliver.
12271224
| 403 | missing Checks write permission, policy, or rate limit |
12281225
| 404 | App not installed on `NetApp/cloudstack` or wrong repository |
12291226

1230-
Also confirm the private key begins `BEGIN PRIVATE KEY`, the credential Kind is
1231-
GitHub App, and the ID matches `GITHUB_APP_CREDENTIALS_ID`.
1227+
Also confirm the private key is unencrypted PKCS#8 PEM (not PKCS#1 RSA), the
1228+
credential Kind is GitHub App, and the ID matches `GITHUB_APP_CREDENTIALS_ID`.
12321229

12331230
GitHub reporting errors do not replace the build result, but a missing success
12341231
cannot satisfy a required Check.

‎private-cicd/docs/PRIVATE-CICD-GUIDE.md‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ openssl pkcs8 -topk8 -inform PEM -outform PEM \
465465
-in <downloaded-key>.private-key.pem -out converted-github-app.pem -nocrypt
466466
```
467467

468-
The result starts with `BEGIN PRIVATE KEY`. Add Kind **GitHub App**, ID
468+
The result is unencrypted PKCS#8 PEM. Add Kind **GitHub App**, ID
469469
`cloudstack-presubmit-github-app`, with App ID and converted key. Test it when possible, then delete both PEM files.
470470
An app not installed on `cloudstack` receives API 404. The pipeline rebinds the credential per API call because
471471
installation tokens are short-lived.
@@ -504,7 +504,7 @@ Do not add UI triggers manually. The Jenkinsfile declares `cron('H/5 * * * *')`.
504504
### First load and script approvals
505505

506506
Click **Build Now** once. It may load the new defaults or fail once using old defaults. Refresh, confirm
507-
`SOURCE_MODE` offers `discover`, `pull_request`, `branch`, and `diagnose`, then run `discover` once to seed the watermark without
507+
`SOURCE_MODE` offers `discover`, `pull_request`, and `branch`, then run `discover` once to seed the watermark without
508508
queueing historical PRs. Confirm **Configure > Build Triggers** shows the five-minute timer and no Generic Webhook
509509
Trigger.
510510

@@ -613,13 +613,6 @@ discovery build always means discovery itself is broken.
613613
Discovery titles its build `discover: queued N, deferred M`, or `discover: skipped, lock held` when it overlapped a
614614
slower run, and puts the watermark in the description.
615615

616-
### Diagnose GitHub App
617-
618-
Runs only for `SOURCE_MODE=diagnose`, and only needs `PR_HEAD_SHA`. It checks out CI scripts and probes the App's
619-
token type, repository access, Checks read and one Checks write, then prints a verdict. Nothing else runs: no VM
620-
lock, no build, no mail, no presubmit Check. Use it instead of a full worker when a Check does not appear on a PR.
621-
See the Checks troubleshooting section of [`CREATE-PRESUBMIT-JOB.md`](CREATE-PRESUBMIT-JOB.md).
622-
623616
### Validate source request
624617

625618
Records start time/integration false; validates mode, branch/SHA or PR/repository, HTTPS `.git` URL, credential IDs,
@@ -1023,7 +1016,7 @@ configure, or health logs that already passed.
10231016

10241017
### GitHub and mail
10251018

1026-
- rejected App key: require PKCS#8 `BEGIN PRIVATE KEY`;
1019+
- rejected App key: require unencrypted PKCS#8 PEM;
10271020
- missing GitHub App Kind: update GitHub Branch Source;
10281021
- Check 401: bad credential; 403: permission/rate; 404: installation/repository;
10291022
- broken Details link: fix Jenkins URL;

0 commit comments

Comments
 (0)