Skip to content

[filebeat][fix] remove duplicate nil check in gzipFile#49760

Open
barkhayot wants to merge 1 commit intoelastic:mainfrom
barkhayot:fix/remove-redundant-double-err-check
Open

[filebeat][fix] remove duplicate nil check in gzipFile#49760
barkhayot wants to merge 1 commit intoelastic:mainfrom
barkhayot:fix/remove-redundant-double-err-check

Conversation

@barkhayot
Copy link
Copy Markdown

  • remove duplicate nil check in gzipFile

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@barkhayot barkhayot marked this pull request as ready for review March 28, 2026 06:49
@barkhayot barkhayot requested a review from a team as a code owner March 28, 2026 06:49
@barkhayot barkhayot requested review from leehinman and mauri870 March 28, 2026 06:49
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: acbe62cc-d159-419d-b61c-17a225fdcae3

📥 Commits

Reviewing files that changed from the base of the PR and between 12e4652 and ada16c5.

📒 Files selected for processing (1)
  • filebeat/beater/diagnostics.go

📝 Walkthrough

Walkthrough

The gzipFile function in filebeat/beater/diagnostics.go was refactored to simplify error handling for the io.Copy call. A redundant nested if err != nil check was removed, replacing it with a direct return statement that wraps the error using fmt.Errorf. The change reduces code by two net lines and maintains equivalent functionality with cleaner error handling logic.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@barkhayot barkhayot changed the title [beater][fix] remove duplicate nil check in gzipFile [beater][fix] remove duplicatenil check in gzipFile Mar 28, 2026
@barkhayot barkhayot changed the title [beater][fix] remove duplicatenil check in gzipFile [beater][fix] remove duplicate nil check in gzipFile Mar 28, 2026
@barkhayot barkhayot changed the title [beater][fix] remove duplicate nil check in gzipFile [filebeat][fix] remove duplicate nil check in gzipFile Mar 28, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 28, 2026

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @barkhayot? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Mar 28, 2026
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 28, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

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

Labels

Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants