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

[Synthetics] Handle private locations simultaneous edits !! #195874

Merged
merged 43 commits into from
Nov 7, 2024

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Oct 11, 2024

Summary

Fixes #190801 !!

Handle private locations simultaneous edits !!

Registered a new saved object to handle private locations properly. Instead of using a singleton, now each private location will be represented by it's own saved object.

Existing private locations

When we are doing any write operation, we migrate them to new kind of saved object and remove the legacy saved object type.

Testing

  • Create multiple private locations on main
  • Switch to branch and create few more locations
  • Make sure all private locations are editable, deleteable and have been migrated to new saved object types in the course

shahzad31 and others added 23 commits August 20, 2024 23:02
… src/core/server/integration_tests/ci_checks'
@shahzad31 shahzad31 marked this pull request as ready for review October 29, 2024 08:57
@shahzad31 shahzad31 requested review from a team as code owners October 29, 2024 08:57
@shahzad31 shahzad31 added release_note:fix backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Oct 29, 2024
@jeramysoucy jeramysoucy self-requested a review October 29, 2024 11:12
Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts changes LGTM

@dominiqueclarke dominiqueclarke requested review from dominiqueclarke and removed request for dominiqueclarke November 5, 2024 14:25
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

packages/kbn-test/src/kbn_client/kbn_client_saved_objects.ts

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 6, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 0603dee
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-195874-0603deea74e7

Failed CI Steps

Test Failures

  • [job] [logs] x-pack/test/cases_api_integration/security_and_spaces/config_trial.ts / cases security and spaces enabled: trial get_connectors push needsToBePushed sets needs to push to false when the status of a case was changed after the last push

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/synthetics-e2e 18 17 -1

Total ESLint disabled count

id before after diff
@kbn/synthetics-e2e 19 18 -1

History

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

LGTM

@shahzad31 shahzad31 merged commit 96c9b5b into elastic:main Nov 7, 2024
29 checks passed
@shahzad31 shahzad31 deleted the pvt-location-migration branch November 7, 2024 21:31
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 7, 2024
…195874)

## Summary

Fixes elastic#190801 !!

Handle private locations simultaneous edits !!

Registered a new saved object to handle private locations properly.
Instead of using a singleton, now each private location will be
represented by it's own saved object.

### Existing private locations
When we are doing any write operation, we migrate them to new kind of
saved object and remove the legacy saved object type.

### Testing

- Create multiple private locations on main
- Switch to branch and create few more locations
- Make sure all private locations are editable, deleteable and have been
migrated to new saved object types in the course

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 96c9b5b)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Nov 7, 2024
…95874) (#199387)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Synthetics] Handle private locations simultaneous edits !!
(#195874)](#195874)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-07T21:31:09Z","message":"[Synthetics]
Handle private locations simultaneous edits !! (#195874)\n\n##
Summary\r\n\r\nFixes #190801
!!\r\n\r\nHandle private locations simultaneous edits !!
\r\n\r\nRegistered a new saved object to handle private locations
properly.\r\nInstead of using a singleton, now each private location
will be\r\nrepresented by it's own saved object.\r\n\r\n### Existing
private locations\r\nWhen we are doing any write operation, we migrate
them to new kind of\r\nsaved object and remove the legacy saved object
type.\r\n\r\n\r\n### Testing\r\n\r\n- Create multiple private locations
on main \r\n- Switch to branch and create few more locations\r\n- Make
sure all private locations are editable, deleteable and have
been\r\nmigrated to new saved object types in the
course\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"96c9b5b5d0a82c6e4b0a9b86fc1ab4dd9fa4d707","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management"],"title":"[Synthetics]
Handle private locations simultaneous edits
!!","number":195874,"url":"https://github.com/elastic/kibana/pull/195874","mergeCommit":{"message":"[Synthetics]
Handle private locations simultaneous edits !! (#195874)\n\n##
Summary\r\n\r\nFixes #190801
!!\r\n\r\nHandle private locations simultaneous edits !!
\r\n\r\nRegistered a new saved object to handle private locations
properly.\r\nInstead of using a singleton, now each private location
will be\r\nrepresented by it's own saved object.\r\n\r\n### Existing
private locations\r\nWhen we are doing any write operation, we migrate
them to new kind of\r\nsaved object and remove the legacy saved object
type.\r\n\r\n\r\n### Testing\r\n\r\n- Create multiple private locations
on main \r\n- Switch to branch and create few more locations\r\n- Make
sure all private locations are editable, deleteable and have
been\r\nmigrated to new saved object types in the
course\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"96c9b5b5d0a82c6e4b0a9b86fc1ab4dd9fa4d707"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195874","number":195874,"mergeCommit":{"message":"[Synthetics]
Handle private locations simultaneous edits !! (#195874)\n\n##
Summary\r\n\r\nFixes #190801
!!\r\n\r\nHandle private locations simultaneous edits !!
\r\n\r\nRegistered a new saved object to handle private locations
properly.\r\nInstead of using a singleton, now each private location
will be\r\nrepresented by it's own saved object.\r\n\r\n### Existing
private locations\r\nWhen we are doing any write operation, we migrate
them to new kind of\r\nsaved object and remove the legacy saved object
type.\r\n\r\n\r\n### Testing\r\n\r\n- Create multiple private locations
on main \r\n- Switch to branch and create few more locations\r\n- Make
sure all private locations are editable, deleteable and have
been\r\nmigrated to new saved object types in the
course\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"96c9b5b5d0a82c6e4b0a9b86fc1ab4dd9fa4d707"}}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
@biscout42
Copy link

Thanks a lot!

mbondyra pushed a commit to mbondyra/kibana that referenced this pull request Nov 8, 2024
…195874)

## Summary

Fixes elastic#190801 !!

Handle private locations simultaneous edits !! 

Registered a new saved object to handle private locations properly.
Instead of using a singleton, now each private location will be
represented by it's own saved object.

### Existing private locations
When we are doing any write operation, we migrate them to new kind of
saved object and remove the legacy saved object type.


### Testing

- Create multiple private locations on main 
- Switch to branch and create few more locations
- Make sure all private locations are editable, deleteable and have been
migrated to new saved object types in the course

---------

Co-authored-by: kibanamachine <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 8, 2024
…195874)

## Summary

Fixes elastic#190801 !!

Handle private locations simultaneous edits !! 

Registered a new saved object to handle private locations properly.
Instead of using a singleton, now each private location will be
represented by it's own saved object.

### Existing private locations
When we are doing any write operation, we migrate them to new kind of
saved object and remove the legacy saved object type.


### Testing

- Create multiple private locations on main 
- Switch to branch and create few more locations
- Make sure all private locations are editable, deleteable and have been
migrated to new saved object types in the course

---------

Co-authored-by: kibanamachine <[email protected]>
shahzad31 added a commit that referenced this pull request Nov 21, 2024
## Summary

This is a regression from the PR
#195874, where we added the new
type into all but didn't do it for read.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 21, 2024
…201170)

## Summary

This is a regression from the PR
elastic#195874, where we added the new
type into all but didn't do it for read.

(cherry picked from commit 5d4282e)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 21, 2024
…201170)

## Summary

This is a regression from the PR
elastic#195874, where we added the new
type into all but didn't do it for read.

(cherry picked from commit 5d4282e)
kibanamachine added a commit that referenced this pull request Nov 21, 2024
…201170) (#201258)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[Synthetics] Add new object into read synthetics feature !!
(#201170)](#201170)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-21T17:40:09Z","message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","backport:version","v8.17.0","v8.18.0"],"title":"[Synthetics]
Add new object into read synthetics feature
!!","number":201170,"url":"https://github.com/elastic/kibana/pull/201170","mergeCommit":{"message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201170","number":201170,"mergeCommit":{"message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 21, 2024
…01170) (#201259)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Synthetics] Add new object into read synthetics feature !!
(#201170)](#201170)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-21T17:40:09Z","message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","backport:version","v8.17.0","v8.18.0"],"title":"[Synthetics]
Add new object into read synthetics feature
!!","number":201170,"url":"https://github.com/elastic/kibana/pull/201170","mergeCommit":{"message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201170","number":201170,"mergeCommit":{"message":"[Synthetics]
Add new object into read synthetics feature !! (#201170)\n\n##
Summary\n\nThis is a regression from the
PR\nhttps://github.com//pull/195874, where we added the
new\ntype into all but didn't do it for
read.","sha":"5d4282e91621b433e2bdf7201f9bedf47661d152"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…201170)

## Summary

This is a regression from the PR
elastic#195874, where we added the new
type into all but didn't do it for read.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…201170)

## Summary

This is a regression from the PR
elastic#195874, where we added the new
type into all but didn't do it for read.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:fix Team:obs-ux-management Observability Management User Experience Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] lost update while concurrent synthetics private location API calls
9 participants