## Summary
This PR contains the initial designs for our versioned router API. This
contribution contains only types, any implementation will come in later
PRs.
Previous PR https://github.com/elastic/kibana/pull/149943
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com>
## Summary
After merging https://github.com/elastic/kibana/pull/148979 there are a
few interfaces in the server-side code that export a reference to a
deprecated SO type.
In this PR we fix them by updating a few imports to use the
non-deprecated SO type. Additionally, we resolve a potential circular
reference issue between `core-saved-objects-server` and
`core-saved-objects-api-server` by "moving" saved objects and related
types exports to `core-saved-objects-api-server`
Closes#147049Closes#149897
Migrates authorization and audit logic from the Saved Objects Repository
to the Saved Objects Security Extension. This is achieved by
implementing action-specific authorization methods within the security
extension. The SO repository is no longer responsible for making any
authorization decisions, but It is still responsible to know how to call
the extension methods. I've tried to make this as straightforward as
possible such that there is a clear ownership delineation between the
repository and the extension, by keeping the interface simple and
(hopefully) obvious.
### Security Extension Interface
New Public Extension Methods:
- authorizeCreate
- authorizeBulkCreate
- authorizeUpdate
- authorizeBulkUpdate
- authorizeDelete
- authorizeBulkDelete
- authorizeGet
- authorizeBulkGet
- authorizeCheckConflicts
- authorizeRemoveReferences
- authorizeOpenPointInTime
- auditClosePointInTime
- authorizeAndRedactMultiNamespaceReferences
- authorizeAndRedactInternalBulkResolve
- authorizeUpdateSpaces
- authorizeFind
- getFindRedactTypeMap
- authorizeDisableLegacyUrlAliases (for secure spaces client)
- auditObjectsForSpaceDeletion (for secure spaces client)
Removed from public interface:
- authorize
- enforceAuthorization
- addAuditEvent
### Tests
- Most test coverage moved from `repository.security_extension.test.ts`
to `saved_objects_security_extension.test.ts`
- `repository.security_extension.test.ts` tests extension call,
parameters, and return
- Updates repository unit tests to check that all security extension
calls are made with the current space when the spaces extension is also
enabled
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
## Summary
Part of https://github.com/elastic/kibana/issues/150301
- Add logic to converts model version transformations to the format used
by the document migrator
- Use in when preparing migration data for the document migrator
- Improve the migration validation logic to take model versions into
account (and clean it)
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.
### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:
> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.
### Future PR
Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)
> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.
This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'
### Checklist
Delete any items that are not applicable to this PR.
- [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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
## Summary
`eui@74.0.2` ⏩ `eui@75.0.0`
___
## [`75.0.0`](https://github.com/elastic/eui/tree/v75.0.0)
- `EuiFlyout`s now automatically shard all fixed `EuiHeader`s on the
page. This means that interactions (mouse & keyboard) with items inside
`EuiHeader`s when flyouts are open will no longer trigger focus fighting
([#6566](https://github.com/elastic/eui/pull/6566))
- `EuiFlyout`s now read out detailed screen reader dialog instructions
and hints on open ([#6566](https://github.com/elastic/eui/pull/6566))
**Bug fixes**
- Fixed `EuiSelectable` options with incorrect `aria-posinset` indices
when rendered with group labels not at the start of the array
([#6571](https://github.com/elastic/eui/pull/6571))
- Fixed a bug with `EuiSearchBar` where filters with `multiSelect:
false` were not able to select a new option when an option was already
selected ([#6577](https://github.com/elastic/eui/pull/6577))
**Breaking changes**
- Removed the ability to customize the `role` prop of `EuiFlyout`s.
`EuiFlyout`s should always be dialog roles for screen reader
consistency. ([#6566](https://github.com/elastic/eui/pull/6566))
- Removed `closeButtonAriaLabel` prop from `EuiFlyout` - use
`closeButtonProps['aria-label']` instead
([#6566](https://github.com/elastic/eui/pull/6566))
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Clean up saved object mappings to reduce the field count and make
mappings more future-proof.
This PR attempts to remove all `enabled: false` mappings. It's not
possible to toggle the `enabled` property so it becomes impossible to
ever query over a disabled field. `type: 'object', enabled: 'false'`
also provides worse validation since it's possible to index a string
into such an object. So using `dynamic: false, properties: {}` provides
better validation and is more future-proof allowing us to query over
these fields should the need arise.
Since these fields can't be queried over it should be safe to remove
these mappings but please review and/or test to ensure there's no
regressions. If your plugin every relied on the lack of validation for
being able to ingest a `string` field into an `type: 'object', enabled:
'false'` field this PR would now cause failures.
Related: https://github.com/elastic/dev/issues/2189
### Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Fixes https://github.com/elastic/kibana/issues/149344
This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).
The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Related to https://github.com/elastic/kibana/issues/150301
This PR tend to do some preliminary cleanup before diving into the
actual implementation. I'm mostly extracting things from the (way too
big and hard to read) document migrator, to increase readability,
maintainability and testability (note: I did not add additional unit
test for the extracted files, as I did not change the impl and as we'll
be rewriting them all soon enough - it would just have been a loss of
time)
- Move the document migrator from
`packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core`
to it's dedicated folder `document_migrator` folder
- Extract all the bits not directly performing the document
transformation (e.g building the migration map, validation, utils) to
their dedicated files
- Only moving things around. No concrete code (apart from types) was
modified, to ease managing conflicts with
https://github.com/elastic/kibana/pull/150443
## Summary
Fix https://github.com/elastic/kibana/issues/150297
First step toward managed upgrades
This PR adds the types that will be used for the new SO model version
API, and adds the new properties to the `SavedObjectsType` type.
The implementation is outside of scope of the PR and will be implemented
in a future PR.
The PR also adapt the `check_registered_types` test to trigger a review
when the attributes of `SavedObjectsType` introduced in this PR are
changed.
This change ensures that the `unsafe-eval` source expression isn't included in
the Kibana Content Security Policy (CSP) by default.
Users can set `csp.disableUnsafeEval: false` to reintroduce `unsafe-eval`.
However, since this config option is deprecated as of this commit, it's
recommended to instead set `csp.script_src: ['unsafe-eval']`.
Closes#150156
## Summary
This PR adds an internal API to get all users involved in a case. The
response returns the case's participants, the assignees, and the
unassigned users. A participant is considered anyone that made an action
to the case. The participants' array may contain an assignee and
vise-versa. Each user has `email`, `full_name`, `username`, and
`profile_uid`. All fields are optional. The endpoint will get all known
profiles using the security plugin. The profile information takes
precedence. The API will fall back to the information kept in the user
action if the profile uid is not valid.
**Endpoint:**
`GET /internal/cases/<case_id>/_users`
<details>
<summary>Example Response</summary>
```
{
"participants": [
{
"email": null,
"full_name": null,
"username": "elastic",
"profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
},
{
"email": "fuzzy_marten@profiles.elastic.co",
"full_name": "Fuzzy Marten",
"username": "fuzzy_marten",
"profile_uid": "u_3OgKOf-ogtr8kJ5B0fnRcqzXs2aQQkZLtzKEEFnKaYg_0"
},
],
"assignees": [
{
"email": "fuzzy_marten@profiles.elastic.co",
"full_name": "Fuzzy Marten",
"username": "fuzzy_marten",
"profile_uid": "u_3OgKOf-ogtr8kJ5B0fnRcqzXs2aQQkZLtzKEEFnKaYg_0"
},
{
"email": "misty_mackerel@profiles.elastic.co",
"full_name": "Misty Mackerel",
"username": "misty_mackerel",
"profile_uid": "u_BXf_iGxcnicv4l-3-ER7I-XPpfanAFAap7uls86xV7A_0"
}
],
"unassignedUsers": [
{
"email": "valid_chimpanzee@profiles.elastic.co",
"full_name": "Valid Chimpanzee",
"username": "valid_chimpanzee",
"profile_uid": "u_wEtPffVJIgxWIN8W79Rp84bbORN6x0wKiJ5eTsQvpBA_0"
}
]
}
```
</details>
### Checklist
Delete any items that are not applicable to this PR.
- [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
### For maintainers
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This PR updates the core discovery logic to support loading plugins from
packages. This logic is additive, so that the existing plugins in the
repo and third-party plugins can continue to be loaded via the existing
mechanism, but with https://github.com/elastic/kibana/pull/148130 we
will be automatically migrating all plugins in the repo to packages,
which will use this logic.
The logic is already in-use in that PR, and was developed there, but
extracted here for easier review.
The logic is relatively simple, where a list of packages in the repo are
attached to the core `Env` and then filtered by core before converting
all plugin packages to `PluginWrapper`. The `PluginWrapper` still
exposes the plugin manifest to the rest of the code, and it is used in
many places, so rather than making changes to the `PluginWrapper` I'm
faking a legacy plugin manifest with the plugin package manifest.
@elastic/kibana-core: I'm going to need some help identifying what we
need to get test coverage for. This is a pretty simple addition to the
core IMO, and if it didn't work then nothing would work, so I'm pretty
confident in it, but would still appreciate your feedback.
**Addresses:** https://github.com/elastic/kibana/issues/130966
**Based on:** https://github.com/elastic/kibana/issues/135127
## Summary
This PR deprecates the Sidecar SO of type `siem-detection-engine-rule-execution-info` in favour of storing Rule Execution Logging data within the rule itself, making use of the work previously done in the Alerting Framework:
- https://github.com/elastic/kibana/pull/140882
- https://github.com/elastic/kibana/pull/147278
Work done:
- **Pass execution statuses and metrics from rule executors to the Framework:** through the use of `RuleMonitoringService` and `RuleResultService` from within the rule execution log client for executor. `x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts`
- **Fetch execution statuses and metrics from rules themselves instead of the sidecar `siem-detection-engine-rule-execution-info` saved objects**: through the use of the new function `createRuleExecutionSummary` in `x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts`, which extracts last execution information from the rule itself.
- **Remove the siem-detection-engine-rule-execution-info saved objects type from the codebase. Mark it as deleted in Kibana Core:** added `siem-detection-engine-rule-execution-info` to `packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/unused_types.ts`; and got rid of the related Saved Object client.
- **Make sure to keep backward compatibility in the Detection API endpoints and rule execution events we write into the Event Log**: API compatibility is maintained. No breaking changes.
### Checklist
- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
- [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
## Summary
After merging https://github.com/elastic/kibana/pull/148979 there are a
number of imports that can be fixed immediately to address our new
deprecation notice.
## To Core reviewers
The package `core-saved-objects-server` is using types from
`core-saved-objects-api-server` which creates a circular dependency when
using `SavedObject` type from it's new home in
`core-saved-object-server`:
`core-saved-objects-server` -> `core-saved-objects-api-server` ->
`core-saved-objects-server`
One solution is that we can create a new package
`packages/core/saved-objects/core-saved-objects-server-shared` that will
only hold the `SavedObject` type and a select few others. I'm not sure
what the best approach here is. I have left
`core-saved-objects-api-server` unchanged for now (i.e., it is still
importing `SavedObject` from `common` which is deprecated).
Any input would be greatly appreciated!
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Bump elasticsearch-js to 8.6.0-canary.3 to unblock
https://github.com/elastic/kibana/issues/145653
The updated version of elasticsearch-js comes with some type changes
that causes typescript type checking to fail. I've fixed the type errors
that were obvious/easy but left todo's for some types which were harder
for me to figure out. If any of these todo's are in your team's code,
please contribute directly to the branch to fix them.
### Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.
When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:
| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thom Heymann <thom.heymann@elastic.co>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
eui@72.2.0 ⏩ eui@73.0.0
---
**Bug fixes**
- Fixed `EuiDataGrid` a11y errors within toolbar popovers containing
draggable elements with interactive children
([#6517](https://github.com/elastic/eui/pull/6517))
- Fixed several styling bugs within `EuiDataGrid`'s sorting toolbar
popover ([#6517](https://github.com/elastic/eui/pull/6517))
**Breaking changes**
- `EuiToolTip`s now internally enforce only showing **one** tooltip at a
time (the most recently triggered tooltip). This primarily affects
scenarios where users are focused on a tooltip toggle via click, and
then hover onto another tooltip toggle.
([#6520](https://github.com/elastic/eui/pull/6520))
This PR upgrades uuid into its latest version `9.0.0`.
The previous default used version `v4` was kept where it was previously
used and places using `v1` or `v5` are still using it.
In this latest version they removed the deep import feature and as we
are not using tree shaking it increased our bundles by a significant
size. As such, I've moved this dependency into the `ui-shared-deps-npm`
bundle.
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes#149037.
## Summary
The namespace argument in Saved Object Repository Update method's call
to optionallyEncryptAttributes was being supplied by an unqualified
optional parameter. This means that when the namespace option was not
defined, the current namespace was not being passed to the encrypt
method. This PR updates the argument to the qualified namespace
determined by the optional parameter and the Spaces Extension's
getCurrentNamespace method.
Unit tests have also been updated to catch this case should it occur in
the future. The same consideration will be made for security extension
unit tests in [PR
148165](https://github.com/elastic/kibana/pull/148165).
## Testing
To test, follow the instructions given in [the
issue](https://github.com/elastic/kibana/issues/149037).
## Summary
* Re-exporting SO types from `common` inside server code
* Deprecated individual APIs on interfaces, not just interfaces, to make
deprecation visible to consumers
* Deprecates the `savedObjects` prop on the `CoreStart` interface too
## Summary
In the near future we will remove Saved Object (SO) HTTP APIs. This PR
deprecates all browser-side SO types and interfaces.
General comments on the approach taken here:
* Add a deprecation notice that links to a GitHub issue that can be
referenced by all teams
* Do not break existing imports/exports
* Mocks are also an indication of SO browser-side use, added deprecation
notices
* Some common types must also be deprecated, some may remain. For those
to be removed they are moved to a separate file, with a deprecated
type-alias re-exported
## Notes to reviewers
* Easiest way to get an overview of the changes is to have the file-tree
open in the "Files changed" view
* Are there any other ways browser-side code can get knowledge of Saved
Objects?
* Please go through some client code and test that the DX is working as
expected (the GitHub issue is discoverable)
## Related
* https://github.com/elastic/kibana/issues/147150
* https://github.com/elastic/dev/issues/2194
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This PR implements a new internal API to return the information relating
to all the connectors used throughout a case's lifespan.
Fixes: https://github.com/elastic/kibana/issues/134346
```
GET http://localhost:5601/internal/cases/<case id>/_connectors
Response
{
"my-jira": {
"name": "preconfigured-jira",
"type": ".jira",
"fields": {
"issueType": "10001",
"parent": null,
"priority": null
},
"id": "my-jira",
"needsToBePushed": true,
"hasBeenPushed": false
}
}
```
<details><summary>cURL example</summary>
```
curl --location --request GET 'http://localhost:5601/internal/cases/ae038370-91d9-11ed-97ce-c35961718f7b/_connectors' \
--header 'kbn-xsrf: hello' \
--header 'Authorization: Basic <token>' \
--data-raw ''
```
Response
```
{
"my-jira": {
"name": "preconfigured-jira",
"type": ".jira",
"fields": {
"issueType": "10001",
"parent": null,
"priority": null
},
"id": "my-jira",
"needsToBePushed": true,
"hasBeenPushed": false
}
}
```
</details>
Notable changes:
- Refactored the user actions service to move the functions that create
user actions (builders etc) to its own class `UserActionPersister`
- Refactored the `CaseUserActionService` class to pull the saved object
client, logger, and other fields passed to each function via parameters
to be wrapped in a `context` member field within the class
- Plumbed in `savedObjectsService.createSerializer` to transform a raw
elasticsearch document into the saved object representation
- Added new internal `_connectors` route and `getConnectors` client
function
- Refactored the integration tests by extracting the connector related
utility functions into their own file
## Needs to be pushed algorithm
To determine whether a case needs to be pushed for a certain connector
we follow this algorithm:
- Get all unique connectors
- For each connector
- Find the most recent user action contain the connector's fields, this
will be in the most recent `connector` user action or if the connector
was configured only once when the case was initially created it'll be on
the `create_case` user action
- Grab the most recent push user action if it exists
- For each push search for the connector fields that were used in that
push
- Get the most recent user action that would cause a push to occur
(title, description, tags, or comment change)
- For each connector
- If a push does not exist, we need to push
- If a push exists but the fields do not match the field of the most
recent connector fields, we need to push because the fields changed
- If the timestamp of the most recent user action is more recent than
that of the last push (aka the user changed something since we last
pushed) we need to push
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>