Skip to content

Commit

Permalink
Merge branch 'main' into geckodriver-cve
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin-pc authored Sep 15, 2022
2 parents d8e2fc8 + bebbcca commit c031614
Show file tree
Hide file tree
Showing 194 changed files with 2,227 additions and 475 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ name: Build and test
on:
push:
branches: [ '**', '!feature/**', '!backport/**' ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ '**', '!feature/**' ]
paths-ignore:
- '**/*.md'

env:
TEST_BROWSER_HEADLESS: 1
Expand Down Expand Up @@ -182,7 +186,7 @@ jobs:
working-directory: ./artifacts
strategy:
matrix:
version: [ osd-2.0.0, osd-2.1.0 ]
version: [ osd-2.0.0, osd-2.1.0, osd-2.2.0 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion bwctest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

set -e

DEFAULT_VERSIONS="osd-2.0.0,osd-2.1.0"
DEFAULT_VERSIONS="osd-2.0.0,osd-2.1.0,osd-2.2.0"

function usage() {
echo ""
Expand Down
5 changes: 4 additions & 1 deletion config/opensearch_dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
# This node attribute should assign all nodes of the same cluster an integer value that increments with each new cluster that is spun up
# e.g. in opensearch.yml file you would set the value to a setting using node.attr.cluster_id:
# Should only be enabled if there is a corresponding node attribute created in your OpenSearch config that matches the value here
#opensearch.optimizedHealthcheckId: "cluster_id"
#opensearch.optimizedHealthcheck.id: "cluster_id"
#opensearch.optimizedHealthcheck.filters: {
# attribute_key: "attribute_value",
#}

# If your OpenSearch is protected with basic authentication, these settings provide
# the username and password that the OpenSearch Dashboards server uses to perform maintenance on the OpenSearch Dashboards
Expand Down
Binary file added cypress/test-data/with-security/osd-2.2.0.tar.gz
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
"leaflet": "1.5.1",
"leaflet-draw": "0.4.14",
"leaflet-responsive-popup": "0.6.4",
"leaflet-vega": "^0.8.6",
"leaflet-vega": "npm:@amoo-miki/leaflet-vega@0.8.8",
"leaflet.heat": "0.2.0",
"less": "^4.1.2",
"license-checker": "^16.0.0",
Expand Down Expand Up @@ -445,6 +445,7 @@
"typescript": "4.0.2",
"ui-select": "0.19.8",
"vega": "^5.17.3",
"vega-interpreter": "npm:@amoo-miki/[email protected]",
"vega-lite": "^4.16.8",
"vega-schema-url-parser": "^2.1.0",
"vega-tooltip": "^0.24.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/osd-optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@
"dedent": "^0.7.0",
"del": "^5.1.0",
"execa": "^4.0.2",
"fibers": "^5.0.3",
"file-loader": "^4.2.0",
"jest-diff": "^27.5.1",
"js-yaml": "^3.14.0",
"json-stable-stringify": "^1.0.1",
"lmdb-store": "^1.6.11",
"loader-utils": "^1.2.3",
"sass": "~1.26.11",
"normalize-path": "^3.0.0",
"pirates": "^4.0.1",
"postcss": "^8.4.5",
"postcss-loader": "^4.2.0",
"raw-loader": "^4.0.2",
"rxjs": "^6.5.5",
"sass": "~1.26.11",
"sass-loader": "^10.2.0",
"source-map-support": "^0.5.19",
"style-loader": "^1.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/osd-optimizer/src/worker/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker:
outputStyle: 'compressed',
includePaths: [Path.resolve(worker.repoRoot, 'node_modules')],
sourceMapRoot: `/${bundle.type}:${bundle.id}`,
fiber: require('fibers'),
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions release-notes/opensearch-dashboards.release-notes-1.3.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Version 1.3.5 Release Notes

### 🛡 Security
* Bump moment from 2.29.2 to 2.29.4 ([#1931](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/1931))
* [CVE] Add resolution for url-parse ([#2181](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2181))

### 🐛 Bug Fixes
Fix WMS can't load when unable access maps services([#1550](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/1550))

### 🔩 Tests
* Bump chrome driver version in PR check workflow ([#2186](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2186))

### 🛠 Maintenance
* Version increment to 1.3.5 ([#1901](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/1901))
4 changes: 4 additions & 0 deletions release-notes/opensearch-dashboards.release-notes-2.2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Version 2.2.1 Release Notes

### 🛠 Maintenance
* Bump 2.2 branch version to be 2.2.1 ([#2129](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2129))
31 changes: 31 additions & 0 deletions release-notes/opensearch-dashboards.release-notes-2.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Version 2.3.0 Release Notes

### 📈 Features/Enhancements

- [D&D] Add new states in metadata slice ([#2193](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2193))
- [D&D] Add visualization type switcher for Wizard ([#2217](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2217))
- [D&D] Save index pattern using proper saved object structure ([#2218](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2218))
- [D&D] Persist index field on agg type change if possible ([#2227](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2227))
- [D&D] Add count field to field picker ([#2231](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2231))
- [D&D] Add Bar line and Area charts to Wizard ([#2266](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2266))

### 🐛 Bug Fixes

- Fix maps wms zoom limitation ([#1915](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/1915))
- [Visualizations] Add visConfig.title and uiState to build pipeline function (([#2192](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2192))
- Custom healthcheck with filters ([#2232](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2232))
- [BUG] Fix healthcheck logic to expect object and return ids ([#2277](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2277))

### 🚞 Refactor

- [DeAngular][visualization][vislib] Remove angular from vislib ([#2138](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2138))
- Change timeline icon ([#2162](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2162))

### 🛠 Maintenance

- Increment from 2.2 to 2.3. ([#2096](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2096))

### 🔩 Tests

- [CI][tests] Add backwards compatibility (BWC) tests for 2.3.0 ([#2281](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2281))
- Fix 2.x backwards compatibility (BWC) tests by restoring 1.3.2 ([#2284](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2284))
15 changes: 12 additions & 3 deletions src/core/server/opensearch/opensearch_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ test('set correct defaults', () => {
"enabled": false,
"maxPercentage": 1,
},
"optimizedHealthcheckId": undefined,
"optimizedHealthcheck": undefined,
"password": undefined,
"pingTimeout": "PT30S",
"requestHeadersWhitelist": Array [
Expand Down Expand Up @@ -491,11 +491,20 @@ describe('deprecations', () => {
`);
});

it('logs a warning if elasticsearch.optimizedHealthcheckId is set and opensearch.optimizedHealthcheckId is not', () => {
it('logs a warning if elasticsearch.optimizedHealthcheckId is set and opensearch.optimizedHealthcheck.id is not', () => {
const { messages } = applyLegacyDeprecations({ optimizedHealthcheckId: '' });
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"elasticsearch.optimizedHealthcheckId\\" is deprecated and has been replaced by \\"opensearch.optimizedHealthcheckId\\"",
"\\"elasticsearch.optimizedHealthcheckId\\" is deprecated and has been replaced by \\"opensearch.optimizedHealthcheck.id\\"",
]
`);
});

it('logs a warning if opensearch.optimizedHealthcheckId is set and opensearch.optimizedHealthcheck.id is not', () => {
const { messages } = applyOpenSearchDeprecations({ optimizedHealthcheckId: '' });
expect(messages).toMatchInlineSnapshot(`
Array [
"\\"opensearch.optimizedHealthcheckId\\" is deprecated and has been replaced by \\"opensearch.optimizedHealthcheck.id\\"",
]
`);
});
Expand Down
16 changes: 12 additions & 4 deletions src/core/server/opensearch/opensearch_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ export const configSchema = schema.object({
requestTimeout: schema.duration({ defaultValue: '30s' }),
pingTimeout: schema.duration({ defaultValue: schema.siblingRef('requestTimeout') }),
logQueries: schema.boolean({ defaultValue: false }),
optimizedHealthcheckId: schema.maybe(schema.string()),
optimizedHealthcheck: schema.maybe(
schema.object({
id: schema.string(),
filters: schema.maybe(
schema.recordOf(schema.string(), schema.string(), { defaultValue: {} })
),
})
),
ssl: schema.object(
{
verificationMode: schema.oneOf(
Expand Down Expand Up @@ -158,7 +165,8 @@ const deprecations: ConfigDeprecationProvider = ({ renameFromRoot, renameFromRoo
renameFromRoot('elasticsearch.requestTimeout', 'opensearch.requestTimeout'),
renameFromRoot('elasticsearch.pingTimeout', 'opensearch.pingTimeout'),
renameFromRoot('elasticsearch.logQueries', 'opensearch.logQueries'),
renameFromRoot('elasticsearch.optimizedHealthcheckId', 'opensearch.optimizedHealthcheckId'),
renameFromRoot('elasticsearch.optimizedHealthcheckId', 'opensearch.optimizedHealthcheck.id'),
renameFromRoot('opensearch.optimizedHealthcheckId', 'opensearch.optimizedHealthcheck.id'),
renameFromRoot('elasticsearch.ssl', 'opensearch.ssl'),
renameFromRoot('elasticsearch.apiVersion', 'opensearch.apiVersion'),
renameFromRoot('elasticsearch.healthCheck', 'opensearch.healthCheck'),
Expand Down Expand Up @@ -226,7 +234,7 @@ export class OpenSearchConfig {
* Specifies whether Dashboards should only query the local OpenSearch node when
* all nodes in the cluster have the same node attribute value
*/
public readonly optimizedHealthcheckId?: string;
public readonly optimizedHealthcheck?: OpenSearchConfigType['optimizedHealthcheck'];

/**
* Hosts that the client will connect to. If sniffing is enabled, this list will
Expand Down Expand Up @@ -314,7 +322,7 @@ export class OpenSearchConfig {
this.ignoreVersionMismatch = rawConfig.ignoreVersionMismatch;
this.apiVersion = rawConfig.apiVersion;
this.logQueries = rawConfig.logQueries;
this.optimizedHealthcheckId = rawConfig.optimizedHealthcheckId;
this.optimizedHealthcheck = rawConfig.optimizedHealthcheck;
this.hosts = Array.isArray(rawConfig.hosts) ? rawConfig.hosts : [rawConfig.hosts];
this.requestHeadersWhitelist = Array.isArray(rawConfig.requestHeadersWhitelist)
? rawConfig.requestHeadersWhitelist
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/opensearch/opensearch_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class OpenSearchService

const opensearchNodesCompatibility$ = pollOpenSearchNodesVersion({
internalClient: this.client.asInternalUser,
optimizedHealthcheckId: config.optimizedHealthcheckId,
optimizedHealthcheck: config.optimizedHealthcheck,
log: this.log,
ignoreVersionMismatch: config.ignoreVersionMismatch,
opensearchVersionCheckInterval: config.healthCheckDelay.asMilliseconds(),
Expand Down
Loading

0 comments on commit c031614

Please sign in to comment.