Skip to content

fix(download): guard entrypoint rejections; refresh architecture docs#30

Merged
Arthurvdv merged 1 commit into
mainfrom
fix/download-task-review
Jun 24, 2026
Merged

fix(download): guard entrypoint rejections; refresh architecture docs#30
Arthurvdv merged 1 commit into
mainfrom
fix/download-task-review

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

Code review of the active ALCopsDownloadAnalyzers task wrapper, shared/ helpers, and build/packaging config. Deprecated tasks (install-analyzers, detect-tfm-*) and @alcops/core were out of scope.

Changes

  • Bug — entrypoint error handling (tasks/download/src/index.ts): run() was called without a .catch(). Today the task-runner wraps everything in try/catch, but any future throw outside it would exit 0 and ADO would mark the task succeeded despite failure. Added the same .catch(... process.exit(1)) guard the other tasks already use.
  • Doc — masking limitation (shared/log-inputs.ts): noted that logTaskInputs masks only secureString-typed inputs, so future secret inputs must be declared with a sensitive type to be redacted.
  • Doc — architecture drift (.github/copilot-instructions.md): the file described an obsolete layout (referencing shared/http-client.ts, shared/nuget-registration.ts, tasks/install-analyzers/src/nuget-api.ts, a scripts/ dir, vi.mock('https') — none of which exist). Rewrote to reflect that all logic now lives in @alcops/core and shared/ holds only logger.ts + log-inputs.ts.

Considered and intentionally dropped

  • @alcops/core version pin: ^0.1.2 matches npm latest (0.1.2). No drift — 0.2.0 is unreleased local source.
  • Wrapper-side input validation: rejected to avoid duplicating the valid-TFM/detectFrom lists across task.json, the wrapper, and @alcops/core. Core is the single source of truth and already validates.

Verification

  • npm run lint — clean
  • npm run build (tsc) — clean
  • npm test — 46/46 pass
  • npm run bundle — succeeds; .catch guard confirmed present in tasks/download/dist/index.js

- download/index.ts: add .catch handler so unexpected rejections exit
  non-zero (and fail the ADO task) instead of silently exiting 0
- log-inputs.ts: document that masking only applies to secureString inputs
- copilot-instructions.md: correct architecture drift (logic now lives in
  @alcops/core; remove obsolete shared/nuget modules; fix task count,
  mocking patterns, and directory listing)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Arthurvdv Arthurvdv merged commit 8480c02 into main Jun 24, 2026
3 checks passed
@Arthurvdv Arthurvdv deleted the fix/download-task-review branch June 24, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant