Repository navigation
fix: describe baseline sample scans instead of reporting them as failed - #1249
Merged
Merged
Conversation
Deploying edgewatch with
|
| Latest commit: |
5f70149
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3b86dbe1.edgewatch-cpd.pages.dev |
| Branch Preview URL: | https://fix-baseline-sample-comparis.edgewatch-cpd.pages.dev |
crypt0rr
force-pushed
the
fix/baseline-sample-comparison-state
branch
from
October 7, 2026 17:21
82d0c78 to
b49f520
Compare
Managed scans record their comparison outcome when they are finalized, in a new scans.comparison column added by schema 65: compared, baseline_sample, baseline_established, or not_compared. The job scan detail and changes endpoints report comparison_state from that outcome, so a successful scan that ran while the job was learning its baseline is a baseline sample, the sample that completed the baseline says it established it, and neither is later diffed against a baseline that did not exist when it ran. Failed, timed-out and canceled scans, and results kept without a comparison, are not_compared. Only rows recorded before schema 65 keep the current_baseline_legacy fallback. The console describes each state, keeping the failure copy for scans that did not complete. The job guide explains scan comparison states, and the API, database compatibility and security notes cover the new values and schema 65. Fixes #1224
crypt0rr
force-pushed
the
fix/baseline-sample-comparison-state
branch
from
October 7, 2026 17:31
b49f520 to
5f70149
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Successful baseline-learning scans are no longer described as "did not complete successfully", and a scan's comparison result no longer changes over time (#1224).
Schema 65
Adds
scans.comparison TEXT NOT NULL DEFAULT '', written when a managed scan is finalized:comparedbaseline_samplebaseline_establishednot_compared''The column is added only when missing, as schemas 59 and 60 were, and its values are validated in Go. A CHECK constraint is deliberately not used, because changing one later would mean rebuilding the scans table.
Backup and restore copy the database file, and a test confirms the value survives both.
API (
jobScanandjobScanChangesshare one resolver)comparison_statecomparison_sourcesuccessorincompletenot_comparednonecomparedcompared, with the stored scan-time changesscan_timebaseline_sample, no changesnonebaseline_establishednonenot_comparednot_comparednone''current_baseline_legacyScan objects also gain an optional
comparisonfield, left out for legacy rows.Console copy
Docs
database-compatibility.mdgets a schema 65 entry ("introduced in v0.26.0").api-compatibility.mdgains a comparison-states table.SECURITY.mdis updated.Compatibility
./databackup, as for other schema changes.comparison_statevaluesbaseline_sampleandbaseline_established, plus an optionalcomparisonfield on scans.Validation
gofmt,go vet ./...go test -race:internal/engine,internal/web,internal/app,internal/model;internal/store../scripts/check-schema-docs.sh: schema documentation matches version 65.npm run lint, andnpm run test:coveragewith its gates.maingave 100% for frontend lines and 96.1% for Go (minimum 80%).npm --prefix docs run buildmain: Vitest (45 files, 485 tests), and the engine, web, store, app and schema checks again.New tests:
Samples: 2: sample, established, compared, failed, reset, and an incomplete scan while learning.Fixes #1224