Skip to content

Commit

Permalink
Merge branch 'main' into non-text-content
Browse files Browse the repository at this point in the history
  • Loading branch information
BionIT authored Jun 5, 2024
2 parents de1f206 + 48144c8 commit c007889
Show file tree
Hide file tree
Showing 54 changed files with 1,111 additions and 24,811 deletions.
34 changes: 15 additions & 19 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,26 +272,22 @@ module.exports = {
basePath: __dirname,
zones: [
{
target: ['(src)/**/*', '!src/core/**/*'],
target: ['src/**/*', '!src/core/**/*'],
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
target: ['(src)/plugins/*/server/**/*'],
from: ['(src)/plugins/*/public/**/*'],
target: ['src/plugins/*/server/**/*'],
from: ['src/plugins/*/public/**/*'],
errorMessage: `Server code can not import from public, use a common directory.`,
},
{
target: ['(src)/plugins/*/common/**/*'],
from: ['(src)/plugins/*/(server|public)/**/*'],
target: ['src/plugins/*/common/**/*'],
from: ['src/plugins/*/(server|public)/**/*'],
errorMessage: `Common code can not import from server or public, use a common directory.`,
},
{
target: [
'src/legacy/**/*',
'(src)/plugins/**/(public|server)/**/*',
'examples/**/*',
],
target: ['src/legacy/**/*', 'src/plugins/**/(public|server)/**/*', 'examples/**/*'],
from: [
'src/core/public/**/*',
'!src/core/public/index.ts', // relative import
Expand Down Expand Up @@ -320,30 +316,30 @@ module.exports = {
{
target: [
'src/legacy/**/*',
'(src)/plugins/**/(public|server)/**/*',
'src/plugins/**/(public|server)/**/*',
'examples/**/*',
'!(src)/**/*.test.*',
'!src/**/*.test.*',
],
from: [
'(src)/plugins/**/(public|server)/**/*',
'!(src)/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
'!(src)/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
'src/plugins/**/(public|server)/**/*',
'!src/plugins/**/(public|server)/mocks/index.{js,mjs,ts}',
'!src/plugins/**/(public|server)/(index|mocks).{js,mjs,ts,tsx}',
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
},
{
target: [
'(src)/plugins/**/*',
'!(src)/plugins/**/server/**/*',
'src/plugins/**/*',
'!src/plugins/**/server/**/*',

'examples/**/*',
'!examples/**/server/**/*',
],
from: [
'src/core/server',
'src/core/server/**/*',
'(src)/plugins/*/server/**/*',
'src/plugins/*/server/**/*',
'examples/**/server/**/*',
],
errorMessage:
Expand All @@ -355,7 +351,7 @@ module.exports = {
errorMessage: 'The core cannot depend on any plugins.',
},
{
target: ['(src)/plugins/*/public/**/*'],
target: ['src/plugins/*/public/**/*'],
from: ['ui/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ on:
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.lycheeignore'
- 'changelogs/fragments/**'
pull_request:
branches: ['**']
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.lycheeignore'
- 'changelogs/fragments/**'

env:
TEST_BROWSER_HEADLESS: 1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches: [ '**' ]
paths-ignore:
- '**/*.md'
- '.lycheeignore'
- 'changelogs/fragments/**'
workflow_dispatch:
inputs:
test_repo:
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/6492.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security:
- [CVE-2024-28863] Bump tar from 6.1.11 to 6.2.1 ([#6492](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6492))
2 changes: 2 additions & 0 deletions changelogs/fragments/6770.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security:
- [CVE-2024-33883] Bump ejs from `3.1.7` to `3.1.10` ([#6770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6770))
2 changes: 2 additions & 0 deletions changelogs/fragments/6780.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Discover][Bug] Migrate global state from legacy URL ([#6780](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6780))
2 changes: 2 additions & 0 deletions changelogs/fragments/6831.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [Workspace] Only OSD admin can create workspace ([#6831](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6831))
2 changes: 2 additions & 0 deletions changelogs/fragments/6899.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Remove endpoint validation for create data source saved object API ([#6899](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6899))
2 changes: 2 additions & 0 deletions changelogs/fragments/6908.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix not setting the default data source when creating data source bug ([#6908](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6908))
2 changes: 2 additions & 0 deletions changelogs/fragments/6911.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
security:
- [CVE-2024-4067][CVE-2024-4068] Bump packages dependent on `braces` versions lower than 3.0.3 ([#6911](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6911))
2 changes: 2 additions & 0 deletions changelogs/fragments/6915.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Use JSON11 for handling long numerals ([#6915](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6915))
2 changes: 2 additions & 0 deletions changelogs/fragments/6928.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- [MD]Use placeholder for data source credentials fields when export saved object ([#6928](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6928))
3 changes: 2 additions & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
# savedObjects.permission.enabled: true

# Set the value to true to enable workspace feature
# Please note, workspace will not work with multi-tenancy. To enable workspace feature, you need to disable multi-tenancy first with `opensearch_security.multitenancy.enabled: false`
# workspace.enabled: false

# Optional settings to specify saved object types to be deleted during migration.
Expand All @@ -338,4 +339,4 @@
# Set the backend roles in groups or users, whoever has the backend roles or exactly match the user ids defined in this config will be regard as dashboard admin.
# Dashboard admin will have the access to all the workspaces(workspace.enabled: true) and objects inside OpenSearch Dashboards.
# opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
# opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"**/@types/node": "~18.7.0",
"**/ansi-regex": "^5.0.1",
"**/async": "^3.2.3",
"**/cpy/globby": "^10.0.1",
"**/d3-color": "^3.1.0",
"**/elasticsearch/agentkeepalive": "^4.5.0",
"**/es5-ext": "^0.10.63",
Expand All @@ -103,17 +104,20 @@
"**/jest-config": "npm:@amoo-miki/[email protected]",
"**/jest-jasmine2": "npm:@amoo-miki/[email protected]",
"**/joi/hoek": "npm:@amoo-miki/[email protected]",
"**/json11": "^1.1.2",
"**/json-schema": "^0.4.0",
"**/kind-of": ">=6.0.3",
"**/loader-utils": "^2.0.4",
"**/node-jose": "^2.2.0",
"**/nth-check": "^2.0.1",
"**/semver": "^7.5.3",
"**/set-value": "^4.1.0",
"**/tar":"^6.2.1",
"**/topo/hoek": "npm:@amoo-miki/[email protected]",
"**/trim": "^0.0.3",
"**/typescript": "4.6.4",
"**/unset-value": "^2.0.1",
"**/watchpack-chokidar2/chokidar": "^3.5.3",
"**/xml2js": "^0.5.0",
"**/yaml": "^2.2.2"
},
Expand Down Expand Up @@ -153,7 +157,7 @@
"@hapi/podium": "^4.1.3",
"@hapi/vision": "^6.1.0",
"@hapi/wreck": "^17.1.0",
"@opensearch-project/opensearch": "^2.6.0",
"@opensearch-project/opensearch": "^2.9.0",
"@opensearch/datemath": "5.0.3",
"@osd/ace": "1.0.0",
"@osd/analytics": "1.0.0",
Expand Down Expand Up @@ -296,7 +300,6 @@
"@types/getopts": "^2.0.1",
"@types/getos": "^3.0.0",
"@types/glob": "^7.1.3",
"@types/globby": "^8.0.0",
"@types/hapi__cookie": "^10.1.4",
"@types/hapi__h2o2": "^8.3.3",
"@types/hapi__hapi": "^20.0.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-ace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@osd/babel-preset": "1.0.0",
"raw-loader": "^4.0.2",
"typescript": "4.0.2",
"webpack": "npm:@amoo-miki/[email protected]rc.2"
"webpack": "npm:@amoo-miki/[email protected]xxhash.1"
},
"@osd/pm": {
"web": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"glob-all": "^3.2.1",
"lru-cache": "^4.1.5",
"resolve": "^1.7.1",
"webpack": "npm:@amoo-miki/[email protected]rc.2"
"webpack": "npm:@amoo-miki/[email protected]xxhash.1"
}
}
2 changes: 1 addition & 1 deletion packages/osd-eslint-plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"babel-eslint": "^10.0.3"
},
"dependencies": {
"micromatch": "3.1.10",
"micromatch": "^4.0.7",
"dedent": "^0.7.0",
"eslint-module-utils": "2.5.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ ruleTester.run('@osd/eslint/no-restricted-paths', rule, {
},

{
// Does not allow to import deeply within Core, using "src/core/..." Webpack alias.
// Does not allow to require deeply within Core, using "src/core/..." Webpack alias.
code: 'const d = require("src/core/server/saved_objects")',
filename: path.join(__dirname, './testfiles/no_restricted_paths/client/a.js'),
options: [
Expand All @@ -393,6 +393,32 @@ ruleTester.run('@osd/eslint/no-restricted-paths', rule, {
],
},

{
// Does not allow to import deeply within Core, using "src/core/...".
code: `
import { X as XX } from 'src/core/public';
import { X as XY } from 'src/core/server';`,
filename: path.join(__dirname, './testfiles/no_restricted_paths/client/a.js'),
options: [
{
basePath: __dirname,
zones: [
{
target: ['**/testfiles/**/*', '!**/testfiles/**/server/**/*'],
from: ['src/core/server', 'src/core/server/**/*'],
},
],
},
],
errors: [
{
message: 'Unexpected path "src/core/server" imported in restricted zone.',
line: 3,
column: 31,
},
],
},

{
// Does not allow to import "ui/kfetch".
code: 'const d = require("ui/kfetch")',
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-interpreter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"style-loader": "^1.1.3",
"supports-color": "^7.0.0",
"url-loader": "^2.2.0",
"webpack": "npm:@amoo-miki/[email protected]rc.2",
"webpack": "npm:@amoo-miki/[email protected]xxhash.1",
"webpack-cli": "^4.9.2"
}
}
2 changes: 1 addition & 1 deletion packages/osd-monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"raw-loader": "^4.0.2",
"supports-color": "^7.0.0",
"typescript": "4.0.2",
"webpack": "npm:@amoo-miki/[email protected]rc.2",
"webpack": "npm:@amoo-miki/[email protected]xxhash.1",
"webpack-cli": "^4.9.2"
}
}
2 changes: 1 addition & 1 deletion packages/osd-opensearch-archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@osd/dev-utils": "1.0.0",
"@osd/std": "1.0.0",
"@opensearch-project/opensearch": "^2.6.0"
"@opensearch-project/opensearch": "^2.9.0"
},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion packages/osd-opensearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"osd:watch": "../../scripts/use_node scripts/build --watch"
},
"dependencies": {
"@opensearch-project/opensearch": "^2.6.0",
"@opensearch-project/opensearch": "^2.9.0",
"@osd/dev-utils": "1.0.0",
"abort-controller": "^3.0.0",
"chalk": "^4.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/compression-webpack-plugin": "^6.0.6",
"@types/loader-utils": "^1.1.3",
"@types/source-map-support": "^0.5.3",
"@types/watchpack": "^1.1.6",
"@types/watchpack": "^2.4.4",
"@types/webpack": "^4.41.31",
"babel-loader": "^8.2.3",
"comment-stripper": "^0.0.4",
Expand All @@ -58,6 +58,6 @@
"style-loader": "^1.1.3",
"url-loader": "^2.2.0",
"val-loader": "^2.1.2",
"webpack": "npm:@amoo-miki/[email protected]rc.2"
"webpack": "npm:@amoo-miki/[email protected]xxhash.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ beforeAll(async () => {
await cpy('**/*', MOCK_REPO_DIR, {
cwd: MOCK_REPO_SRC,
parents: true,
deep: true,
deep: Infinity,
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ beforeEach(async () => {
await cpy('**/*', MOCK_REPO_DIR, {
cwd: MOCK_REPO_SRC,
parents: true,
deep: true,
deep: Infinity,
});
});

Expand Down
8 changes: 6 additions & 2 deletions packages/osd-optimizer/src/optimizer/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class Watcher {
take(1)
),

// call watchpack.watch after listerners are setup
// call watchpack.watch after listeners are set up
Rx.defer(() => {
const watchPaths: string[] = [];

Expand All @@ -104,7 +104,11 @@ export class Watcher {
}
}

this.watchpack.watch(watchPaths, [], startTime);
this.watchpack.watch({
files: watchPaths,
startTime,
});

return Rx.EMPTY;
})
);
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-plugin-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@osd/cross-platform": "1.0.0",
"@osd/dev-utils": "1.0.0",
"ejs": "^3.1.7",
"ejs": "^3.1.10",
"execa": "^4.0.2",
"inquirer": "^7.3.3",
"normalize-path": "^3.0.0",
Expand Down
Loading

0 comments on commit c007889

Please sign in to comment.