@diffpal/diffpal-win32-x64 0.1.1 → 0.1.3
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/README.md +228 -56
- package/bin/diffpal.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,75 +1,247 @@
|
|
|
1
1
|
# DiffPal
|
|
2
2
|
|
|
3
|
-
DiffPal
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
DiffPal reviews pull request diffs and publishes policy-aware feedback back to
|
|
4
|
+
your CI system.
|
|
5
|
+
|
|
6
|
+
It is built for teams that want AI review output that is easy to scan:
|
|
7
|
+
|
|
8
|
+
- PR summaries that explain what changed
|
|
9
|
+
- inline comments only for actionable findings
|
|
10
|
+
- merge gates through checks/statuses, not bot approvals
|
|
11
|
+
- one config file that works across GitHub, GitLab, and Azure DevOps
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
Add a DiffPal config, add a provider secret, then choose the CI example for your
|
|
16
|
+
platform.
|
|
17
|
+
|
|
18
|
+
The examples use npm `@latest` for quick onboarding. For production, pin
|
|
19
|
+
`@diffpal/diffpal`, `diffpal-version`, `@openai/codex`, and
|
|
20
|
+
`@normahq/codex-acp-bridge` to versions you have tested.
|
|
21
|
+
|
|
22
|
+
## Config
|
|
23
|
+
|
|
24
|
+
Commit `.config/diffpal/config.yaml`:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
version: v1
|
|
28
|
+
|
|
29
|
+
runtime:
|
|
30
|
+
providers:
|
|
31
|
+
codex-acp:
|
|
32
|
+
type: codex_acp
|
|
33
|
+
codex_acp:
|
|
34
|
+
reasoning_effort: low
|
|
35
|
+
|
|
36
|
+
diffpal:
|
|
37
|
+
provider: codex-acp
|
|
38
|
+
gate:
|
|
39
|
+
block_on: high
|
|
40
|
+
review:
|
|
41
|
+
language: en
|
|
42
|
+
instructions: |
|
|
43
|
+
Prefer actionable findings that are directly supported by the diff.
|
|
44
|
+
checks:
|
|
45
|
+
- security
|
|
46
|
+
- bugs
|
|
47
|
+
- performance
|
|
48
|
+
# - best-practices
|
|
49
|
+
```
|
|
10
50
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
51
|
+
Add `OPENAI_API_KEY` as a CI secret so the Codex CLI can act as the
|
|
52
|
+
review provider. Platform publish tokens are CI-specific:
|
|
53
|
+
|
|
54
|
+
| Platform | Publish token |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| GitHub Actions | built-in `GITHUB_TOKEN` |
|
|
57
|
+
| GitLab CI | built-in `CI_JOB_TOKEN` or `GITLAB_TOKEN` |
|
|
58
|
+
| Azure Pipelines | built-in `SYSTEM_ACCESSTOKEN` |
|
|
59
|
+
|
|
60
|
+
## GitHub Actions
|
|
61
|
+
|
|
62
|
+
Create `.github/workflows/diffpal-review.yml`.
|
|
63
|
+
|
|
64
|
+
The action installs the DiffPal CLI. The workflow installs only the Codex
|
|
65
|
+
provider command.
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
name: diffpal-review
|
|
69
|
+
|
|
70
|
+
on:
|
|
71
|
+
pull_request:
|
|
72
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
73
|
+
|
|
74
|
+
concurrency:
|
|
75
|
+
group: diffpal-review-${{ github.event.pull_request.number }}
|
|
76
|
+
cancel-in-progress: true
|
|
77
|
+
|
|
78
|
+
jobs:
|
|
79
|
+
review:
|
|
80
|
+
if: ${{ !github.event.pull_request.draft && github.event.pull_request.head.repo.full_name == github.repository }}
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
permissions:
|
|
83
|
+
contents: read
|
|
84
|
+
pull-requests: write
|
|
85
|
+
checks: write
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v4
|
|
88
|
+
with:
|
|
89
|
+
fetch-depth: 0
|
|
90
|
+
|
|
91
|
+
- uses: actions/setup-node@v4
|
|
92
|
+
with:
|
|
93
|
+
node-version: 22
|
|
94
|
+
|
|
95
|
+
- name: Install Codex provider
|
|
96
|
+
run: npm install --global @openai/codex@latest @normahq/codex-acp-bridge@latest
|
|
97
|
+
|
|
98
|
+
- name: Authenticate Codex
|
|
99
|
+
run: printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
|
|
100
|
+
env:
|
|
101
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
102
|
+
|
|
103
|
+
- name: Review pull request
|
|
104
|
+
uses: diffpal/diffpal@v0.1.2
|
|
105
|
+
with:
|
|
106
|
+
diffpal-version: latest
|
|
107
|
+
base: ${{ github.event.pull_request.base.sha }}
|
|
108
|
+
head: ${{ github.event.pull_request.head.sha }}
|
|
109
|
+
repo: ${{ github.repository }}
|
|
110
|
+
review-id: github-pr-${{ github.event.pull_request.number }}
|
|
111
|
+
feedback: balanced
|
|
112
|
+
gate: true
|
|
113
|
+
env:
|
|
114
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
115
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
116
|
+
```
|
|
19
117
|
|
|
20
|
-
|
|
118
|
+
The same-repository PR guard keeps provider secrets out of untrusted fork
|
|
119
|
+
workflows. Remove or change that guard only after designing a fork-safe release
|
|
120
|
+
flow.
|
|
121
|
+
|
|
122
|
+
## GitLab CI
|
|
123
|
+
|
|
124
|
+
Add this job to `.gitlab-ci.yml`.
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
stages:
|
|
128
|
+
- review
|
|
129
|
+
|
|
130
|
+
diffpal-review:
|
|
131
|
+
stage: review
|
|
132
|
+
image: node:22
|
|
133
|
+
rules:
|
|
134
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
135
|
+
resource_group: "diffpal:$CI_MERGE_REQUEST_IID"
|
|
136
|
+
before_script:
|
|
137
|
+
- npm install --global @diffpal/diffpal@latest @openai/codex@latest @normahq/codex-acp-bridge@latest
|
|
138
|
+
- printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
|
|
139
|
+
script:
|
|
140
|
+
- >-
|
|
141
|
+
diffpal review gitlab
|
|
142
|
+
--base "$CI_MERGE_REQUEST_DIFF_BASE_SHA"
|
|
143
|
+
--head "$CI_COMMIT_SHA"
|
|
144
|
+
--repo "$CI_PROJECT_PATH"
|
|
145
|
+
--review-id "gitlab-mr-$CI_MERGE_REQUEST_IID"
|
|
146
|
+
--language en
|
|
147
|
+
--review-checks security,bugs,performance,best-practices
|
|
148
|
+
--feedback balanced
|
|
149
|
+
--gate
|
|
150
|
+
variables:
|
|
151
|
+
GIT_DEPTH: "0"
|
|
152
|
+
artifacts:
|
|
153
|
+
when: always
|
|
154
|
+
paths:
|
|
155
|
+
- .artifacts/diffpal/
|
|
156
|
+
reports:
|
|
157
|
+
codequality: .artifacts/diffpal/codequality.json
|
|
158
|
+
sarif: .artifacts/diffpal/diffpal.sarif
|
|
159
|
+
```
|
|
21
160
|
|
|
22
|
-
|
|
161
|
+
Set `OPENAI_API_KEY` as a protected/masked CI variable. Use the built-in
|
|
162
|
+
`CI_JOB_TOKEN` when your GitLab instance allows it, or set `GITLAB_TOKEN` for a
|
|
163
|
+
dedicated API token.
|
|
164
|
+
|
|
165
|
+
## Azure Pipelines
|
|
166
|
+
|
|
167
|
+
Enable **Allow scripts to access the OAuth token**, then add this to
|
|
168
|
+
`azure-pipelines.yml`.
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
trigger: none
|
|
172
|
+
pr:
|
|
173
|
+
- main
|
|
174
|
+
|
|
175
|
+
pool:
|
|
176
|
+
vmImage: ubuntu-latest
|
|
177
|
+
|
|
178
|
+
steps:
|
|
179
|
+
- checkout: self
|
|
180
|
+
fetchDepth: 0
|
|
181
|
+
|
|
182
|
+
- task: NodeTool@0
|
|
183
|
+
inputs:
|
|
184
|
+
versionSpec: "22.x"
|
|
185
|
+
|
|
186
|
+
- script: npm install --global @openai/codex@latest @normahq/codex-acp-bridge@latest
|
|
187
|
+
displayName: Install Codex provider
|
|
188
|
+
|
|
189
|
+
- script: printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
|
|
190
|
+
displayName: Authenticate Codex
|
|
191
|
+
env:
|
|
192
|
+
OPENAI_API_KEY: $(OPENAI_API_KEY)
|
|
193
|
+
|
|
194
|
+
- task: DiffPalReview@1
|
|
195
|
+
displayName: DiffPal review
|
|
196
|
+
inputs:
|
|
197
|
+
diffpalVersion: latest
|
|
198
|
+
language: en
|
|
199
|
+
reviewChecks: security,bugs,performance,best-practices
|
|
200
|
+
feedback: balanced
|
|
201
|
+
gate: true
|
|
202
|
+
env:
|
|
203
|
+
OPENAI_API_KEY: $(OPENAI_API_KEY)
|
|
204
|
+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
205
|
+
```
|
|
23
206
|
|
|
24
|
-
|
|
207
|
+
The Azure task installs the DiffPal CLI by default. Set `install: false` to use
|
|
208
|
+
a preinstalled binary from `PATH`, or set `diffpalPath` to a custom binary path.
|
|
25
209
|
|
|
26
|
-
|
|
27
|
-
- `diffpal review local`
|
|
28
|
-
- `diffpal review github`
|
|
29
|
-
- `diffpal review gitlab`
|
|
30
|
-
- `diffpal review ado`
|
|
31
|
-
- `diffpal sarif`
|
|
32
|
-
- `diffpal init`
|
|
33
|
-
- `diffpal doctor`
|
|
34
|
-
- `diffpal version`
|
|
210
|
+
## What You Should See
|
|
35
211
|
|
|
36
|
-
|
|
212
|
+
On pull requests, DiffPal can publish:
|
|
37
213
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
214
|
+
- a review summary with a semantic overview of the change
|
|
215
|
+
- a check/status for merge gating
|
|
216
|
+
- inline comments or threads for actionable findings
|
|
217
|
+
- JSON, SARIF, and CI artifacts for later inspection
|
|
42
218
|
|
|
43
|
-
|
|
219
|
+
The default review checks are `security`, `bugs`, `performance`, and
|
|
220
|
+
`best-practices`. The default review language is English. Checks, language, and
|
|
221
|
+
custom review instructions are configurable in `.config/diffpal/config.yaml` or
|
|
222
|
+
by CLI flags such as `--review-checks`, `--instructions`, and
|
|
223
|
+
`--instructions-file`.
|
|
44
224
|
|
|
45
|
-
|
|
46
|
-
- [Config and policy reference](docs/config-reference.md)
|
|
47
|
-
- [Configuration schema](docs/config-schema.md)
|
|
48
|
-
- [Findings schema](docs/findings-schema.md)
|
|
49
|
-
- [GitHub/GitLab/Azure CI examples](docs/ci-examples.md)
|
|
50
|
-
- [GitLab adapter contract](docs/platform-gitlab.md)
|
|
51
|
-
- [Azure adapter contract](docs/platform-azure.md)
|
|
52
|
-
- [Release process](docs/release.md)
|
|
225
|
+
## Local Debugging
|
|
53
226
|
|
|
54
|
-
|
|
227
|
+
Local commands are useful for setup checks and debugging, but they are not the
|
|
228
|
+
main CI setup path.
|
|
55
229
|
|
|
56
230
|
```bash
|
|
231
|
+
npm install --global @diffpal/diffpal@latest @openai/codex@latest @normahq/codex-acp-bridge@latest
|
|
232
|
+
printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
|
|
57
233
|
diffpal init
|
|
58
|
-
diffpal doctor
|
|
234
|
+
diffpal doctor --mode github
|
|
59
235
|
diffpal review local --base origin/main --head HEAD
|
|
60
|
-
diffpal review github --base origin/main --head HEAD --gate
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Development
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
go mod download
|
|
67
|
-
go mod verify
|
|
68
|
-
go test ./...
|
|
69
|
-
go tool golangci-lint run ./...
|
|
70
|
-
go run ./cmd/diffpal --help
|
|
71
236
|
```
|
|
72
237
|
|
|
73
|
-
|
|
238
|
+
## Documentation
|
|
74
239
|
|
|
75
|
-
|
|
240
|
+
- [Quickstart](docs/quickstart.md)
|
|
241
|
+
- [CI setup guide](docs/ci-examples.md)
|
|
242
|
+
- [Config reference](docs/config-reference.md)
|
|
243
|
+
- [Findings schema](docs/findings-schema.md)
|
|
244
|
+
- [GitLab adapter reference](docs/platform-gitlab.md)
|
|
245
|
+
- [Azure adapter reference](docs/platform-azure.md)
|
|
246
|
+
- [Release process](docs/release.md)
|
|
247
|
+
- [Contributing](CONTRIBUTING.md)
|
package/bin/diffpal.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED