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

[Version] Increment to 3.0 #1502

Merged
merged 1 commit into from
Apr 28, 2022
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
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 yarn@1.22.10
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to specify version number?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right we always take the latest to build. Perhaps we can have a follow-up to align the other jobs as well. But I can see a benefit to specify every time.


- 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
kavilla marked this conversation as resolved.
Show resolved Hide resolved
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