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 normalizers to not parse list values if they are already parsed #133563

Conversation

awahab07
Copy link
Contributor

@awahab07 awahab07 commented Jun 3, 2022

Fixes #133212

Summary

While configuring a Synthetics Integration via yaml, the list values (e.g. ssl.supported_protocols under TLS Configuration of HTTP monitor or tags for any monitor) are re-parsed via JSON.parse when they were already parsed and converted to a JS Array by js-yaml, causing the following error on Synthetics Integration Edit Page:

Screenshot 2022-06-03 at 17 21 59

This PR fixes this and before applying JSON.parse, first checks if the value is already parsed.

How to test

  • Connect local Kibana to a cluster with Fleet Server installed e.g. edge-oblt cluster
  • In kibana.dev.yml, put the following Synthetics Integration config
xpack.fleet.agentPolicies:
  - name: Synthetics Agent Policy Test - Issue
    id: synthetics-agent-policy-test-issue
    namespace: default
    package_policies:
      - name: synthetics-test1
        package:
          name: synthetics
        id: my-monitor-test1
        inputs:
          - type: synthetics/http
            enabled: true
            streams:
              - data_stream:
                  type: synthetics
                  dataset: http
                enabled: true
                vars:
                  - name: type
                    value: http
                  - name: urls
                    value: 'http://www.httpvshttps.com/'
                  - name: schedule
                    value: '"@every 5m"'
                  - name: ssl.verification_mode
                    value: none
                  - name: ssl.supported_protocols
                    value:
                      - TLSv1.1
                      - TLSv1.2
                      - TLSv1.3
                  - name: tags
                    value:
                      - test1
                      - test2
                      - test3
                      - test4
  • Goto Management -> Fleet -> Synthetics Agent Policy Test - Issue -> synthetics-test1
  • You shouldn't see the above error

Note: There's an issue with the UI that on editing a yaml configured integration, the Tags or Supported TLS protocols combobox shows invalid state with "elastic" as an option value. As shown below:
Screenshot 2022-06-03 at 20 36 13
Turned out it is the browser autofill which puts "elastic" as the default value. The default value "elastic" comes from Kibana's username input field as both input fields (the username and the one contained within EuiComoBox component) are unnamed. Eui team has been informed about this as there should be an option to set autocomplete="off" on EuiComboBox component.

@awahab07 awahab07 added release_note:fix Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability auto-backport Deprecated - use backport:version if exact versions are needed v8.3.0 labels Jun 3, 2022
@awahab07 awahab07 requested a review from a team as a code owner June 3, 2022 19:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@awahab07
Copy link
Contributor Author

awahab07 commented Jun 7, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 848 849 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
synthetics 858.1KB 858.1KB +28.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@shahzad31 shahzad31 left a comment

Choose a reason for hiding this comment

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

Tested it and it works as expected now !!

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 7, 2022
…y js-yaml. (#133563) (#133212) (#133771)

(cherry picked from commit 552c1ea)

Co-authored-by: Abdul Wahab Zahid <awahab07@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:fix Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Synthetics] Fleet Policy editor attempts to JSON.parse all values, including those defined as YML
5 participants