Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(inputs.win_wmi): Cleanup and refactor code #14965

Merged
merged 7 commits into from
Mar 12, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Mar 11, 2024

Summary

Cleanup code and factor out query-code to own file.

Checklist

  • No AI generated code was used in this PR

Related issues

related to #14942

@telegraf-tiger telegraf-tiger bot added chore plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Mar 11, 2024
@srebhan srebhan added area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Mar 11, 2024
@srebhan srebhan removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 11, 2024
@srebhan srebhan assigned srebhan and unassigned powersj and DStrand1 Mar 11, 2024
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 11, 2024
@srebhan srebhan assigned powersj and DStrand1 and unassigned srebhan Mar 11, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

I think I'm +1 if this is just copy/paste and whitespace changes, but my eyes are not good enough to go back and forth right now.

[ACL]: https://learn.microsoft.com/en-us/windows/win32/wmisdk/access-to-wmi-namespaces
[WMIdoc]: https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page

## Global configuration options <!-- @/docs/includes/plugin_config.md -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this whole file whitespace changes?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this is line-ending conversion from CRLF to LF.

@@ -0,0 +1,158 @@
//go:build windows
Copy link
Contributor

Choose a reason for hiding this comment

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

Any logic changes or just copy and paste?

Copy link
Member Author

Choose a reason for hiding this comment

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

The code is only required in the windows part as the non-windows part is an empty hull for config generation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right I understand the build tags ;) My question was around all the code now in this query file. Were there any logic changes to it? Or did you just copy and paste it out of the previous file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just copy-and-paste plus dissolving some functions and copy the code to the corresponding calling location.

@powersj powersj removed their assignment Mar 12, 2024
@DStrand1 DStrand1 merged commit 8183d47 into influxdata:master Mar 12, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.30.1 milestone Mar 12, 2024
powersj pushed a commit that referenced this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) chore plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants