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

Make saved_objects_tagging plugin shared #205695

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,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 @@ -894,6 +893,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 @@ -3228,7 +3228,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 @@ -790,7 +790,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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix a bug in the script: use group and visibility from the manifest, rather than those inferred from path.

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 @@ -1550,8 +1550,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 @@ -6953,7 +6953,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
Loading