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

[Elastic Agent] Rename *ConfigChange to PolicyChange #20779

Merged
merged 9 commits into from
Sep 29, 2020

Conversation

ph
Copy link
Contributor

@ph ph commented Aug 25, 2020

This rename the ConfigChagne to PolicyChange for:

  • The internal type for the actions.
  • The handler
  • The introspections

This depends on change on Kibana to return the new Type and the new
"Policy" key.

The kibana API need to be adjusted to send the right action type and the right fields.

What does this PR do?

Why is it important?

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

This rename the ConfigChagne to PolicyChange for:

- The internal type for the actions.
- The handler
- The introspections

This depends on change on Kibana to return the new Type and the new
"Policy" key.
@ph ph self-assigned this Aug 25, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ingest-management (Team:Ingest Management)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 25, 2020
@ph ph marked this pull request as draft August 25, 2020 18:10
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 25, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Started by user Michal Pristas, Replayed #7]

  • Start Time: 2020-09-29T14:06:17.761+0000

  • Duration: 66 min 32 sec

Test stats 🧪

Test Results
Failed 0
Passed 19867
Skipped 1798
Total 21665

Steps errors

Expand to view the steps failures

  • Name: Terraform Apply on x-pack/metricbeat/module/aws

    • Description:

    • Duration: 0 min 2 sec

    • Start Time: 2020-09-29T14:33:59.344+0000

    • log

  • Name: Terraform Apply on x-pack/metricbeat/module/aws

    • Description:

    • Duration: 0 min 2 sec

    • Start Time: 2020-09-29T14:34:07.487+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-29T15:10:57.061Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-09-29T15:10:57.150Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-20779-8/source/source.tgz
[2020-09-29T15:10:57.168Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-20779-8/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-20779/source.tgz
[2020-09-29T15:11:10.326Z] + tar --version
[2020-09-29T15:11:10.629Z] + tar -xpf source.tgz
[2020-09-29T15:11:23.196Z] + rm source.tgz
[2020-09-29T15:11:23.258Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats
[2020-09-29T15:11:23.269Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/uncategorized-1601389803864
[2020-09-29T15:11:23.331Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/libbeat-stress-tests-1601390050350
[2020-09-29T15:11:23.369Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/winlogbeat-crosscompile-1601390121828
[2020-09-29T15:11:23.407Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-elastic-agent-build-1601390142176
[2020-09-29T15:11:23.452Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/journalbeat-unitTest-1601390146481
[2020-09-29T15:11:23.500Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/auditbeat-crosscompile-1601390167509
[2020-09-29T15:11:23.538Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-dockerlogbeat-build-1601390192858
[2020-09-29T15:11:23.576Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-functionbeat-build-1601390248561
[2020-09-29T15:11:23.615Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/libbeat-crosscompile-1601390318259
[2020-09-29T15:11:23.659Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/packetbeat-build-1601390352152
[2020-09-29T15:11:23.706Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-unitTest-1601390403606
[2020-09-29T15:11:23.763Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/auditbeat-windows-windows-2019-1601390458194
[2020-09-29T15:11:23.812Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-elastic-agent-windows-windows-2019-1601390487708
[2020-09-29T15:11:23.861Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/heartbeat-build-1601390507486
[2020-09-29T15:11:23.906Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-auditbeat-build-1601390511059
[2020-09-29T15:11:23.950Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/heartbeat-windows-windows-2019-1601390540154
[2020-09-29T15:11:23.994Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-auditbeat-windows-windows-2019-1601390542511
[2020-09-29T15:11:24.041Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-winlogbeat-build-windows-2019-1601390573779
[2020-09-29T15:11:24.083Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/auditbeat-build-1601390598430
[2020-09-29T15:11:24.129Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/winlogbeat-windows-windows-2019-1601390652636
[2020-09-29T15:11:24.167Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-filebeat-windows-windows-2019-1601390685990
[2020-09-29T15:11:24.208Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-libbeat-build-1601390692861
[2020-09-29T15:11:24.249Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/generator-metricbeat-test-1601390701685
[2020-09-29T15:11:24.418Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-functionbeat-windows-windows-2019-1601390729959
[2020-09-29T15:11:24.475Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/filebeat-windows-windows-2019-1601390731840
[2020-09-29T15:11:24.526Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/generator-beat-test-1601390745040
[2020-09-29T15:11:24.565Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/auditbeat-macos-macosx-1601390771113
[2020-09-29T15:11:24.609Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/packetbeat-windows-windows-2019-1601390776173
[2020-09-29T15:11:24.651Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-crosscompile-1601390850482
[2020-09-29T15:11:24.691Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-metricbeat-windows-windows-2019-1601390891360
[2020-09-29T15:11:24.733Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-windows-windows-2019-1601390925588
[2020-09-29T15:11:24.774Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/filebeat-macos-macosx-1601390975967
[2020-09-29T15:11:24.826Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/generator-macos-metricbeat-macosx-1601390976371
[2020-09-29T15:11:24.874Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/generator-macos-beat-macosx-1601391062788
[2020-09-29T15:11:24.922Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-auditbeat-macos-macosx-1601391171286
[2020-09-29T15:11:24.963Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-elastic-agent-macos-macosx-1601391217393
[2020-09-29T15:11:25.008Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-macos-macosx-1601391318925
[2020-09-29T15:11:25.059Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/packetbeat-macos-macosx-1601391323300
[2020-09-29T15:11:25.103Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-filebeat-macos-macosx-1601391411742
[2020-09-29T15:11:25.151Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-functionbeat-macos-macosx-1601391456796
[2020-09-29T15:11:25.195Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/filebeat-build-1601391468575
[2020-09-29T15:11:25.241Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/heartbeat-macos-macosx-1601391571601
[2020-09-29T15:11:25.285Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-metricbeat-macos-macosx-1601391647312
[2020-09-29T15:11:25.330Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/libbeat-build-1601391707359
[2020-09-29T15:11:25.380Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/x-pack-filebeat-build-1601391899024
[2020-09-29T15:11:25.421Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-goIntegTest-1601392155262
[2020-09-29T15:11:25.469Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-pythonIntegTest-1601392232854
[2020-09-29T15:11:25.817Z] + cat
[2020-09-29T15:11:25.817Z] + /usr/local/bin/runbld ./runbld-test-reports --job-name elastic+beats+pull-request
[2020-09-29T15:11:25.817Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-29T15:11:32.417Z] runbld>>> runbld started
[2020-09-29T15:11:32.417Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-29T15:11:34.335Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-29T15:11:34.335Z] runbld>>> Matches in the system config:
[2020-09-29T15:11:34.335Z] runbld>>> - Matched ^elastic\+beats
[2020-09-29T15:11:34.335Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-29T15:11:35.726Z] runbld>>> Debug logging enabled.
[2020-09-29T15:11:35.726Z] runbld>>> Storing result
[2020-09-29T15:11:35.726Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-29T15:11:35.726Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200929151135-FB6BF9CC
[2020-09-29T15:11:35.726Z] runbld>>> Adding system facts.
[2020-09-29T15:11:36.682Z] runbld>>> Adding vcs info for the latest commit:  4bcd039690ea1e0ee360fc9c29966cf2f9b87b1b
[2020-09-29T15:11:36.682Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-09-29T15:11:36.945Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-09-29T15:11:36.945Z] + echo 'Processing JUnit reports with runbld...'
[2020-09-29T15:11:36.945Z] Processing JUnit reports with runbld...
[2020-09-29T15:11:37.207Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-09-29T15:11:37.207Z] runbld>>> DURATION: 30ms
[2020-09-29T15:11:37.207Z] runbld>>> STDOUT: 40 bytes
[2020-09-29T15:11:37.207Z] runbld>>> STDERR: 49 bytes
[2020-09-29T15:11:37.207Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-09-29T15:11:37.207Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20779
[2020-09-29T15:11:38.151Z] runbld>>> Storing build metadata: 
[2020-09-29T15:11:38.151Z] runbld>>> Adding test report.
[2020-09-29T15:11:38.151Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats
[2020-09-29T15:11:39.097Z] runbld>>> Found 119 test output files
[2020-09-29T15:11:39.360Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-goIntegTest-1601392155262/metricbeat/build/TEST-go-integration-graphite.xml
[2020-09-29T15:11:39.622Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20779/src/github.com/elastic/beats/metricbeat-goIntegTest-1601392155262/metricbeat/build/TEST-go-integration-windows.xml
[2020-09-29T15:11:42.950Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 21665 Skipped: 1542
[2020-09-29T15:11:42.950Z] runbld>>> Storing result
[2020-09-29T15:11:42.950Z] runbld>>> FAILURES: 0
[2020-09-29T15:11:42.950Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-09-29T15:11:42.950Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200929151135-FB6BF9CC
[2020-09-29T15:11:42.950Z] runbld>>> Email notification disabled by environment variable.
[2020-09-29T15:11:42.950Z] runbld>>> Slack notification disabled by environment variable.
[2020-09-29T15:11:48.808Z] Running on worker-1244230 in /var/lib/jenkins/workspace/Beats_beats_PR-20779
[2020-09-29T15:11:48.907Z] [INFO] getVaultSecret: Getting secrets
[2020-09-29T15:11:49.001Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-29T15:11:50.978Z] + chmod 755 generate-build-data.sh
[2020-09-29T15:11:50.979Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20779/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20779/runs/8 FAILURE 3931761
[2020-09-29T15:11:50.979Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20779/runs/8/steps/?limit=10000 -o steps-info.json
[2020-09-29T15:11:54.457Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20779/runs/8/tests/?status=FAILED -o tests-errors.json
[2020-09-29T15:11:55.960Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20779/runs/8/log/ -o pipeline-log.txt

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

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

looks ok, it either needs to be synced with fleet changes or made in a non-breaking two step process when we accept both types with same result and then we remove CONFIG_CHANGE later

@ph
Copy link
Contributor Author

ph commented Sep 8, 2020

I've talked to @michalpristas and he will take it over from me.

@jen-huang
Copy link

Hi @michalpristas, I have Kibana changes here: elastic/kibana#78221

The Kibana changes includes BWC for <= 7.9 agent. I tested changing policies with a 7.9.1 snapshot build of agent and it worked well. Could you verify BWC as well as with the agent changes in this PR? Thanks!

@michalpristas
Copy link
Contributor

@jen-huang tested with agent from this branch. it retrieves action of type POLICY_CHANGE as it should.

@michalpristas michalpristas marked this pull request as ready for review September 23, 2020 09:42
- Prevent closing closed reader {pull}20214[20214]
- Fix Windows service installation script {pull}20203[20203]
- Fix timeout issue stopping service applications {pull}20256[20256]
- Fix rename *ConfigChange to *PolicyChange to align on changes in the UI. {pull}20779[20779]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops changelog issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

wou

Copy link
Contributor

Choose a reason for hiding this comment

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

changelog vs changelog.next

@michalpristas michalpristas merged commit c9827a8 into elastic:master Sep 29, 2020
michalpristas added a commit to michalpristas/beats that referenced this pull request Sep 29, 2020
[Elastic Agent] Rename *ConfigChange to PolicyChange (elastic#20779)

Co-authored-by: Michal Pristas <michal.pristas@gmail.com>
@michalpristas michalpristas added the needs_backport PR is waiting to be backported to other branches. label Sep 29, 2020
michalpristas added a commit that referenced this pull request Sep 30, 2020
[Elastic Agent] Rename *ConfigChange to PolicyChange (#20779) (#21390)
v1v added a commit to v1v/beats that referenced this pull request Sep 30, 2020
…ci-build-label-support

* upstream/master:
  [JJBB] Set shallow cloning to 10 (elastic#21409)
  docs: add link to release notes for 7.9.2 (elastic#21405) (elastic#21419)
  docs: Prepare Changelog for 7.9.2 (elastic#21229) (elastic#21403)
  fix: mark flaky tests (elastic#21300)
  fix: use a fixed version of setuptools (elastic#21393)
  Move Kubernetes events metricset to its own block in reference config (elastic#21407)
  [libbeat] Enable WriteAheadLimit in the disk queue (elastic#21391)
  docs: fix apt/yum formatting (elastic#21362)
  Fix shutdown tracking in s3 input (elastic#21380)
  [libbeat] Fix position writing in the disk queue
  Add UBI 8 image to the dependencies report (elastic#21374)
  Fix debug message to show actual SQS message ID (elastic#20614)
  [Elastic Agent] Rename *ConfigChange to PolicyChange (elastic#20779)
  [Elastic Agent] Add install/uninstall sub-command (elastic#21206)
  [Filebeat][httpjson] Make httpjson use cursor input when using date cursor (elastic#20751)
  feat: prepare release pipelines (elastic#21238)
  Add IP validation to Security module (elastic#21325)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_backport PR is waiting to be backported to other branches. review [zube]: In Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Elastic Agent] Applies POLICY* Changes from Fleet to the Agent.
4 participants