← 输入框|github.com|刷新
Skip to content

fix: Prevent parser startup before scanner job is visible - #3795

Open
mvanhorn wants to merge 2 commits into
secureCodeBox:mainfrom
mvanhorn:fix/3139-prevent-early-parser-start
Open

mvanhorn wants to merge 2 commits into
secureCodeBox:mainfrom
mvanhorn:fix/3139-prevent-early-parser-start

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Sep 3, 2026 •

Copy link
Copy Markdown

Description

Change checkIfAllJobsCompleted so that a list containing no Jobs is explicitly incomplete; completion must require at least one observed Job and successful status for every observed Job. Keep the existing precedence in which any BackoffLimitExceeded Job reports failure and any non-succeeded Job reports incomplete, so all three production callers (the scanner, parser, and hook reconciliation paths) remain conservative during cache-observation gaps. Extend the existing table of focused helper tests with the empty-list case, while retaining coverage for all-succeeded, mixed/incomplete, and failed lists.

The scan reconciler decides whether scanner, parser, and hook Jobs have finished through checkIfAllJobsCompleted. That helper initializes its aggregate result as completed, so an empty Job list is interpreted as successful even though no Job has reported success. During the short interval in which the controller cache has not yet observed a newly created scanner Job, this can advance the Scan to ScanCompleted and start the parser before the scanner uploads its raw result, producing an intermittent MinIO NoSuchKey error. The maintainer reproduced the rare behavior and identified this helper as the relevant decision point.

Refs #3139

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure that all your commits are signed-off and that you are added to the Contributors file.
  • Make sure that all CI finish successfully.
  • Optional (but appreciated): Make sure that all commits are Verified.

@netlify

netlify Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for docs-securecodebox ready!

Name Link
🔨 Latest commit 12fc75f
🔍 Latest deploy log https://app.netlify.com/projects/docs-securecodebox/deploys/6adc338b4eb861e21ece5100
😎 Deploy Preview https://deploy-preview-3795--docs-securecodebox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Weltraumschaf Weltraumschaf moved this from Triage to To Review in secureCodeBox Sep 3, 2026
@mvanhorn
mvanhorn force-pushed the fix/3139-prevent-early-parser-start branch from 4b936d9 to 6265550 Compare September 3, 2026 17:08
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@Reet00

Reet00 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Hi @mvanhorn,
thank you for the PR.

The suggested changes look good so far and it is probably a good idea in general to have a return statement when there are no jobs available.
However, with the provided test we cannot verify that this would solve the problem described in the issue. As mentioned in the issue, it is difficult to reproduce the error and thus difficult to test this fix. Did you have this issue in your setup and were able to fix this?

@mvanhorn

Copy link
Copy Markdown
Author

Thanks for reviewing. I agree that the current test does not verify the issue described. I wasn't able to reproduce the failure reliably in my setup, so I can't claim this test demonstrates that the change fixes the original problem. The return statement is still intended to handle the no-jobs case safely, but I'll add more context or a targeted regression test if I can identify a reproducible failure path.

@Reet00

Reet00 commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Hi, Thank you for the fast respond:)
We can merge your PR without closing the issue for now. If you can provide a reliable test for the original issue, you're welcome to open a new issue.
Also, please note the instructions in the CONTRIBUTORS.md file. You need to add your name to the list and also sign-off your comments before we are able to merge your contributions.

Refs secureCodeBox#3139

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
@mvanhorn
mvanhorn force-pushed the fix/3139-prevent-early-parser-start branch from 6265550 to 12fc75f Compare October 24, 2026 04:26
@sonarqubecloud

Copy link
Copy Markdown

@mvanhorn

Copy link
Copy Markdown
Author

@Reet00 thanks. Both commits now carry a Signed-off-by line, and my name is added to CONTRIBUTORS.md (12fc75f). The fix commit now references #3139 with Refs instead of Fixes. go vet and the fast-tagged tests in operator/controllers/execution/scans pass locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Review

Development

Successfully merging this pull request may close these issues.

2 participants