-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Fleet] Fix missing validation error in package policy editor #229932
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 missing validation error in package policy editor #229932
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
|
There is a failing test, while fixing it I found an old PR that explicitly allowed empty string to pass validation. I need to dig a bit further before merging to avoid accidentaly breaking something else. |
|
@elasticmachine merge upstream |
| }); | ||
|
|
||
| // TODO enable when https://github.com/elastic/kibana/issues/125655 is fixed | ||
| it.skip('returns package policy validation error if input var does not exist', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as it wasn't relevant anymore
Is there a reason why we allow empty strings? |
@juliaElastic That's a great question. I found #123596, it was mentioned that there were some tests on integrations where an empty string was set. Not sure if they still exist, but I'm afraid that we might break some functionality and discover it when it's already merged. To avoid it, I'm just setting and undefined when deleting the input. It works and it shouldn't break anything (I hope) |
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @criamico |
|
Starting backport for target branches: 9.1 https://github.com/elastic/kibana/actions/runs/16746163409 |
…c#229932) Fixes elastic#226801 ## Summary **Bugfix**: Validation for some inputs in the package policy editor was broken. This PR fixes the missing validation for required `text` and `password` type inputs. ### Testing Tested with a specific integration but it's valid for all other integrations that have similar required inputs of type `text` - Add integration Office 365 (`o365`) - Check required variables `Directory (tenant) ID` and `Batch Interval` - Try to add values to them and then remove them. When the text boxes are empty they should be read and show "is required" error <img width="1641" height="1588" alt="Screenshot 2025-07-30 at 11 38 04" src="https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6" /> ### Checklist Check the PR satisfies following conditions. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit e44869e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…229932) (#230526) # Backport This will backport the following commits from `main` to `9.1`: - [[Fleet] Fix missing validation error in package policy editor (#229932)](#229932) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-08-05T09:28:08Z","message":"[Fleet] Fix missing validation error in package policy editor (#229932)\n\nFixes https://github.com/elastic/kibana/issues/226801\n\n## Summary\n**Bugfix**: Validation for some inputs in the package policy editor was\nbroken. This PR fixes the missing validation for required `text` and\n`password` type inputs.\n\n### Testing\nTested with a specific integration but it's valid for all other\nintegrations that have similar required inputs of type `text`\n\n- Add integration Office 365 (`o365`)\n- Check required variables `Directory (tenant) ID` and `Batch Interval`\n- Try to add values to them and then remove them. When the text boxes\nare empty they should be read and show \"is required\" error\n\n<img width=\"1641\" height=\"1588\" alt=\"Screenshot 2025-07-30 at 11 38 04\"\nsrc=\"https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6\"\n/>\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e44869e14eebf5c29047ae33c610156195201365","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v9.2.0"],"title":"[Fleet] Fix missing validation error in package policy editor","number":229932,"url":"https://github.com/elastic/kibana/pull/229932","mergeCommit":{"message":"[Fleet] Fix missing validation error in package policy editor (#229932)\n\nFixes https://github.com/elastic/kibana/issues/226801\n\n## Summary\n**Bugfix**: Validation for some inputs in the package policy editor was\nbroken. This PR fixes the missing validation for required `text` and\n`password` type inputs.\n\n### Testing\nTested with a specific integration but it's valid for all other\nintegrations that have similar required inputs of type `text`\n\n- Add integration Office 365 (`o365`)\n- Check required variables `Directory (tenant) ID` and `Batch Interval`\n- Try to add values to them and then remove them. When the text boxes\nare empty they should be read and show \"is required\" error\n\n<img width=\"1641\" height=\"1588\" alt=\"Screenshot 2025-07-30 at 11 38 04\"\nsrc=\"https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6\"\n/>\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e44869e14eebf5c29047ae33c610156195201365"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229932","number":229932,"mergeCommit":{"message":"[Fleet] Fix missing validation error in package policy editor (#229932)\n\nFixes https://github.com/elastic/kibana/issues/226801\n\n## Summary\n**Bugfix**: Validation for some inputs in the package policy editor was\nbroken. This PR fixes the missing validation for required `text` and\n`password` type inputs.\n\n### Testing\nTested with a specific integration but it's valid for all other\nintegrations that have similar required inputs of type `text`\n\n- Add integration Office 365 (`o365`)\n- Check required variables `Directory (tenant) ID` and `Batch Interval`\n- Try to add values to them and then remove them. When the text boxes\nare empty they should be read and show \"is required\" error\n\n<img width=\"1641\" height=\"1588\" alt=\"Screenshot 2025-07-30 at 11 38 04\"\nsrc=\"https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6\"\n/>\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"e44869e14eebf5c29047ae33c610156195201365"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <criamico@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…c#229932) Fixes elastic#226801 ## Summary **Bugfix**: Validation for some inputs in the package policy editor was broken. This PR fixes the missing validation for required `text` and `password` type inputs. ### Testing Tested with a specific integration but it's valid for all other integrations that have similar required inputs of type `text` - Add integration Office 365 (`o365`) - Check required variables `Directory (tenant) ID` and `Batch Interval` - Try to add values to them and then remove them. When the text boxes are empty they should be read and show "is required" error <img width="1641" height="1588" alt="Screenshot 2025-07-30 at 11 38 04" src="https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6" /> ### Checklist Check the PR satisfies following conditions. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…c#229932) Fixes elastic#226801 ## Summary **Bugfix**: Validation for some inputs in the package policy editor was broken. This PR fixes the missing validation for required `text` and `password` type inputs. ### Testing Tested with a specific integration but it's valid for all other integrations that have similar required inputs of type `text` - Add integration Office 365 (`o365`) - Check required variables `Directory (tenant) ID` and `Batch Interval` - Try to add values to them and then remove them. When the text boxes are empty they should be read and show "is required" error <img width="1641" height="1588" alt="Screenshot 2025-07-30 at 11 38 04" src="https://github.com/user-attachments/assets/3e94a277-c034-4984-ade8-38afd57d64c6" /> ### Checklist Check the PR satisfies following conditions. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Fixes #226801
Summary
Bugfix: Validation for some inputs in the package policy editor was broken. This PR fixes the missing validation for required
textandpasswordtype inputs.Testing
Tested with a specific integration but it's valid for all other integrations that have similar required inputs of type
texto365)Directory (tenant) IDandBatch IntervalChecklist
Check the PR satisfies following conditions.