@metasession.co/devaudit-cli 0.1.55 → 0.1.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metasession.co/devaudit-cli",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "description": "DevAudit CLI — installs, syncs, and operates the Metasession SDLC across consumer projects.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.8.2",
36
- "@metasession.co/devaudit-plugin-sdk": "^0.1.55",
36
+ "@metasession.co/devaudit-plugin-sdk": "^0.1.56",
37
+ "ajv": "^8.20.0",
37
38
  "commander": "^12.1.0",
38
39
  "consola": "^3.2.3",
39
40
  "env-paths": "^3.0.0",
@@ -232,22 +232,41 @@ jobs:
232
232
  register-release:
233
233
  name: Register Release
234
234
  runs-on: {{RUNNER}}
235
- if: ${{ vars.DEVAUDIT_BASE_URL != '' }}
236
235
  outputs:
237
236
  version: ${{ steps.version.outputs.version }}
238
237
  env:
239
- DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
238
+ DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
240
239
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
241
240
  steps:
242
241
  - uses: actions/checkout@v4
243
242
 
244
- - name: Validate DevAudit env
243
+ - name: Resolve DevAudit base URL
245
244
  run: |
246
- if [ -z "${DEVAUDIT_BASE_URL}" ] || [ -z "${DEVAUDIT_API_KEY}" ]; then
247
- echo "::error::DEVAUDIT_BASE_URL (variable) and DEVAUDIT_API_KEY (secret) must both be set."
245
+ # Prefer sdlc-config.json devaudit.base_url (PR-visible) over the
246
+ # deprecated repo Variable matching compliance-evidence.yml and
247
+ # check-release-approval.yml. DevAudit-Installer#156: gating this job
248
+ # on `vars.DEVAUDIT_BASE_URL` silently skipped release registration +
249
+ # evidence upload for consumers that moved base_url into
250
+ # sdlc-config.json (the v1.23.0 direction).
251
+ BASE=""
252
+ if [ -f sdlc-config.json ]; then
253
+ CONFIG_URL=$(jq -r '.devaudit.base_url // empty' sdlc-config.json 2>/dev/null || true)
254
+ [ -n "$CONFIG_URL" ] && BASE="$CONFIG_URL"
255
+ fi
256
+ if [ -n "$BASE" ]; then
257
+ echo "Using devaudit.base_url from sdlc-config.json: $BASE"
258
+ elif [ -n "$DEVAUDIT_BASE_URL_VAR" ]; then
259
+ BASE="$DEVAUDIT_BASE_URL_VAR"
260
+ echo "::warning::Using repo Variable DEVAUDIT_BASE_URL (deprecated in v1.23.0). Move base_url to sdlc-config.json devaudit.base_url for PR-visible config."
261
+ else
262
+ echo "::warning::No DevAudit base URL configured — skipping release registration. Set devaudit.base_url in sdlc-config.json."
263
+ fi
264
+ if [ -n "$BASE" ] && [ -z "${DEVAUDIT_API_KEY}" ]; then
265
+ echo "::error::DEVAUDIT_API_KEY (secret) must be set when a DevAudit base URL is configured."
248
266
  exit 1
249
267
  fi
250
- echo "BASE=${DEVAUDIT_BASE_URL%/}" >> "$GITHUB_ENV"
268
+ echo "BASE=${BASE%/}" >> "$GITHUB_ENV"
269
+ echo "DEVAUDIT_BASE_URL=${BASE%/}" >> "$GITHUB_ENV"
251
270
 
252
271
  - name: Determine release version
253
272
  id: version
@@ -263,6 +282,7 @@ jobs:
263
282
  echo "Release version: ${VERSION}"
264
283
 
265
284
  - name: Ensure release exists
285
+ if: env.DEVAUDIT_BASE_URL != ''
266
286
  run: |
267
287
  chmod +x scripts/upload-evidence.sh 2>/dev/null || true
268
288
  # Create the release in DevAudit (no evidence yet — just registration)
@@ -273,6 +293,7 @@ jobs:
273
293
  --git-sha ${{ github.sha }} --branch ${{ github.ref_name }} || true
274
294
 
275
295
  - name: Sync known requirements from RTM
296
+ if: env.DEVAUDIT_BASE_URL != ''
276
297
  env:
277
298
  GH_TOKEN: ${{ github.token }}
278
299
  run: |
@@ -343,13 +364,33 @@ jobs:
343
364
  # evidence — `status=failed` is itself the audit trail. `!cancelled()`
344
365
  # still guards against partial state on operator-cancel.
345
366
  # DevAudit-Installer#96.
346
- if: ${{ always() && !cancelled() && vars.DEVAUDIT_BASE_URL != '' && needs.register-release.result == 'success' }}
367
+ if: ${{ always() && !cancelled() && needs.register-release.result == 'success' }}
347
368
  env:
348
- DEVAUDIT_BASE_URL: ${{ vars.DEVAUDIT_BASE_URL }}
369
+ DEVAUDIT_BASE_URL_VAR: ${{ vars.DEVAUDIT_BASE_URL }}
349
370
  DEVAUDIT_API_KEY: ${{ secrets.DEVAUDIT_API_KEY }}
350
371
  steps:
351
372
  - uses: actions/checkout@v4
352
373
 
374
+ - name: Resolve DevAudit base URL
375
+ run: |
376
+ # Prefer sdlc-config.json devaudit.base_url over the deprecated repo
377
+ # Variable (DevAudit-Installer#156). When neither is set the upload
378
+ # step below no-ops via `if: env.DEVAUDIT_BASE_URL != ''`.
379
+ BASE=""
380
+ if [ -f sdlc-config.json ]; then
381
+ CONFIG_URL=$(jq -r '.devaudit.base_url // empty' sdlc-config.json 2>/dev/null || true)
382
+ [ -n "$CONFIG_URL" ] && BASE="$CONFIG_URL"
383
+ fi
384
+ if [ -n "$BASE" ]; then
385
+ echo "Using devaudit.base_url from sdlc-config.json: $BASE"
386
+ elif [ -n "$DEVAUDIT_BASE_URL_VAR" ]; then
387
+ BASE="$DEVAUDIT_BASE_URL_VAR"
388
+ echo "::warning::Using repo Variable DEVAUDIT_BASE_URL (deprecated in v1.23.0). Move base_url to sdlc-config.json devaudit.base_url for PR-visible config."
389
+ else
390
+ echo "::warning::No DevAudit base URL configured — skipping evidence upload. Set devaudit.base_url in sdlc-config.json."
391
+ fi
392
+ echo "DEVAUDIT_BASE_URL=${BASE%/}" >> "$GITHUB_ENV"
393
+
353
394
  - name: Download CI gate artifacts
354
395
  uses: actions/download-artifact@v4
355
396
  continue-on-error: true
@@ -352,15 +352,19 @@ jobs:
352
352
 
353
353
  mkdir -p {{WORKING_DIR_PREFIX}}ci-evidence
354
354
 
355
+ # Precise evidence_type=sast_report (matches the node template; the
356
+ # imprecise audit_log used pre-devaudit#370 made the portal's SAST and
357
+ # dependency panels show identical content — DevAudit-Installer#157).
355
358
  if [ -f {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json ]; then
356
359
  upload sast-results.json \
357
- {{PROJECT_SLUG}} _compliance-docs audit_log {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json \
360
+ {{PROJECT_SLUG}} _compliance-docs sast_report {{WORKING_DIR_PREFIX}}ci-evidence/sast-results.json \
358
361
  --category security_scan --gate-status "$STATUS_SAST" ${FLAGS}
359
362
  fi
360
363
 
364
+ # Precise evidence_type=dependency_audit (matches the node template).
361
365
  if [ -f {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json ]; then
362
366
  upload dependency-audit.json \
363
- {{PROJECT_SLUG}} _compliance-docs audit_log {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json \
367
+ {{PROJECT_SLUG}} _compliance-docs dependency_audit {{WORKING_DIR_PREFIX}}ci-evidence/dependency-audit.json \
364
368
  --category security_scan --gate-status "$STATUS_DEPAUDIT" ${FLAGS}
365
369
  fi
366
370