@diffpal/diffpal-darwin-arm64 0.1.2 → 0.1.4
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 +202 -69
- package/bin/diffpal +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,93 +1,238 @@
|
|
|
1
1
|
# DiffPal
|
|
2
2
|
|
|
3
|
-
DiffPal reviews pull
|
|
4
|
-
|
|
3
|
+
DiffPal reviews pull request diffs and publishes policy-aware feedback back to
|
|
4
|
+
your CI system.
|
|
5
5
|
|
|
6
6
|
It is built for teams that want AI review output that is easy to scan:
|
|
7
7
|
|
|
8
|
-
-
|
|
8
|
+
- PR summaries that explain what changed
|
|
9
9
|
- inline comments only for actionable findings
|
|
10
|
-
- merge
|
|
10
|
+
- merge gates through checks/statuses, not bot approvals
|
|
11
11
|
- one config file that works across GitHub, GitLab, and Azure DevOps
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Add a DiffPal config, add a provider secret, then choose the CI example for your
|
|
16
|
+
platform.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
diffpal doctor
|
|
21
|
-
```
|
|
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.
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
## Config
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
- [GitLab CI setup](docs/ci-examples.md#gitlab-ci)
|
|
27
|
-
- [Azure Pipelines setup](docs/ci-examples.md#azure-pipelines)
|
|
24
|
+
Commit `.config/diffpal/config.yaml`:
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
```yaml
|
|
27
|
+
version: v1
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
runtime:
|
|
30
|
+
providers:
|
|
31
|
+
codex-acp:
|
|
32
|
+
type: codex_acp
|
|
33
|
+
codex_acp:
|
|
34
|
+
reasoning_effort: low
|
|
33
35
|
|
|
34
|
-
|
|
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
|
+
```
|
|
35
50
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
40
61
|
|
|
41
|
-
|
|
62
|
+
Create `.github/workflows/diffpal-review.yml`.
|
|
42
63
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `best-practices`
|
|
64
|
+
The action installs the DiffPal CLI. The workflow installs only the Codex
|
|
65
|
+
provider command.
|
|
46
66
|
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
```
|
|
49
117
|
|
|
50
|
-
|
|
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.
|
|
51
121
|
|
|
52
|
-
|
|
53
|
-
|
|
122
|
+
## GitLab CI
|
|
123
|
+
|
|
124
|
+
Add this job to `.gitlab-ci.yml`.
|
|
54
125
|
|
|
55
126
|
```yaml
|
|
56
|
-
|
|
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
|
+
```
|
|
57
160
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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.
|
|
61
164
|
|
|
62
|
-
|
|
63
|
-
copilot-acp:
|
|
64
|
-
type: copilot_acp
|
|
65
|
-
copilot_acp:
|
|
66
|
-
extra_args:
|
|
67
|
-
- --stdio
|
|
165
|
+
## Azure Pipelines
|
|
68
166
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
block_on: high
|
|
167
|
+
Enable **Allow scripts to access the OAuth token**, then add this to
|
|
168
|
+
`azure-pipelines.yml`.
|
|
72
169
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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)
|
|
81
205
|
```
|
|
82
206
|
|
|
83
|
-
|
|
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.
|
|
209
|
+
|
|
210
|
+
## What You Should See
|
|
211
|
+
|
|
212
|
+
On pull requests, DiffPal can publish:
|
|
213
|
+
|
|
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
|
|
218
|
+
|
|
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`.
|
|
224
|
+
|
|
225
|
+
## Local Debugging
|
|
226
|
+
|
|
227
|
+
Local commands are useful for setup checks and debugging, but they are not the
|
|
228
|
+
main CI setup path.
|
|
84
229
|
|
|
85
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
|
|
233
|
+
diffpal init
|
|
86
234
|
diffpal doctor --mode github
|
|
87
235
|
diffpal review local --base origin/main --head HEAD
|
|
88
|
-
diffpal review github --base "$BASE_SHA" --head "$HEAD_SHA" --feedback balanced --gate
|
|
89
|
-
diffpal review gitlab --base "$BASE_SHA" --head "$HEAD_SHA" --feedback balanced --gate
|
|
90
|
-
diffpal review ado --base "$BASE_SHA" --head "$HEAD_SHA" --feedback balanced --gate
|
|
91
236
|
```
|
|
92
237
|
|
|
93
238
|
## Documentation
|
|
@@ -99,16 +244,4 @@ diffpal review ado --base "$BASE_SHA" --head "$HEAD_SHA" --feedback balanced --g
|
|
|
99
244
|
- [GitLab adapter reference](docs/platform-gitlab.md)
|
|
100
245
|
- [Azure adapter reference](docs/platform-azure.md)
|
|
101
246
|
- [Release process](docs/release.md)
|
|
102
|
-
|
|
103
|
-
## Development
|
|
104
|
-
|
|
105
|
-
Source development in this repository uses the Go toolchain directly:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
go mod download
|
|
109
|
-
go test ./...
|
|
110
|
-
go run ./cmd/diffpal --help
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Maintainers track project work in Beads (`bd`). External contributors do not
|
|
114
|
-
need Beads to open issues or pull requests.
|
|
247
|
+
- [Contributing](CONTRIBUTING.md)
|
package/bin/diffpal
CHANGED
|
Binary file
|
package/package.json
CHANGED