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

fix: agent config plugin serialising only public fields #249

Merged
merged 2 commits into from Jan 15, 2021

Conversation

varas
Copy link
Contributor

@varas varas commented Nov 24, 2020

  • agent-config plugin serialising now avoids non public config fields.
  • agent-config plugin now submit inventory items in config format, ie. snake-case as YAML (instead of previous camel-case variable name).

@varas varas requested a review from a team November 24, 2020 17:59
@varas varas force-pushed the feat_agt-cfg-serialize-only-publics branch 2 times, most recently from b70d2c8 to 306b88a Compare November 24, 2020 18:02
@coveralls
Copy link

coveralls commented Nov 24, 2020

Pull Request Test Coverage Report for Build 487640757

  • 11 of 15 (73.33%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 58.131%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/config/config.go 1 2 50.0%
pkg/plugins/agent_config.go 10 13 76.92%
Totals Coverage Status
Change from base Build 482998362: -0.01%
Covered Lines: 11425
Relevant Lines: 19654

💛 - Coveralls

carlosroman
carlosroman previously approved these changes Nov 26, 2020
Copy link
Contributor

@carlosroman carlosroman left a comment

Choose a reason for hiding this comment

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

LGTM 👍

continue
}
firstLetter := rune(name[0])
if unicode.IsLower(firstLetter) {
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we filter them by the "public" annotation?
https://github.com/newrelic/infrastructure-agent/blob/master/pkg/config/config.go#L64
In case that a config option needs to be public in the code but we don't wan't to send the value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that "public" annotation belongs to the past agent closed source history, where we wanted to know whether a config option was meant to be publicly announced.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BTW do we still use this "public" anno for something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used for discriminating which fields should be logged and now we'll be using it for agent config inventory plugin.

cristianciutea
cristianciutea previously approved these changes Dec 4, 2020
Copy link
Contributor

@cristianciutea cristianciutea left a comment

Choose a reason for hiding this comment

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

@josemore josemore added this to Ready for review in CAOS: Our Daily Bread Dec 10, 2020
@varas varas dismissed stale reviews from cristianciutea and carlosroman via 83797d1 January 12, 2021 10:14
@varas varas force-pushed the feat_agt-cfg-serialize-only-publics branch from ac3de28 to 83797d1 Compare January 12, 2021 10:14
@varas varas changed the title feat: agent config plugin serialising only public fields fix: agent config plugin serialising only public fields Jan 12, 2021
cristianciutea
cristianciutea previously approved these changes Jan 12, 2021
Copy link
Contributor

@cristianciutea cristianciutea left a comment

Choose a reason for hiding this comment

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

LGTM

@varas varas force-pushed the feat_agt-cfg-serialize-only-publics branch from 83797d1 to 90f732f Compare January 12, 2021 10:41
@varas varas moved this from Ready For Review to In Progress in CAOS: Our Daily Bread Jan 13, 2021
@varas varas force-pushed the feat_agt-cfg-serialize-only-publics branch from 90f732f to f90383f Compare January 15, 2021 10:09
@varas varas moved this from In Progress to Ready For Review in CAOS: Our Daily Bread Jan 15, 2021
@varas varas merged commit 2d36da6 into master Jan 15, 2021
@varas varas deleted the feat_agt-cfg-serialize-only-publics branch January 15, 2021 10:21
@varas varas moved this from Ready For Review to Ready For Release in CAOS: Our Daily Bread Jan 15, 2021
@varas varas moved this from Ready For Release to Done in CAOS: Our Daily Bread Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants