Skip to content

Conversation

@criamico
Copy link
Contributor

@criamico criamico commented Jul 30, 2025

Fixes #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
Screenshot 2025-07-30 at 11 38 04

Checklist

Check the PR satisfies following conditions.

@criamico criamico self-assigned this Jul 30, 2025
@criamico criamico added Team:Fleet Team label for Observability Data Collection Fleet team release_note:fix backport:prev-minor v9.2.0 labels Jul 30, 2025
@criamico criamico marked this pull request as ready for review July 30, 2025 09:41
@criamico criamico requested a review from a team as a code owner July 30, 2025 09:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@criamico
Copy link
Contributor Author

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.

@criamico
Copy link
Contributor Author

criamico commented Aug 4, 2025

@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', () => {
Copy link
Contributor Author

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

@criamico criamico requested a review from juliaElastic August 4, 2025 15:31
@juliaElastic
Copy link
Contributor

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.

Is there a reason why we allow empty strings?

@criamico
Copy link
Contributor Author

criamico commented Aug 4, 2025

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)

@criamico
Copy link
Contributor Author

criamico commented Aug 5, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests #1 / Add Integration - Real API should upgrade policies with integration update

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 2.1MB 2.1MB +16.0B

History

cc @criamico

@criamico criamico merged commit e44869e into elastic:main Aug 5, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16746163409

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 5, 2025
…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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

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 Aug 5, 2025
…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>
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
…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>
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
@mistic mistic added v9.1.2 and removed v9.1.1 labels Aug 7, 2025
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] The policy editor doesn't require a value for a required variable

5 participants