Repository navigation
Conversation
🤖 GitHub commentsJust comment with:
|
|
💚 CLA has been signed |
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
/test |
|
Thanks for the automated checks. I have now signed the Elastic Contributor Agreement; the original CLA check ran before that signature. I also requested a |
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
marc-gr
left a comment
There was a problem hiding this comment.
The fix is correct. fmt.Errorf("...%w", nil) still returns a non-nil error, so getFileInfo always failed. That left watchedDirs empty for recursive: false, and isWatched then rejected every event. The new code returns nil, err on failure and info, nil on success.
Two non-blocking suggestions are inline: a test that covers isWatched on a non-recursive reader, and formatting in the changelog fragment. The test is Darwin-only, so the macOS CI run is the first real execution. Please check that result before merging.
|
Thanks for reviewing this. The macOS unit-test jobs for both the regular and x-pack Auditbeat packages have passed, confirming the non-recursive FSEvents path. I will address the minor changelog formatting suggestion; no functional changes are needed beyond the fix already in this PR. |
Add a Darwin regression test for the user-visible isWatched behavior and include issue and pull request metadata in the changelog fragment. Signed-off-by: Slai.life <[email protected]>
|
I’m rechecking the current macOS golangci-lint failure against the current head before making any follow-up. I’ll only push a change if the failure is attributable to this PR. |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
The forbidigo linter rejects logp.NewLogger in new code. Use logptest.NewTestingLogger instead, which also routes log output through the test's t.Log. Assisted-By: Claude Code
|
@Mergifyio backport 9.6 9.5 9.4 8.19 |
✅ Backports have been createdDetails
|
* fix(auditbeat): restore non-recursive macOS FSEvents * chore: format Auditbeat changelog fragment * test(auditbeat): cover non-recursive FSEvents watches Add a Darwin regression test for the user-visible isWatched behavior and include issue and pull request metadata in the changelog fragment. * auditbeat/module/file_integrity: use testing logger in FSEvents test The forbidigo linter rejects logp.NewLogger in new code. Use logptest.NewTestingLogger instead, which also routes log output through the test's t.Log. Assisted-By: Claude Code --------- (cherry picked from commit ee49816) Signed-off-by: Slai.life <[email protected]> Co-authored-by: Slai.life <[email protected]> Co-authored-by: Marc Guasch <[email protected]> Co-authored-by: Marc Guasch <[email protected]>
* fix(auditbeat): restore non-recursive macOS FSEvents * chore: format Auditbeat changelog fragment * test(auditbeat): cover non-recursive FSEvents watches Add a Darwin regression test for the user-visible isWatched behavior and include issue and pull request metadata in the changelog fragment. * auditbeat/module/file_integrity: use testing logger in FSEvents test The forbidigo linter rejects logp.NewLogger in new code. Use logptest.NewTestingLogger instead, which also routes log output through the test's t.Log. Assisted-By: Claude Code --------- (cherry picked from commit ee49816) Signed-off-by: Slai.life <[email protected]> Co-authored-by: Slai.life <[email protected]> Co-authored-by: Marc Guasch <[email protected]> Co-authored-by: Marc Guasch <[email protected]>
* fix(auditbeat): restore non-recursive macOS FSEvents * chore: format Auditbeat changelog fragment * test(auditbeat): cover non-recursive FSEvents watches Add a Darwin regression test for the user-visible isWatched behavior and include issue and pull request metadata in the changelog fragment. * auditbeat/module/file_integrity: use testing logger in FSEvents test The forbidigo linter rejects logp.NewLogger in new code. Use logptest.NewTestingLogger instead, which also routes log output through the test's t.Log. Assisted-By: Claude Code --------- (cherry picked from commit ee49816) Signed-off-by: Slai.life <[email protected]> Co-authored-by: Slai.life <[email protected]> Co-authored-by: Marc Guasch <[email protected]> Co-authored-by: Marc Guasch <[email protected]>
* fix(auditbeat): restore non-recursive macOS FSEvents * chore: format Auditbeat changelog fragment * test(auditbeat): cover non-recursive FSEvents watches Add a Darwin regression test for the user-visible isWatched behavior and include issue and pull request metadata in the changelog fragment. * auditbeat/module/file_integrity: use testing logger in FSEvents test The forbidigo linter rejects logp.NewLogger in new code. Use logptest.NewTestingLogger instead, which also routes log output through the test's t.Log. Assisted-By: Claude Code --------- (cherry picked from commit ee49816) Signed-off-by: Slai.life <[email protected]> Co-authored-by: Slai.life <[email protected]> Co-authored-by: Marc Guasch <[email protected]> Co-authored-by: Marc Guasch <[email protected]>
Proposed commit message
Return successful
os.Lstatcalls from the macOS FSEvents file-integrity reader without manufacturing an error. The previousfmt.Errorfcall returned a non-nil error even whenos.Lstatsucceeded, so non-recursive watches never populatedwatchedDirsand dropped all realtime events.Checklist
./changelog/fragments.Disruptive User Impact
None. This restores the intended non-recursive macOS file-integrity behavior.
How to test this PR locally
The added regression test is Darwin-only. The changed package can be tested with:
Related issues
Closes #54257
AI assistance
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content. The implementation was reviewed against the repository source and contribution instructions.