Skip to content

Commit

Permalink
Make saved_objects_tagging plugin shared (#205695)
Browse files Browse the repository at this point in the history
## Summary

So that it can be used from `streams_app` (o11y).
See  #204309

Steps to relocate:

1. Fetch latest `main`
2. Update the `group` and/or `visibility` in the module's manifest.
3. Run `node scripts/relocate --moveOnly
@kbn/saved-objects-tagging-plugin`
  • Loading branch information
gsoldevila authored Jan 7, 2025
1 parent 49b477d commit a8579bb
Show file tree
Hide file tree
Showing 171 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,6 @@ x-pack/platform/plugins/private/remote_clusters @elastic/kibana-management
x-pack/platform/plugins/private/reporting @elastic/appex-sharedux
x-pack/platform/plugins/private/rollup @elastic/kibana-management
x-pack/platform/plugins/private/runtime_fields @elastic/kibana-management
x-pack/platform/plugins/private/saved_objects_tagging @elastic/appex-sharedux
x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management
x-pack/platform/plugins/private/telemetry_collection_xpack @elastic/kibana-core
x-pack/platform/plugins/private/transform @elastic/ml-ui
Expand Down Expand Up @@ -893,6 +892,7 @@ x-pack/platform/plugins/shared/notifications @elastic/appex-sharedux
x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant
x-pack/platform/plugins/shared/osquery @elastic/security-defend-workflows
x-pack/platform/plugins/shared/rule_registry @elastic/response-ops @elastic/obs-ux-management-team
x-pack/platform/plugins/shared/saved_objects_tagging @elastic/appex-sharedux
x-pack/platform/plugins/shared/screenshotting @elastic/kibana-reporting-services
x-pack/platform/plugins/shared/searchprofiler @elastic/kibana-management
x-pack/platform/plugins/shared/security @elastic/kibana-security
Expand Down Expand Up @@ -3233,7 +3233,7 @@ x-pack/platform/plugins/private/remote_clusters @elastic/kibana-management
x-pack/platform/plugins/private/reporting @elastic/appex-sharedux
x-pack/platform/plugins/private/rollup @elastic/kibana-management
x-pack/platform/plugins/private/runtime_fields @elastic/kibana-management
x-pack/platform/plugins/private/saved_objects_tagging @elastic/appex-sharedux
x-pack/platform/plugins/shared/saved_objects_tagging @elastic/appex-sharedux
x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management
x-pack/platform/plugins/private/telemetry_collection_xpack @elastic/kibana-core
x-pack/platform/plugins/private/transform @elastic/ml-ui
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ Elastic.
|Welcome to the home of the runtime field editor and everything related to runtime fields!
|{kib-repo}blob/{branch}/x-pack/platform/plugins/private/saved_objects_tagging/README.md[savedObjectsTagging]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/saved_objects_tagging/README.md[savedObjectsTagging]
|Add tagging capability to saved objects
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@
"@kbn/saved-objects-plugin": "link:src/platform/plugins/shared/saved_objects",
"@kbn/saved-objects-settings": "link:packages/kbn-saved-objects-settings",
"@kbn/saved-objects-tagging-oss-plugin": "link:src/platform/plugins/shared/saved_objects_tagging_oss",
"@kbn/saved-objects-tagging-plugin": "link:x-pack/platform/plugins/private/saved_objects_tagging",
"@kbn/saved-objects-tagging-plugin": "link:x-pack/platform/plugins/shared/saved_objects_tagging",
"@kbn/saved-search-component": "link:packages/kbn-saved-search-component",
"@kbn/saved-search-plugin": "link:src/platform/plugins/shared/saved_search",
"@kbn/screenshot-mode-example-plugin": "link:examples/screenshot_mode_example",
Expand Down
6 changes: 4 additions & 2 deletions packages/kbn-relocate/utils/relocate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ export const calculateModuleTargetFolder = (module: Package): string => {
};

export const isInTargetFolder = (module: Package, log: ToolingLog): boolean => {
if (!module.group || module.group === 'common' || !module.visibility) {
const { group, visibility } = module.manifest;

if (!group || group === 'common' || !visibility) {
log.warning(`The module '${module.id}' is missing the group/visibility information`);
return false;
}

const baseTargetFolders = TARGET_FOLDERS[`${module.group}:${module.visibility}`];
const baseTargetFolders = TARGET_FOLDERS[`${group}:${visibility}`];
const baseTargetFolder = baseTargetFolders.find((candidate) => {
return module.directory.includes(candidate);
});
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1548,8 +1548,8 @@
"@kbn/saved-objects-settings/*": ["packages/kbn-saved-objects-settings/*"],
"@kbn/saved-objects-tagging-oss-plugin": ["src/platform/plugins/shared/saved_objects_tagging_oss"],
"@kbn/saved-objects-tagging-oss-plugin/*": ["src/platform/plugins/shared/saved_objects_tagging_oss/*"],
"@kbn/saved-objects-tagging-plugin": ["x-pack/platform/plugins/private/saved_objects_tagging"],
"@kbn/saved-objects-tagging-plugin/*": ["x-pack/platform/plugins/private/saved_objects_tagging/*"],
"@kbn/saved-objects-tagging-plugin": ["x-pack/platform/plugins/shared/saved_objects_tagging"],
"@kbn/saved-objects-tagging-plugin/*": ["x-pack/platform/plugins/shared/saved_objects_tagging/*"],
"@kbn/saved-search-component": ["packages/kbn-saved-search-component"],
"@kbn/saved-search-component/*": ["packages/kbn-saved-search-component/*"],
"@kbn/saved-search-plugin": ["src/platform/plugins/shared/saved_search"],
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"xpack.snapshotRestore": "platform/plugins/private/snapshot_restore",
"xpack.spaces": "platform/plugins/shared/spaces",
"xpack.savedObjectsTagging": [
"platform/plugins/private/saved_objects_tagging"
"platform/plugins/shared/saved_objects_tagging"
],
"xpack.taskManager": "legacy/platform/plugins/shared/task_manager",
"xpack.threatIntelligence": "solutions/security/plugins/threat_intelligence",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ features.registerKibanaFeature({

### Update the SOT telemetry collector schema to add the new type

The schema is located here: `x-pack/platform/plugins/private/saved_objects_tagging/server/usage/schema.ts`. You
The schema is located here: `x-pack/platform/plugins/shared/saved_objects_tagging/server/usage/schema.ts`. You
just need to add the name of the SO type you are adding.

```ts
Expand All @@ -54,5 +54,5 @@ export const tagUsageCollectorSchema: MakeSchemaFrom<TaggingUsageData> = {

### Update the `taggableTypes` constant to add your type

Edit the `taggableTypes` list in `x-pack/platform/plugins/private/saved_objects_tagging/common/constants.ts` to add
Edit the `taggableTypes` list in `x-pack/platform/plugins/shared/saved_objects_tagging/common/constants.ts` to add
the name of the type you are adding.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/private/saved_objects_tagging'],
roots: ['<rootDir>/x-pack/platform/plugins/shared/saved_objects_tagging'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/private/saved_objects_tagging',
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/saved_objects_tagging',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/platform/plugins/private/saved_objects_tagging/{common,public,server}/**/*.{ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/saved_objects_tagging/{common,public,server}/**/*.{ts,tsx}',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@elastic/appex-sharedux"
],
"group": "platform",
"visibility": "private",
"visibility": "shared",
"plugin": {
"id": "savedObjectsTagging",
"browser": true,
Expand All @@ -25,4 +25,4 @@
],
"requiredBundles": []
}
}
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6949,7 +6949,7 @@
version "0.0.0"
uid ""

"@kbn/saved-objects-tagging-plugin@link:x-pack/platform/plugins/private/saved_objects_tagging":
"@kbn/saved-objects-tagging-plugin@link:x-pack/platform/plugins/shared/saved_objects_tagging":
version "0.0.0"
uid ""

Expand Down

0 comments on commit a8579bb

Please sign in to comment.