Skip to content

Commit 69f8871

Browse files
committed
Correct which runs compare, after the 2.9.0 flow change
#302 moved SCM-integrated non-PR/MR pipelines onto a full scan: create_scm_scan now sends only a "diff" event type to create_new_diff and everything else, default-branch pushes included, to create_full_scan_with_report_url. The permission docs asserted the opposite -- that plain pushes also reach the diff-scans path -- which was true when they were written against 2.8.1 and is not true now. Replace the claim with a table of which runs compare, and keep the old behavior as a note, since the warning still shows up in logs from pre-2.9.0 runs with no pull request in sight. Re-verified the rest against 2.9.7: SDK call surface, the four sys.exit(2) sites, the temporary empty baseline, and the reachability scan ID are all unchanged.
1 parent 1e99f3c commit 69f8871

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
Recorded the converse too: `socketcli` makes no triage or security-policy calls, so
1414
three of the nine scopes that guide lists are not exercised by this CLI.
1515
- Corrected the scan-comparison guidance. The `APIAccessDenied` fallback was documented
16-
as a PR/MR-only condition, but it applies to any run that produces a diff, including
17-
plain pushes on the default branch. The guidance also listed `full-scans:list`
18-
alongside the two `diff-scans:*` scopes, which points readers at a permission the
19-
fallback path demonstrably already has.
16+
as a PR/MR-only condition; it applies to any run that produces a diff, which since
17+
2.9.0 means PR/MR events and runs without an SCM integration. Added a table of which
18+
runs compare, and a note that before 2.9.0 SCM-integrated branch pushes compared too.
19+
The guidance also listed `full-scans:list` alongside the two `diff-scans:*` scopes,
20+
which points readers at a permission the fallback path demonstrably already has.
2021
- Documented three outcomes that are expected but read as failures: the temporary empty
2122
baseline created on a repository's first scan, which does not appear in the dashboard;
2223
the reachability scan ID being a `tier1ReachabilityScanId` rather than a full scan ID,

‎docs/troubleshooting.md‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,27 @@ identifiers for them are not published.
7676

7777
## `APIAccessDenied` on the scan comparison
7878

79-
Any run that produces a diff — PR/MR events, **plain pushes on the default branch**,
80-
and `--enable-diff` / `--ignore-commit-files` runs without an SCM integration — first
81-
tries the diff-scans endpoints. A token without the `diff-scans:*` permissions logs a
82-
warning and silently continues on the older path:
79+
Any run that produces a diff first tries the diff-scans endpoints. A token without the
80+
`diff-scans:*` permissions logs a warning and silently continues on the older path:
8381

8482
```
8583
Diff scan comparison failed with APIAccessDenied(Insufficient permissions), falling back to the streaming scan comparison
8684
```
8785

8886
The scan still succeeds and the diff results are the same, so this is easy to miss.
8987

90-
Note that this is *not* limited to PR/MR runs. A pipeline that only ever scans pushes
91-
(`--pr-number 0 --default-branch`) still hits it.
88+
**Which runs produce a diff.** As of 2.9.0:
89+
90+
| Run | Compares? |
91+
|:---|:---|
92+
| PR/MR event with `--scm github` / `--scm gitlab` | Yes |
93+
| Any other event with `--scm github` / `--scm gitlab` (branch and default-branch pushes) | No — creates a full scan |
94+
| No SCM integration (`--scm api`, the default), including `--enable-diff` and `--ignore-commit-files` | Yes |
95+
| No supported manifest in the changed-file set | No — falls back to a full scan |
96+
97+
Before 2.9.0 an SCM-integrated branch push also compared, so a pipeline scanning only
98+
pushes (`--pr-number 0 --default-branch`) hit this too. If you are diagnosing an older
99+
run, that is why the warning can appear in a log with no pull request in sight.
92100

93101
**Which permission is missing.** The fallback path is `GET orgs/{org}/full-scans/diff`,
94102
a full-scans read. If you see the fallback produce results, your token already has

0 commit comments

Comments
 (0)