Skip to content

Conversation

@rosecodym
Copy link
Contributor

@rosecodym rosecodym commented Nov 18, 2025

Description:

Chunk.Verify is an odd field - it originally conveys whether a source is going to run with verification, but then, at a certain point in the scanning pipeline, is mutated such that it instead indicates whether the chunk should be scanned with verification - which is not solely dependent on the source's verify flag. This is unnecessarily difficult to understand and maintain. This PR separates those two pieces of information into two flags:

  • Chunk.Verify has been renamed to Chunk.SourceVerify
  • It is no longer mutated; instead "should this chunk's secrets be verified?" is now captured by a new field on detectableChunk

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

rosecodym added a commit that referenced this pull request Nov 24, 2025
I was poking around at a refactor idea (in #4558) and realized that it had no test coverage. This PR adds that test coverage. I think I uncovered a bug in the process - see a comment in one of the tests.
@rosecodym rosecodym marked this pull request as ready for review November 24, 2025 22:38
@rosecodym rosecodym requested a review from a team November 24, 2025 22:38
@rosecodym rosecodym requested review from a team as code owners November 24, 2025 22:38
Copy link
Contributor

@mcastorina mcastorina left a comment

Choose a reason for hiding this comment

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

Love this! I always found it confusing the two uses of "verify".

Why does a source need this information anyway, though? Could we lift this up a level and centralize it in the SourceManager like we do with JobID here (+2 other locations in that file)?

chunk.JobID = source.JobID()
report.ReportChunk(nil, chunk)
s.outputChunks <- chunk

Also, this would be a breaking change to enterprise sources, right?

@camgunz
Copy link
Contributor

camgunz commented Dec 1, 2025

Re: Miccah's comment, we can do a bridging change where we support both fields in enterprise, do the cutover, then remove the old field.

@rosecodym
Copy link
Contributor Author

Love this! I always found it confusing the two uses of "verify".

Why does a source need this information anyway, though? Could we lift this up a level and centralize it in the SourceManager like we do with JobID here (+2 other locations in that file)?

chunk.JobID = source.JobID()
report.ReportChunk(nil, chunk)
s.outputChunks <- chunk

Also, this would be a breaking change to enterprise sources, right?

Yeah, I have idle plans to change all of this even more aggressively. I want to take things very slow, though, and do it as a bunch of smaller changes.

It will break enterprise sources, but the required change is simple enough that I was planning to make it immediately after merging this as part of the dependency update.

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.

6 participants