Skip to content

Simplify Scope into a single include/exclude struct - #399

Merged
davidioin merged 6 commits into
mainfrom
davidioi/sdsp-477-scope-struct
Oct 22, 2026
Merged

davidioin merged 6 commits into
mainfrom
davidioi/sdsp-477-scope-struct

Conversation

@davidioin

@davidioin davidioin commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Replaces the Scope enum with a struct: include (new ScanArea, either Everything or Only(paths)) and exclude. The all/include/exclude/include_and_exclude constructors keep their signatures and scan behavior is unchanged.

The scope JSON changes to {"include":"everything","exclude":[...]} / {"include":{"only":[...]},"exclude":[...]}. Old-format JSON is now rejected instead of being read as "scan everything".

Motivation

Main motivation is to improve code clarity of scope.rs. Should simplify future maintenance work without actually changing anything related to the functionality of scopes in SDS.

Describe how you validated your changes

  • Added rule tree tests for exclude edge cases first; they pass before and after the refactor.
  • Added scope JSON tests; they failed on the old enum and pass now.

Additional Notes

SDSP-477

sds-shared-library writes scope JSON from its Java and Go bindings, so it needs the matching update in ddoghq/sds-shared-library#2094 when it bumps to this version.

@davidioin
davidioin requested a review from a team as a code owner October 13, 2026 19:06
@davidioin
davidioin requested a review from fuchsnj October 19, 2026 15:38

@fuchsnj fuchsnj 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.

Approving with small comment suggestions

Comment thread sds/src/scanner/scope.rs Resolved
Comment thread sds/src/scanner/scope.rs Resolved
@davidioin
davidioin merged commit f906e9b into main Oct 22, 2026
5 checks passed
@davidioin
davidioin deleted the davidioi/sdsp-477-scope-struct branch October 22, 2026 14:44
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.

2 participants