walkdiff 0.7.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +36 -14
- package/app-ui/assets/index-D08hi5Lz.js +63 -0
- package/app-ui/assets/index-tYFZOod2.css +1 -0
- package/app-ui/index.html +2 -2
- package/package.json +7 -2
- package/report-ui/assets/index-BhaHkEaL.js +81 -0
- package/report-ui/assets/index-D9j4qnI6.css +1 -0
- package/report-ui/index.html +2 -2
- package/walkdiff.mjs +2719 -214
- package/app-ui/assets/index-DCzspYup.js +0 -63
- package/app-ui/assets/index-DZU5WQ7m.css +0 -1
- package/report-ui/assets/index-BY-qwtzV.js +0 -81
- package/report-ui/assets/index-v4H3BNvl.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
- **Go, Java, C and C++:** files in these languages now get what Rust, TypeScript and Python files get. That means changed functions, methods and types as units with change facts, callers traced across the repository, function metrics, risky-API rules and syntax highlighting.
|
|
6
|
+
- Go also gets breaking-change detection, for exported names in a module package that isn't `main` or `internal`.
|
|
7
|
+
- Go methods are named by their type, as `Server.Start`.
|
|
8
|
+
- C++ methods defined outside their class are named by it, inside any namespace, as `net::Server::start`.
|
|
9
|
+
- GoogleTest and Boost.Test cases show as tests, as `TEST(parser, reads)`.
|
|
10
|
+
- `.h` headers are read as C++, which also reads C.
|
|
11
|
+
- **Each JavaScript and TypeScript test is its own unit:** `describe`, `it`/`test` and hooks such as `beforeEach` are named by their title, as `parser › reads includes`. A test added to a suite shows on its own, and a suite or class that is new as a whole shows with everything in it.
|
|
12
|
+
- **More callers found:** a Java or C++ method calling another method of its class by bare name now counts as a caller.
|
|
13
|
+
- **Go and C/C++ test files** (`_test.go`, `_test.cc`) no longer get function-metric findings.
|
|
14
|
+
- **Scanner downloads retry:** a failed download of a security scanner is tried again after a server error or a dropped connection, instead of failing the setup.
|
|
15
|
+
- **GitHub releases are published by the Release workflow,** with the version's changelog section as their notes.
|
|
16
|
+
|
|
17
|
+
## 0.8.0
|
|
18
|
+
|
|
19
|
+
- **Review a stack together:** when a PR or MR builds on others, the app offers to add the whole stack. It reads GitHub's and GitLab's own stacks where they exist, and otherwise follows the branches. A grouped stack is one card on the review list, bottom first, with each PR's progress and what its host says now: new commits, a new base after the PR below merged, approved, or changes requested. **Refresh changed** re-runs only the PRs whose reports are out of date, and each report links to its neighbours in the stack.
|
|
20
|
+
- **Approve a whole stack:** **Approve all…** lists every open PR with the commit its report shows, and won't post while any has new commits or a new base. It warns about comments not posted and reviews not finished, then approves each PR bottom first and shows each result as it comes. A refused approval doesn't stop the others.
|
|
21
|
+
- **Progress on every review:** the review list shows how far you got in each report, and says when the code changed since you reviewed it.
|
|
22
|
+
- **GitLab CI checks:** poutine now scans the GitLab CI, Azure Pipelines and Tekton files a change touches. Walkdiff's own rules flag MR titles, descriptions, branch names or commit messages run as commands, remote includes without `integrity`, project includes and components not pinned to a release, and images on `latest` or with no tag. An MR that edits only an included file is checked along with the `.gitlab-ci.yml` that includes it.
|
|
23
|
+
- **Python security rules:** Ruff now also runs its security rules, ported from Bandit, on changed Python, so insecure code is caught offline when Semgrep can't run. Where another check already flagged the line, Ruff's finding is left out.
|
|
24
|
+
- **Approving a GitLab MR you'd already approved** no longer fails with advice to fix your token.
|
|
25
|
+
- **GitLab numbers** show as `!4` rather than `#4` in the report's top bar.
|
|
26
|
+
|
|
3
27
|
## 0.7.2
|
|
4
28
|
|
|
5
29
|
- **`walkdiff --version`:** shows which Walkdiff runs, and every error now ends with the version, such as `(walkdiff 0.7.2)`, so a pasted error says which release it came from. The troubleshooting guide covers "transport 'ssh' not allowed" and how to find which Walkdiff runs when several are installed.
|
package/README.md
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
# walkdiff
|
|
4
4
|
|
|
5
5
|
A review companion for GitHub pull requests and GitLab merge requests. `walkdiff review <url>` fetches the
|
|
6
|
-
change, analyzes it, and serves a local report.
|
|
6
|
+
change, analyzes it, and serves a local report.
|
|
7
7
|
|
|
8
|
-
Status: early release, [v0.
|
|
8
|
+
Status: early release, [v0.9.0](CHANGELOG.md). To run it on your team's PRs, see the [pilot guide](docs/pilot.md).
|
|
9
9
|
|
|
10
10
|
**Documentation:** [getting started](docs/getting-started.md), [configuration](docs/configuration.md), [troubleshooting](docs/troubleshooting.md), [security policy](SECURITY.md).
|
|
11
11
|
|
|
@@ -15,9 +15,11 @@ The report opens on a brief: what to check, how many changes need attention, and
|
|
|
15
15
|
|
|
16
16
|
All changes has five tabs, including **Conversation** in the app: **Changes** (files, the map of each file and the changed units), **Impact** (where other code uses what changed), **Risks** (each check's result and every finding) and **AI review**. Each tab shows a count, and its name in the URL lets you link to it, as in `#risks`.
|
|
17
17
|
|
|
18
|
-
- **Changed units, not hunks.** For Rust, TypeScript/JavaScript
|
|
19
|
-
type or
|
|
20
|
-
code it owns; its methods are separate cards.
|
|
18
|
+
- **Changed units, not hunks.** For Rust, TypeScript/JavaScript, Python, Go, Java, C and C++, each changed function,
|
|
19
|
+
method, type, class or macro appears once, whole, before and after, with edited words marked. A class shows only the
|
|
20
|
+
code it owns; its methods are separate cards. In JavaScript and TypeScript tests, each `describe`,
|
|
21
|
+
`it`/`test` and hook such as `beforeEach` is a unit too, named by its title, such as `parser › reads includes`.
|
|
22
|
+
A class or suite that is new as a whole is one card with everything in it.
|
|
21
23
|
- **A map of each file.** When a file has several changed units, an outline shows which ones changed among all its definitions, how big they are, and which changed function calls which. Cards are in reading order: types first, then helpers before the code that calls them, with collapsed changes last.
|
|
22
24
|
- **Change facts.** Each modified function lists what changed without reading it, worked out from the syntax: parameters, return type, calls added or removed, and more or fewer error paths and branches.
|
|
23
25
|
- **Noise collapsed.** Formatting-only and comment-only edits, renames with unchanged bodies, and units moved
|
|
@@ -27,7 +29,8 @@ All changes has five tabs, including **Conversation** in the app: **Changes** (f
|
|
|
27
29
|
lists where the rest of the code still uses it, linked to the host at the head commit, and flags the
|
|
28
30
|
callers this PR did not touch. Removed and renamed units show any references left behind.
|
|
29
31
|
- **Risks and security findings.** Built-in rules flag likely secrets (redacted in the report), risky APIs
|
|
30
|
-
such as `eval`, `shell=True`, raw HTML
|
|
32
|
+
such as `eval`, `shell=True`, raw HTML, `unsafe`, Go's `InsecureSkipVerify`, Java deserialization or C's
|
|
33
|
+
`strcpy` (only in code, not comments or strings), sensitive
|
|
31
34
|
areas such as auth, payments, migrations and CI, new dependencies, and known vulnerabilities in
|
|
32
35
|
dependency versions new to `package-lock.json`, `Cargo.lock`, `poetry.lock`, `uv.lock` or pinned
|
|
33
36
|
requirements (via [OSV](https://osv.dev); `--offline` skips it). Review signals add large PRs, missing
|
|
@@ -48,8 +51,12 @@ qualified with the unit's type, likely for a direct use, possible for `x.method(
|
|
|
48
51
|
and parameters or locals that shadow the name are ignored. Names in more than 200 files (`new`, `get`)
|
|
49
52
|
are reported as too common to trace.
|
|
50
53
|
|
|
51
|
-
Known limits:
|
|
52
|
-
|
|
54
|
+
Known limits: tests are recognised by the usual names (`describe`, `it`, `test` and their hooks), so a
|
|
55
|
+
test helper with another name shows under "imports & top level"; a unit renamed as well as moved and
|
|
56
|
+
edited, or mostly rewritten, shows as removed plus added (see
|
|
57
|
+
[troubleshooting](docs/troubleshooting.md#a-function-shows-as-removed-and-added)); code is highlighted
|
|
58
|
+
only in Rust, TypeScript/JavaScript, Python, Go, Java, C and C++; and `.h` headers are read as C++, which
|
|
59
|
+
reads C too unless the code uses a C++ keyword such as `new` as a name.
|
|
53
60
|
|
|
54
61
|
## Usage
|
|
55
62
|
|
|
@@ -98,7 +105,7 @@ Tokens and code stay on your machine, apart from the host itself, package names
|
|
|
98
105
|
|
|
99
106
|
## In CI
|
|
100
107
|
|
|
101
|
-
The GitHub Action (`navasvarela/walkdiff@v0.
|
|
108
|
+
The GitHub Action (`navasvarela/walkdiff@v0.9.0`) and the GitLab template (`ci/gitlab-ci.yml`) generate the report for each PR, keep it as a job artifact, and post one summary comment that is updated on each push. The [pilot guide](docs/pilot.md) has the setup. Locally, `walkdiff review` also works without a URL inside a CI job, and `walkdiff comment --report <dir> --report-url <url>` posts the summary.
|
|
102
109
|
|
|
103
110
|
## AI review
|
|
104
111
|
|
|
@@ -112,7 +119,8 @@ sent. A repository can forbid AI review entirely with `"ai": { "allowed": false
|
|
|
112
119
|
|
|
113
120
|
Walkdiff installs pinned versions of [Semgrep](https://semgrep.dev),
|
|
114
121
|
[gitleaks](https://github.com/gitleaks/gitleaks), [osv-scanner](https://github.com/google/osv-scanner),
|
|
115
|
-
[Ruff](https://docs.astral.sh/ruff/)
|
|
122
|
+
[Ruff](https://docs.astral.sh/ruff/), [zizmor](https://docs.zizmor.sh/) and
|
|
123
|
+
[poutine](https://github.com/boostsecurityio/poutine) on its first run, or when you run
|
|
116
124
|
`walkdiff setup`, checked against hashes in this repository, on macOS and Linux. They live in
|
|
117
125
|
`~/.cache/walkdiff/scanners`, just for Walkdiff. Semgrep needs Python 3.10 or later. If one can't be
|
|
118
126
|
installed, Walkdiff still runs, and the Risks tab lists it under "Not checked". Copies on your `PATH`
|
|
@@ -122,12 +130,22 @@ are used only when Walkdiff has none of its own. `--offline` skips installing th
|
|
|
122
130
|
| --- | --- | --- |
|
|
123
131
|
| Semgrep | Risky code patterns, using the `p/default` rules | Downloads rules; your code is not uploaded |
|
|
124
132
|
| gitleaks | Secrets | None |
|
|
133
|
+
| Ruff security rules | Insecure Python, using Bandit's rules: `shell=True`, `pickle`, `yaml.load`, `verify=False`, SQL built from strings and more. Test files are skipped | None |
|
|
125
134
|
| osv-scanner | Known vulnerabilities in `pnpm-lock.yaml`, `yarn.lock` and `bun.lock` | Sends package names and versions to OSV |
|
|
135
|
+
| zizmor | Security problems in GitHub Actions workflows | None |
|
|
136
|
+
| poutine | Security problems in GitLab CI, Azure Pipelines and Tekton: `curl \| sh`, debug tracing that prints secrets into job logs, injection through CI component inputs | None |
|
|
126
137
|
|
|
127
138
|
Only findings on lines the PR added are reported, and `--offline` skips Semgrep and osv-scanner.
|
|
139
|
+
Ruff's security rules still run offline. Where the built-in rules or Semgrep already flag a line,
|
|
140
|
+
Ruff's finding is left out.
|
|
128
141
|
Scanners read a temporary copy of the changed files, without your tokens in their environment. A PR
|
|
129
142
|
cannot silence them: `# nosemgrep` and `gitleaks:allow` comments are ignored, and scanner config files
|
|
130
|
-
in the PR (`.gitleaks.toml`, `.semgrepignore` and others) are not used. Those files are not scanned either.
|
|
143
|
+
in the PR (`.gitleaks.toml`, `.semgrepignore`, `.poutine.yml` and others) are not used. Those files are not scanned either.
|
|
144
|
+
|
|
145
|
+
For GitLab CI, Walkdiff's built-in rules add what poutine doesn't check: merge request titles, branch
|
|
146
|
+
names or commit messages run through `eval` or `sh -c`, remote includes without `integrity`, project
|
|
147
|
+
includes without `ref`, components on `~latest` or a branch, and images with no version. Both follow
|
|
148
|
+
the local includes of `.gitlab-ci.yml`, so an MR that only edits an included file is still checked.
|
|
131
149
|
|
|
132
150
|
Choose Semgrep's rules in `.walkdiff.json`; an empty list turns Semgrep off:
|
|
133
151
|
|
|
@@ -147,9 +165,9 @@ because they expose nothing to an attacker.
|
|
|
147
165
|
The rules read syntax, not types, so they say "may break" unless a required parameter changed and calls
|
|
148
166
|
to the function are left behind. They would rather stay quiet than raise a false alarm.
|
|
149
167
|
|
|
150
|
-
**Public APIs**, for Rust, TypeScript, JavaScript and
|
|
168
|
+
**Public APIs**, for Rust, TypeScript, JavaScript, Python and Go: a removed or renamed function or type, an
|
|
151
169
|
item that stops being public, removed or newly required parameters, and changed parameter or return types.
|
|
152
|
-
Other changes aren't flagged, such as a renamed parameter in Rust or
|
|
170
|
+
Other changes aren't flagged, such as a renamed parameter in Rust, TypeScript or Go, a new optional parameter,
|
|
153
171
|
or a wider parameter type. Being marked public isn't enough, since apps mark their own modules that way too.
|
|
154
172
|
A change also needs someone it can affect:
|
|
155
173
|
|
|
@@ -158,6 +176,10 @@ A change also needs someone it can affect:
|
|
|
158
176
|
| Rust | A bare `pub` (not `pub(crate)`) | The crate has `src/lib.rs`, isn't `publish = false`, and every module up to the root is `pub mod` or re-exports it |
|
|
159
177
|
| TypeScript, JavaScript | `export` | The package isn't `private` and its entry point exports it, directly or through `export ... from` |
|
|
160
178
|
| Python | No leading underscore | The project has a build backend, no part of the module path starts with an underscore, and `__all__`, if any, lists it |
|
|
179
|
+
| Go | A capitalised name, and for a method, a capitalised type | A `go.mod` is above it, the package isn't `main`, and no folder on its path is `internal` |
|
|
180
|
+
|
|
181
|
+
Java isn't covered yet, since nothing in a Java project's files reliably tells a published library from an
|
|
182
|
+
application. Neither are C and C++, whose API is whatever the installed headers declare.
|
|
161
183
|
|
|
162
184
|
Otherwise it's flagged only if calls this PR didn't touch remain in the repository. Python and TypeScript
|
|
163
185
|
functions under a framework's decorator are skipped, as the decorator can change how they're called. So is a
|
|
@@ -187,7 +209,7 @@ without the definition changing, and inputs of a GitHub Action's `action.yml`.
|
|
|
187
209
|
Walkdiff flags poor implementations and bad practice in the code a PR adds, under the "Code quality"
|
|
188
210
|
category in the Risks tab. These findings never count as security findings.
|
|
189
211
|
|
|
190
|
-
**Function metrics** are built in and cover Rust, TypeScript and
|
|
212
|
+
**Function metrics** are built in and cover Rust, TypeScript, Python, Go, Java, C and C++. A function is flagged when
|
|
191
213
|
the PR adds it over a limit, pushes it over one, or makes one already over the limit at least 20%
|
|
192
214
|
worse. The Changes tab also shows each modified function's complexity change. Test code is left out.
|
|
193
215
|
|