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

[Synthetic] Show monitors from all permitted spaces !! #196109

Merged
merged 28 commits into from
Oct 16, 2024

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Oct 14, 2024

Summary

Fixes #194760 !!
Fixes #169753 !!

Added an options to list monitors from all spaces which user has permission for , user can either select default option which is to get monitors from current space or all permitted spaces !!

Testing

Create monitors in 3 spaces, assign 2 spaces to a role, and create a user. Make sure monitors only appears to which user have space permission.

image

@shahzad31 shahzad31 marked this pull request as ready for review October 14, 2024 14:50
@shahzad31 shahzad31 requested a review from a team as a code owner October 14, 2024 14:50
@shahzad31 shahzad31 added release_note:feature Makes this part of the condensed release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 14, 2024
@justinkambic justinkambic added v9.0.0 Team:obs-ux-management Observability Management User Experience Team v8.16.0 labels Oct 14, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

I created two new spaces: David's Space and Jennifer's Space. I created corresponding roles and assigned those roles to their respective spaces.

I then created two users, David and Jennifer, and granted them their corresponding roles.

As an admin, I went to the create monitor page in the default space. I likewise did this in the other two spaces.

I navigated to the default space, and the other two spaces as the admin and was able to see the monitors scoped to the current space, as well as all monitors from other spaces.

In another browser, I logged in as David and Jennifer users. As these lower-priv users I was only able to see the monitors created with the scope they have permission to view, even when choosing the "all permitted spaces" option.

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Oct 14, 2024
Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

LGTM

Note: I added 2b96fb4 and 34c480d in the interests of time. They seemed to work during my smoke testing.

It would be good to include an API test for this as well if possible.

internal: true,
version: INITIAL_REST_VERSION,
});
if (spaceId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to reduce nesting here by simply handling if (!spaceId) return {...} and doing the additional computation in the root of the function, but not worth blocking the PR.

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 16, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 59fcf5e
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-196109-59fcf5eea9f6

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
synthetics 1032 1033 +1

Async chunks

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

id before after diff
synthetics 1.1MB 1.1MB +4.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
synthetics 37.1KB 37.6KB +493.0B

History

@shahzad31 shahzad31 merged commit 2f67874 into elastic:main Oct 16, 2024
25 checks passed
@shahzad31 shahzad31 deleted the synth-spaces branch October 16, 2024 19:08
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 16, 2024
## Summary

Fixes elastic#194760 !!
Fixes elastic#169753 !!

Added an options to list monitors from all spaces which user has
permission for , user can either select default option which is to get
monitors from current space or all permitted spaces !!

### Testing

Create monitors in 3 spaces, assign 2 spaces to a role, and create a
user. Make sure monitors only appears to which user have space
permission.

<img width="1727" alt="image"
src="https://github.com/user-attachments/assets/972d213a-ee00-4950-be9f-a209393cb69a">

---------

Co-authored-by: Justin Kambic <[email protected]>
(cherry picked from commit 2f67874)
@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 Oct 16, 2024
#196596)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Synthetic] Show monitors from all permitted spaces !!
(#196109)](#196109)

<!--- 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-10-16T19:08:34Z","message":"[Synthetic]
Show monitors from all permitted spaces !! (#196109)\n\n##
Summary\n\nFixes #194760
!!\nFixes #169753 !!\n\nAdded an
options to list monitors from all spaces which user has\npermission for
, user can either select default option which is to get\nmonitors from
current space or all permitted spaces !!\n\n### Testing\n\nCreate
monitors in 3 spaces, assign 2 spaces to a role, and create a\nuser.
Make sure monitors only appears to which user have
space\npermission.\n\n<img width=\"1727\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/972d213a-ee00-4950-be9f-a209393cb69a\">\n\n---------\n\nCo-authored-by:
Justin Kambic
<[email protected]>","sha":"2f678744ab3b512cf5e212671a35b81edd1aeec9","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["v9.0.0","release_note:feature","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0"],"title":"[Synthetic]
Show monitors from all permitted spaces
!!","number":196109,"url":"https://github.com/elastic/kibana/pull/196109","mergeCommit":{"message":"[Synthetic]
Show monitors from all permitted spaces !! (#196109)\n\n##
Summary\n\nFixes #194760
!!\nFixes #169753 !!\n\nAdded an
options to list monitors from all spaces which user has\npermission for
, user can either select default option which is to get\nmonitors from
current space or all permitted spaces !!\n\n### Testing\n\nCreate
monitors in 3 spaces, assign 2 spaces to a role, and create a\nuser.
Make sure monitors only appears to which user have
space\npermission.\n\n<img width=\"1727\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/972d213a-ee00-4950-be9f-a209393cb69a\">\n\n---------\n\nCo-authored-by:
Justin Kambic
<[email protected]>","sha":"2f678744ab3b512cf5e212671a35b81edd1aeec9"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196109","number":196109,"mergeCommit":{"message":"[Synthetic]
Show monitors from all permitted spaces !! (#196109)\n\n##
Summary\n\nFixes #194760
!!\nFixes #169753 !!\n\nAdded an
options to list monitors from all spaces which user has\npermission for
, user can either select default option which is to get\nmonitors from
current space or all permitted spaces !!\n\n### Testing\n\nCreate
monitors in 3 spaces, assign 2 spaces to a role, and create a\nuser.
Make sure monitors only appears to which user have
space\npermission.\n\n<img width=\"1727\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/972d213a-ee00-4950-be9f-a209393cb69a\">\n\n---------\n\nCo-authored-by:
Justin Kambic
<[email protected]>","sha":"2f678744ab3b512cf5e212671a35b81edd1aeec9"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
hop-dev pushed a commit to hop-dev/kibana that referenced this pull request Oct 17, 2024
## Summary

Fixes elastic#194760 !!
Fixes elastic#169753 !!

Added an options to list monitors from all spaces which user has
permission for , user can either select default option which is to get
monitors from current space or all permitted spaces !!

### Testing

Create monitors in 3 spaces, assign 2 spaces to a role, and create a
user. Make sure monitors only appears to which user have space
permission.

<img width="1727" alt="image"
src="https://github.com/user-attachments/assets/972d213a-ee00-4950-be9f-a209393cb69a">

---------

Co-authored-by: Justin Kambic <[email protected]>
@shahzad31 shahzad31 added v8.17.0 and removed v8.16.0 labels Nov 12, 2024
shahzad31 added a commit that referenced this pull request Nov 13, 2024
## Summary

This PR #196109 was never
back-ported to 8.16.0 !!
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!

(cherry picked from commit 90b14e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!

(cherry picked from commit 90b14e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!

(cherry picked from commit 90b14e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!

(cherry picked from commit 90b14e2)
kibanamachine added a commit that referenced this pull request Nov 13, 2024
# Backport

This will backport the following commits from `main` to `8.16`:
- [Remove release notes for missing PR !!
(#199878)](#199878)

<!--- 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-13T09:49:56Z","message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.16.1"],"title":"Remove
release notes for missing PR
!!","number":199878,"url":"https://github.com/elastic/kibana/pull/199878","mergeCommit":{"message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199878","number":199878,"mergeCommit":{"message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

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

This will backport the following commits from `main` to `8.x`:
- [Remove release notes for missing PR !!
(#199878)](#199878)

<!--- 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-13T09:49:56Z","message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:version","v8.17.0","v8.16.1"],"title":"Remove
release notes for missing PR
!!","number":199878,"url":"https://github.com/elastic/kibana/pull/199878","mergeCommit":{"message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199878","number":199878,"mergeCommit":{"message":"Remove
release notes for missing PR !! (#199878)\n\n## Summary\r\n\r\nThis PR
#196109 was never\r\nback-ported
to 8.16.0
!!","sha":"90b14e2ba9449e1550a60c47ccd80e55c4e189fa"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
Co-authored-by: Lisa Cawley <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
## Summary

This PR elastic#196109 was never
back-ported to 8.16.0 !!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:feature Makes this part of the condensed release notes Team:obs-ux-management Observability Management User Experience Team v8.17.0 v9.0.0
Projects
None yet
4 participants