Skip to content

fix: scan step stubs return ErrNotImplemented - #97

Merged
intel352 merged 1 commit into
mainfrom
fix/scan-steps-err-not-implemented
Feb 23, 2026
Merged

intel352 merged 1 commit into
mainfrom
fix/scan-steps-err-not-implemented

Conversation

@intel352

Copy link
Copy Markdown
Contributor

Summary

Closes #67

The three security scan pipeline steps (scan_sast, scan_container, scan_deps) previously executed silently without performing any actual scanning work, returning a successful result with an empty ScanResult. This gave false confidence in CI/CD pipelines — a pipeline using these steps would appear to pass security scans when no scanning occurred.

  • Add module/errors.go with ErrNotImplemented sentinel error
  • Update Execute() on all three scan steps to return fmt.Errorf("<step_type> step %q: %w", name, ErrNotImplemented) so callers can use errors.Is() to check the specific error
  • Remove dead buildCommand() helpers and associated unused imports that were only called from Execute()
  • Add documentation comments on each type and Execute() method explaining the limitation
  • Add module/pipeline_step_scan_test.go with three tests verifying each step's Execute returns a wrapped ErrNotImplemented

Test plan

  • go build ./... passes
  • golangci-lint run reports 0 issues
  • go test ./module/... passes — new tests TestScanSASTStep_ExecuteReturnsErrNotImplemented, TestScanContainerStep_ExecuteReturnsErrNotImplemented, TestScanDepsStep_ExecuteReturnsErrNotImplemented all pass
  • Existing plugins/cicd tests continue to pass (step factories still register correctly)
  • Pre-push hook passes

🤖 Generated with Claude Code

Scan steps (scan_sast, scan_container, scan_deps) previously succeeded
silently without performing any work, giving false confidence in CI/CD
pipelines. Now they return a wrapped ErrNotImplemented sentinel error so
callers can detect the unimplemented state via errors.Is().

Changes:
- Add module/errors.go with ErrNotImplemented sentinel
- Update Execute() on ScanSASTStep, ScanContainerStep, ScanDepsStep to
  return fmt.Errorf("<type> step %q: %w", name, ErrNotImplemented)
- Remove dead buildCommand() helpers and unused code paths
- Add documentation notes on each type and Execute method
- Add module/pipeline_step_scan_test.go with three tests verifying that
  each Execute returns a wrapped ErrNotImplemented

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings February 23, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #67 by making three security scan pipeline steps (scan_sast, scan_container, scan_deps) explicitly fail with ErrNotImplemented instead of silently succeeding without performing actual scans. This prevents false confidence in CI/CD pipelines where these stubs might be used.

Changes:

  • Introduced ErrNotImplemented sentinel error to clearly signal unimplemented functionality
  • Modified all three scan step Execute() methods to return wrapped ErrNotImplemented
  • Removed dead code (buildCommand() helpers) and unused imports that supported the previous silent no-op behavior
  • Added comprehensive documentation explaining the limitation
  • Added unit tests verifying the error behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
module/errors.go New file defining ErrNotImplemented sentinel error for unimplemented steps
module/pipeline_step_scan_sast.go Returns ErrNotImplemented, removes dead buildCommand() and unused strings import, adds documentation
module/pipeline_step_scan_deps.go Returns ErrNotImplemented, removes dead buildCommand() and unused strings import, adds documentation
module/pipeline_step_scan_container.go Returns ErrNotImplemented, removes dead buildCommand(), adds documentation (keeps strings import for validateSeverity)
module/pipeline_step_scan_test.go New test file with three tests verifying each scan step returns wrapped ErrNotImplemented

@intel352
intel352 merged commit f1fc56c into main Feb 23, 2026
16 of 18 checks passed
@intel352
intel352 deleted the fix/scan-steps-err-not-implemented branch February 23, 2026 05:26
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.

Scan step stubs should return ErrNotImplemented (pipeline_step_scan_*.go)

2 participants