Skip to content

Commit

Permalink
[Version] Increment to 3.0 (#1502)
Browse files Browse the repository at this point in the history
Increment from 2.0.0 to 3.0.0, also some version checks.
Also, add a release build verification workflow. To verify x64
and ARM64 artifacts are built successfully with dependencies.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla authored Apr 28, 2022
1 parent 1ad1a8b commit f9e572d
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 5 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,58 @@ jobs:
CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }}
JOB: ci${{ matrix.group }}
CACHE_DIR: ciGroup${{ matrix.group }}

build-min-artifact-tests:
runs-on: ubuntu-latest
name: Build min release artifacts
defaults:
run:
working-directory: ./artifacts
strategy:
matrix:
include:
- name: Linux x64
ext: tar.gz
suffix: linux-x64
script: build-platform --linux --skip-os-packages
- name: Linux ARM64
ext: tar.gz
suffix: linux-arm64
script: build-platform --linux-arm --skip-os-packages
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
path: ./artifacts

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version-file: "./artifacts/.nvmrc"
registry-url: 'https://registry.npmjs.org'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g [email protected]
- name: Get package version
run: |
echo "VERSION=$(yarn --silent pkg-version)" >> $GITHUB_ENV
- name: Get artifact build name
run: |
echo "ARTIFACT_BUILD_NAME=opensearch-dashboards-${{ env.VERSION }}-${{ matrix.suffix }}.${{ matrix.ext }}" >> $GITHUB_ENV
- name: Run bootstrap
run: yarn osd bootstrap

- name: Build `${{ matrix.name }}`
run: yarn ${{ matrix.script }} --release

- uses: actions/upload-artifact@v3
if: success()
with:
name: ${{ matrix.name }}
path: ./artifacts/target/${{ env.ARTIFACT_BUILD_NAME }}
retention-days: 1
15 changes: 15 additions & 0 deletions dev-tools/get-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0

set -e

PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d [:space:])

echo "$PACKAGE_VERSION"
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dashboarding"
],
"private": true,
"version": "2.0.0",
"version": "3.0.0",
"branch": "main",
"types": "./opensearch_dashboards.d.ts",
"tsdocMetadata": "./build/tsdoc-metadata.json",
Expand Down Expand Up @@ -70,7 +70,8 @@
"build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json",
"docs:acceptApiChanges": "node --max-old-space-size=6144 scripts/check_published_api_changes.js --accept",
"osd:bootstrap": "node scripts/build_ts_refs && node scripts/register_git_hook",
"spec_to_console": "node scripts/spec_to_console"
"spec_to_console": "node scripts/spec_to_console",
"pkg-version": "./dev-tools/get-version.sh"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ describe('plugins/opensearch', () => {
it('when majors and minors are not equal, but the engine is on legacy version 8.0.0 and OpenSearch Dashboards is on 2.0.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('8.0.0', '2.0.0')).toBe(false);
});

it('when majors and minors are not equal, but the engine is on legacy version 6.10.3 and OpenSearch Dashboards is on 3.0.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('6.10.3', '3.0.0')).toBe(false);
});

it('when majors and minors are not equal, but the engine is on legacy version 7.10.3 and OpenSearch Dashboards is on 3.0.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('7.10.3', '3.0.0')).toBe(false);
});

it('when majors and minors are not equal, but the engine is on legacy version 8.0.0 and OpenSearch Dashboards is on 3.0.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('8.0.0', '3.0.0')).toBe(false);
});
});

describe('returns true', () => {
Expand Down Expand Up @@ -110,6 +122,18 @@ describe('plugins/opensearch', () => {
it('when majors and minors are not equal, but the engine is on legacy version 7.10.2 and OpenSearch Dashboards is on 2.1.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('7.10.2', '2.1.0')).toBe(true);
});

it('when majors and minors are not equal, but the engine is on legacy version 7.10.2 and OpenSearch Dashboards is on 3.0.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('7.10.2', '3.0.0')).toBe(true);
});

it('when majors and minors are not equal, but the engine is on legacy version 7.10.2 and OpenSearch Dashboards is on 3.0.1', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('7.10.2', '3.0.1')).toBe(true);
});

it('when majors and minors are not equal, but the engine is on legacy version 7.10.2 and OpenSearch Dashboards is on 3.1.0', () => {
expect(opensearchVersionCompatibleWithOpenSearchDashboards('7.10.2', '3.1.0')).toBe(true);
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface VersionNumbers {
*
* WARNING: OpenSearchDashboards 7.x could cause conflicts.
*/
const osdLegacyCompatibleMajorVersions = [1, 2];
const osdLegacyCompatibleMajorVersions = [1, 2, 3];

/**
* Checks for the compatibilitiy between OpenSearch and OpenSearchDashboards versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,6 @@ describe('savedObjects/health_check/isConfigVersionUpgradeable', function () {
isUpgradeableTest('1.0.1', '1.0.0', false);
isUpgradeableTest('7.10.2', '1.1.0', true);
isUpgradeableTest('7.10.2', '2.0.0', true);
isUpgradeableTest('7.10.2', '3.0.0', false);
isUpgradeableTest('7.10.2', '3.0.0', true);
isUpgradeableTest('7.10.2', '4.0.0', false);
});
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import semver from 'semver';
*
* WARNING: OpenSearchDashboards 7.x could cause conflicts.
*/
const osdValidMajorVersions = [1, 2];
const osdValidMajorVersions = [1, 2, 3];
const rcVersionRegex = /^(\d+\.\d+\.\d+)\-rc(\d+)$/i;

function extractRcNumber(version: string): [string, number] {
Expand Down

0 comments on commit f9e572d

Please sign in to comment.