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

[Fleet] fix policy validation #124040

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Jan 28, 2022

Summary

Fixes #123704

Package policy could be submitted with an invalid form (missing required field).

it looks like the problem is that the formState is set to VALID when agent policy is updated on the form, this seems to happen even if the form has validation errors.
https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/index.tsx#L177

To test:
Add Custom Logs integration: http://localhost:5601/app/fleet/integrations/log-1.0.0/add-integration
Verify that Log file path is empty, and when clicking on the input, it shows up as required.
Verify that the form can't be submitted until the field value is set (changing agent policy should not make the form valid)

image

@juliaElastic juliaElastic added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 v7.17.0 v7.16.4 labels Jan 28, 2022
@juliaElastic juliaElastic self-assigned this Jan 28, 2022
@juliaElastic juliaElastic requested a review from a team as a code owner January 28, 2022 15:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@juliaElastic
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
fleet 644.5KB 644.5KB -5.0B

History

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

cc @juliaElastic

@juliaElastic juliaElastic merged commit 860a207 into elastic:main Jan 31, 2022
@juliaElastic juliaElastic deleted the fix-package-policy-validation branch January 31, 2022 10:24
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.0
7.17
7.16

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

Questions ?

Please refer to the Backport tool documentation

awahab07 pushed a commit to awahab07/kibana that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jan 31, 2022
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 860a207)

Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
@dikshachauhan-qasource
Copy link

Hi @juliaElastic

We have validated this ticket and found it working fine on 8.0 RC2 BC4 self managed environment.

  • Log file path shows validation when left empty while adding custom log integration to any policy.
  • User is unable to save policy when field is empty.
  • When policy is updated, validation continues to show under Log file path field and does not allow integration to be saved until info is passed.
  • Edit integration page, also shows up required validation at mentioned field.

Screenshot:
image

Build details:
BUILD 49192
COMMIT 57ca5e1

Thanks
QAS

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:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.16.4 v7.17.0 v8.0.0 v8.1.0
Projects
None yet
6 participants