Skip to content

[8.19] [Synthetics] Support projects multi spaces !! (#227674)#228726

Merged
shahzad31 merged 8 commits intoelastic:8.19from
shahzad31:backport/8.19/pr-227674
Jul 22, 2025
Merged

[8.19] [Synthetics] Support projects multi spaces !! (#227674)#228726
shahzad31 merged 8 commits intoelastic:8.19from
shahzad31:backport/8.19/pr-227674

Conversation

@shahzad31
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

## Summary

Follow up to elastic#221568

This  PR allows specifying spaces param in project monitors.

Following use-cases have been supported

User will be able to supports

`spaces: ["defautl", "test"]
`

Proper API tests have been added to provide additional coverage for the
use-case.

### Validations

- [ ] The route to which project api is being called should always be
part of spaces if defined.
- [ ] Non existent space will throw error
- [ ] User must have permission to all specified spaces for CRUDS
- [ ] User can also specify * to create monitors in all spaces

### PR Testing
You can use following project monitors PR to test this PR
elastic/synthetics#1052

First create few project monitors before this branch and then switch and
specify multi spaces as part of the options and verify in UI that
editing , adding and deletion works as expected on push command.

(cherry picked from commit 39d87d0)

# Conflicts:
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project_multi_space.ts
@shahzad31 shahzad31 requested a review from kibanamachine as a code owner July 21, 2025 08:13
@shahzad31 shahzad31 added the backport This PR is a backport of another PR label Jul 21, 2025
@shahzad31 shahzad31 enabled auto-merge (squash) July 21, 2025 08:13
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Jul 21, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@shahzad31 shahzad31 disabled auto-merge July 21, 2025 08:14
@shahzad31 shahzad31 added ci:cloud-redeploy Always create a new Cloud deployment ci:cloud-deploy Create or update a Cloud deployment and removed ci:cloud-redeploy Always create a new Cloud deployment labels Jul 21, 2025
@shahzad31 shahzad31 requested a review from Copilot July 21, 2025 08:50
@shahzad31
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

There are no new commits on the base branch.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR backports support for multi-space project monitors in Synthetics from version 8.19. The feature allows specifying spaces in project monitor configurations, enabling monitors to be created across multiple Kibana spaces.

  • Adds multi-space validation and permission checks for project monitors
  • Implements space-aware monitor creation and updates with proper namespace handling
  • Adds comprehensive test coverage for multi-space functionality

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
create_monitor_project_multi_space.ts New comprehensive test suite for multi-space project monitor functionality
index.ts Adds test file reference for multi-space monitor tests
create_monitor_project.ts Minor formatting changes to import statements and test description
add_monitor_project_multi_space.ts Adds extensive multi-space permission and security test cases
common_fields.ts Adds spaces field to monitor configuration normalization
common_fields.test.ts Updates test expectations to include spaces field
synthetics_route_wrapper.ts Adds Kibana response handling for better error management
monitor_config_repository.ts Major refactoring to support space-aware monitor creation and updates
monitor_config_repository.test.ts Comprehensive test updates for new repository functionality
synthetics_monitor.ts File deletion (copyright header only)
add_monitor_project.ts Adds multi-space validation and permission checking logic
edit_monitor_bulk.ts Updates to use new monitor update signature
monitor_types_project.ts Adds spaces field to project monitor type definition

shahzad31 and others added 4 commits July 21, 2025 10:53
…lity/synthetics/index.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/dashboards --include-path /api/maintenance_window --update --no-serverless'
@shahzad31 shahzad31 enabled auto-merge (squash) July 21, 2025 20:01
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jul 22, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / MonitorEditPage shows duplicate error when "nameAlreadyExists" is true

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
synthetics 1.0MB 1.0MB +25.0B

History

@shahzad31 shahzad31 merged commit d44eed5 into elastic:8.19 Jul 22, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:cloud-deploy Create or update a Cloud deployment Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants