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

[8.7](backport #2218) Report FQDN on host.name as opt-in, enabled by feature flag #2449

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 4, 2023

This is an automatic backport of pull request #2218 done by Mergify.
Cherry-pick of be818cc has failed:

On branch mergify/bp/8.7/pr-2218
Your branch is up to date with 'origin/8.7'.

You are currently cherry-picking commit be818cc9b4.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE.txt
	modified:   Vagrantfile
	modified:   _meta/config/common.reference.p2.yml.tmpl
	new file:   changelog/fragments/1679422558-feature-flags.yaml
	modified:   elastic-agent.reference.yml
	modified:   go.mod
	modified:   go.sum
	modified:   internal/pkg/agent/application/coordinator/diagnostics_test.go
	modified:   internal/pkg/agent/application/coordinator/testdata/simple_config/elastic-agent.yml
	modified:   internal/pkg/agent/application/coordinator/testdata/simple_config/expected/components-expected.yaml
	modified:   internal/pkg/agent/application/coordinator/testdata/simple_config/expected/computed-config.yaml
	modified:   internal/pkg/agent/application/coordinator/testdata/simple_config/expected/pre-config.yaml
	modified:   internal/pkg/agent/application/gateway/fleet/fleet_gateway.go
	modified:   internal/pkg/agent/application/info/agent_metadata.go
	modified:   internal/pkg/agent/application/monitoring/v1_monitor.go
	modified:   internal/pkg/agent/cmd/enroll_cmd.go
	modified:   internal/pkg/composable/providers/host/host.go
	modified:   internal/pkg/composable/providers/host/host_test.go
	modified:   pkg/component/component.go
	modified:   pkg/component/fake/component/comp/actions.go
	modified:   pkg/component/fake/component/comp/component.go
	modified:   pkg/component/fake/component/main.go
	modified:   pkg/component/fake/shipper/actions.go
	modified:   pkg/component/fake/shipper/main.go
	modified:   pkg/component/runtime/failed.go
	modified:   pkg/component/runtime/manager_test.go
	modified:   pkg/component/runtime/state.go
	new file:   pkg/features/features.go
	new file:   pkg/features/features_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/application/application.go
	both modified:   internal/pkg/agent/application/coordinator/coordinator.go
	both modified:   internal/pkg/agent/application/coordinator/testdata/simple_config/expected/state.yaml

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot requested a review from a team as a code owner April 4, 2023 18:55
@mergify mergify bot removed the request for review from a team April 4, 2023 18:55
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 4, 2023
@elasticmachine
Copy link
Collaborator

elasticmachine commented Apr 4, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-04-06T05:01:26.634+0000

  • Duration: 17 min 50 sec

Test stats 🧪

Test Results
Failed 0
Passed 5031
Skipped 23
Total 5054

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

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

@mergify
Copy link
Contributor Author

mergify bot commented Apr 5, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.7/pr-2218 upstream/mergify/bp/8.7/pr-2218
git merge upstream/8.7
git push upstream mergify/bp/8.7/pr-2218

@mergify
Copy link
Contributor Author

mergify bot commented Apr 6, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.7/pr-2218 upstream/mergify/bp/8.7/pr-2218
git merge upstream/8.7
git push upstream mergify/bp/8.7/pr-2218

* wip

* wip

* wip

* clean up

* wip

* .

* agent.name as fqdn

* it works

* wip

* WIP - using fake input, created test, it seems to work

* finish test for feature flags

* remove debug log

* some clean up

* mage check

* fixing licenses

* it works

* it works

* remove debug logs and comments

* make notice

* fake component and shipper are built by TestMain

* fixing tests

* make notice

* adjust tests

* update elatic-agent-client

* add .exe for win binaries

* adjust fake components build

* increase test timeout

* fix tests

* adjust features pkg and don't send featuresFlag if nil

* it works

* make notice

* revert some changes

* handle error properly

* add TODO

* Set FQDN for Vagrant elastic-agent VM

Useful for testing FQDN feature; harmless otherwise

* Undoing trivial formatting changes

* Running mage fmt

* Remove personal repo from NOTICE overrides

* Sorting imports

* Fix error handling

* Fixing access

* Fixing packaging of fake component

* Update logging

* Refactoring fake component

* Allowing fmt.Print* in TestMain

* Remove redundant return

* Fixing typo in error message

* Undo unintentional changes

* Removing redundant TestMain file

* Add comment on FQDN to Vagrantfile

* Remove debug logging statements

* Making test pass

* Document feature flags configuration in reference config file

* Adding CHANGELOG entry

* Use convenience method

* Formatting

* Use convenience method from elastic-agent-libs

* Running mage update

* Fixing imports

* Reducing whitespace changes

* Reducing whitespace changes

* Reducing whitespace changes

* Reducing whitespace changes

* Restore timeout duration

* Move mutex inside struct

* Prevent mutex copying

* Fixing state diagnostics test

* Fixing components diagnostics test

* Adding features.source to components golden file

* More interesting diagnostics state test

* Log error if FQDN lookup fails and fallback to OS-reported hostname

* Bump up go-sysinfo dependency version

* Fix typos

* Fixing compile errors

* Fix tests

* Fix imports

* Fix issues lost in rebase

* Fixing more imports

* Updating NOTICE.txt

* Clarify features indentation

* Remove replace directive

* Bumping up version on elastic-agent-client dependency

* Adding test mocking DNS

* Initialize featuresIdx in same place as units' configIdx

* Updating NOTICE.txt

* Remove unnecessary nil check

* Set features in state initially

* Update features in state from checkin observed message

* Remove TODO

* Updating elatic-agent.yml test fixture to enable FQDN feature flag

* Try flipping the authoritative flag

* Remove unreliable DNS mocking test

* Set source

* Update test fixture

* Change logger

* Fixing test case

* Omit feature flags serialization from state.yaml diag file

* Updating NOTICE.txt

* Add descriptive comment on why Features is not being serialized as YAML

* Updating test fixture

* Inject logger into metadata methods

---------

Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
(cherry picked from commit be818cc)
@elasticmachine
Copy link
Collaborator

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.413% (62/63) 👍 0.026
Files 68.868% (146/212) 👍 0.148
Classes 67.98% (276/406) 👍 0.159
Methods 53.576% (854/1594) 👍 0.142
Lines 38.88% (9523/24493) 👍 0.09
Conditionals 100.0% (0/0) 💚

@ycombinator ycombinator merged commit ed4716f into 8.7 Apr 6, 2023
@ycombinator ycombinator deleted the mergify/bp/8.7/pr-2218 branch April 6, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants