- Added `MongoAdvisoryObservationEventPublisher` and `NatsAdvisoryObservationEventPublisher` for event publishing. - Registered `IAdvisoryObservationEventPublisher` to choose between NATS and MongoDB based on configuration. - Introduced `MongoAdvisoryObservationEventOutbox` for outbox pattern implementation. - Updated service collection to include new event publishers and outbox. - Added a new hosted service `AdvisoryObservationTransportWorker` for processing events. feat: Update project dependencies - Added `NATS.Client.Core` package to the project for NATS integration. test: Add unit tests for AdvisoryLinkset normalization - Created `AdvisoryLinksetNormalizationConfidenceTests` to validate confidence score calculations. fix: Adjust confidence assertion in `AdvisoryObservationAggregationTests` - Updated confidence assertion to allow a range instead of a fixed value. test: Implement tests for AdvisoryObservationEventFactory - Added `AdvisoryObservationEventFactoryTests` to ensure correct mapping and hashing of observation events. chore: Configure test project for Findings Ledger - Created `Directory.Build.props` for test project configuration. - Added `StellaOps.Findings.Ledger.Exports.Unit.csproj` for unit tests related to findings ledger exports. feat: Implement export contracts for findings ledger - Defined export request and response contracts in `ExportContracts.cs`. - Created various export item records for findings, VEX, advisories, and SBOMs. feat: Add export functionality to Findings Ledger Web Service - Implemented endpoints for exporting findings, VEX, advisories, and SBOMs. - Integrated `ExportQueryService` for handling export logic and pagination. test: Add tests for Node language analyzer phase 22 - Implemented `NodePhase22SampleLoaderTests` to validate loading of NDJSON fixtures. - Created sample NDJSON file for testing. chore: Set up isolated test environment for Node tests - Added `node-isolated.runsettings` for isolated test execution. - Created `node-tests-isolated.sh` script for running tests in isolation.
2.0 KiB
2.0 KiB
Scanner PREP — Node Analyzer Isolated Runner (22-001)
Date: 2025-11-20 Owner: Node Analyzer Guild Scope: Requirements and plan to provide an isolated/scoped runner so targeted Node analyzer tests complete without whole-solution fan‑out.
Goals
- Enable
StellaOps.Scanner.Analyzers.Lang.Node.Teststo run deterministically without restoring/building the entire solution. - Reduce CI/local runtime (<5 min) and contention during restores.
- Keep offline/air-gap posture: rely only on
local-nugets/+ repo fixtures; no external fetches.
Proposed approach
- Scoped solution file
- Create
src/Scanner/StellaOps.Scanner.Analyzers.Node.slnfincluding only Node analyzer projects + their direct deps (StellaOps.Scanner.Analyzers.Lang.Node, tests, shared test utilities). - CI job uses
dotnet test --solution St...Node.slnf --no-restore --no-buildafter targeted restore.
- Create
- Isolated restore cache
- Pre-populate
local-nugets/via existing offline feed; add msbuild propertyRestorePackagesPath=$(RepoRoot)/offline/packagesto avoid global cache churn.
- Pre-populate
- Test shim
- Add runsettings to disable collectors that trigger solution-wide discovery; set
RunConfiguration.DisableAppDomain=truefor determinism.
- Add runsettings to disable collectors that trigger solution-wide discovery; set
- Tarball/pnpm/Yarn PnP fixtures
- Move heavy fixtures under
src/Scanner/__Tests/Fixtures/node/and reference via deterministic VFS layer; no temp extraction outside repo.
- Move heavy fixtures under
- Entry point
- New
scripts/scanner/node-tests-isolated.shwrapper: restore scoped solution, then rundotnet testwith/m:1and explicit test filters as needed.
- New
Deliverables for implementation task
- Add
.slnf, runsettings, and wrapper script as above. - Update CI pipeline (Scanner) to include isolated target; keep full solution tests separate.
- Document usage in
src/Scanner/__Tests/README.md.
Blocking items
- None identified; all inputs are local to the repo/offline feeds.
This note satisfies PREP-SCANNER-ANALYZERS-NODE-22-001-NEEDS-ISOL by defining the isolated runner plan and artefact locations.