Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
macohen authored Aug 15, 2023
2 parents 2a9f96a + a6541aa commit d45945f
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This should match the list of maintainers in https://github.com/opensearch-project/dashboards-search-relevance/blob/main/MAINTAINERS.md
* @macohen @mingshl @msfroh @noCharger @sejli
* @macohen @mingshl @msfroh @noCharger @sejli
59 changes: 43 additions & 16 deletions .github/workflows/remote-integ-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
pull_request:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: 'main'
OPENSEARCH_VERSION: '3.0.0-SNAPSHOT'
OPENSEARCH_DASHBOARDS_FTREPO_VERSION: 'main'
ANOMALY_DETECTION_PLUGIN_VERSION: 'main'
jobs:
test-without-security:
name: Run integ tests without security
Expand All @@ -34,30 +29,62 @@ jobs:
distribution: 'corretto'
java-version: '11'

- uses: actions/checkout@v2
- name: Fetch Version Information
id: fetch_version
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
pr_number=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
| jq -r '.[0].number')
url_number=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
| jq -r '.[0].url')
pr_data=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"$url_number")
BRANCH_NAME=$(echo "$pr_data" | jq -r '.base.ref')
echo "BRANCH_NAME is $BRANCH_NAME"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Base branch name is "${{ github.event.pull_request.base.ref }}""
BRANCH_NAME="${{ github.event.pull_request.base.ref }}"
fi
CURRENT_VERSION=$(node -p "require('./package.json').version")
MAJOR_VERSION=$(echo $CURRENT_VERSION | cut -d. -f1)
MINOR_VERSION=$(echo $CURRENT_VERSION | cut -d. -f2)
PATCH_VERSION=$(echo $CURRENT_VERSION | cut -d. -f3)
OPENSEARCH_VERSION="$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION"
echo "OPENSEARCH_VERSION: $OPENSEARCH_VERSION"
echo "OPENSEARCH_VERSION=$OPENSEARCH_VERSION" >> $GITHUB_ENV
echo "OPENSEARCH_DASHBOARDS_VERSION=$BRANCH_NAME" >> $GITHUB_ENV
echo "OPENSEARCH_DASHBOARDS_FTREPO_VERSION=$BRANCH_NAME" >> $GITHUB_ENV
echo "SEARCH_PROCESSOR_PLUGIN_VERSION=$BRANCH_NAME" >> $GITHUB_ENV
echo "SEARCH_PROCESSOR_VERSION=$MAJOR_VERSION.$MINOR_VERSION.0" >> $GITHUB_ENV
shell: bash

- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true

# It doesn't matter what plugin we use, but by launching OpenSearch
# from a plugin repo, we don't need to checkout and build
# from a plugin repo, we don't need to checkout and build
# OpenSearch itself.
- name: Checkout Anomaly-Detection
- name: Checkout search-processor
uses: actions/checkout@v2
with:
path: anomaly-detection
repository: opensearch-project/anomaly-detection
ref: ${{ env.ANOMALY_DETECTION_PLUGIN_VERSION }}
path: search-processor
repository: opensearch-project/search-processor
ref: ${{ env.SEARCH_PROCESSOR_PLUGIN_VERSION }}

- name: Run OpenSearch with plugin
run: |
cd anomaly-detection
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
cd search-processor
./gradlew run -Dopensearch.version=${{ env.SEARCH_PROCESSOR_VERSION }} &
t=0
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do
sleep 5
let t=$t+5
if [[ $t -gt 300 ]]; then
exit 1
if [[ $t -gt 300 ]]; then
exit 1
fi
done
shell: bash
Expand Down Expand Up @@ -105,7 +132,7 @@ jobs:

# Windows and Mac OS take a while to start, so we need a long sleep
- name: Sleep until OSD server starts
run: sleep 900
run: sleep 900
shell: bash

- name: Checkout opensearch-dashboards-functional-test
Expand Down
28 changes: 24 additions & 4 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ on: [pull_request, push]

env:
PLUGIN_NAME: dashboards-search-relevance
OPENSEARCH_VERSION: "main"
OPENSEARCH_PLUGIN_VERSION: 3.0.0.0

jobs:
build:
Expand All @@ -15,6 +13,29 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Fetch Version Information
shell: bash
run: |
OPENSEARCH_PLUGIN_VERSION=$(node -p "require('./package.json').version")
if [[ "${{ github.event_name }}" == "push" ]]; then
pr_number=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
| jq -r '.[0].number')
url_number=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }}/pulls" \
| jq -r '.[0].url')
pr_data=$(curl -sSL -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"$url_number")
echo "BRANCH_NAME is $BRANCH_NAME"
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Base branch name is "${{ github.event.pull_request.base.ref }}""
BRANCH_NAME="${{ github.event.pull_request.base.ref }}"
fi
echo "Target branch: $BRANCH_NAME"
echo "OPENSEARCH_PLUGIN_VERSION=$OPENSEARCH_PLUGIN_VERSION" >> $GITHUB_ENV
echo "OPENSEARCH_VERSION=$BRANCH_NAME" >> $GITHUB_ENV
- name: Enable core.longpaths on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: git config --global core.longpaths true
Expand Down Expand Up @@ -44,7 +65,6 @@ jobs:
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v

Expand Down Expand Up @@ -79,4 +99,4 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: dashboards-search-relevance-${{ matrix.os }}
path: ./OpenSearch-Dashboards/plugins/dashboards-search-relevance/build
path: ./OpenSearch-Dashboards/plugins/dashboards-search-relevance/build
11 changes: 11 additions & 0 deletions .opensearch_dashboards-plugin-helpers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"serverSourcePatterns": [
"package.json",
"tsconfig.json",
"yarn.lock",
".yarnrc",
"{lib,public,server,webpackShims,translations,utils,models,common}/**/*",
"!__tests__",
"config.ts"
]
}
6 changes: 4 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"opensearchDashboardsVersion": "3.0.0",
"server": true,
"ui": true,
"requiredPlugins": ["navigation"]
}
"requiredPlugins": [
"navigation"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"glob-parent": "^6.0.1",
"qs": "~6.5.3"
}
}
}
13 changes: 9 additions & 4 deletions public/components/query_compare/search_result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ export const SearchResult = ({ http }: SearchResultProps) => {
body: JSON.stringify(requestBody),
})
.then((res) => {
setQueryResult1(res.result1);
updateComparedResult1(res.result1);
setQueryResult2(res.result2);
updateComparedResult2(res.result2);
if (res.result1) {
setQueryResult1(res.result1);
updateComparedResult1(res.result1);
}

if (res.result2) {
setQueryResult2(res.result2);
updateComparedResult2(res.result2);
}

if (res.errorMessage1) {
setQueryError1({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Compatible with OpenSearch and OpenSearch Dashboards Version 2.8.0
# Version 2.8.0 Release Notes
## 🚞 Infrastructure
* [CI/CD] Run Cypress integration tests on build ([#143](https://github.com/opensearch-project/dashboards-search-relevance/pull/143))
* [CI/CD] Make Workflows Fetch Version Automatically ([#177](https://github.com/opensearch-project/dashboards-search-relevance/pull/177))
* [CI/CD] Fix build branch name ([#208](https://github.com/opensearch-project/dashboards-search-relevance/pull/208))
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Version 2.9.0.0 Release Notes

Compatible with OpenSearch 2.9.0


### Infrastructure
* [CI/CD] Rolling back to anomaly-detection for OS dependency in workflow ([#230](https://github.com/opensearch-project/dashboards-search-relevance/pull/230))([#236](https://github.com/opensearch-project/dashboards-search-relevance/pull/236))
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"public/**/*.tsx",
"server/**/*.ts",
"common/**/*.ts",
"../../typings/**/*"
"../../typings/**/*",
"config.ts"
],
"exclude": ["node_modules", "*/node_modules/"]
}
55 changes: 40 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee"
integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==

psl@^1.1.28:
psl@^1.1.33:
version "1.9.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==
Expand All @@ -1373,6 +1373,11 @@ qs@~6.5.2, qs@~6.5.3:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==

querystringify@^2.1.1:
version "2.2.0"
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==

regexpp@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f"
Expand All @@ -1385,6 +1390,11 @@ request-progress@^3.0.0:
dependencies:
throttleit "^1.0.0"

requires-port@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==

resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
Expand Down Expand Up @@ -1447,19 +1457,19 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.2:
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==

semver@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==

semver@^6.1.2:
version "6.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
version "6.3.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.2:
version "7.3.8"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"

Expand Down Expand Up @@ -1641,13 +1651,15 @@ tmp@~0.2.1:
dependencies:
rimraf "^3.0.0"

tough-cookie@~2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
tough-cookie@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf"
integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==
dependencies:
psl "^1.1.28"
psl "^1.1.33"
punycode "^2.1.1"
universalify "^0.2.0"
url-parse "^1.5.3"

tslib@^1.9.0:
version "1.14.1"
Expand Down Expand Up @@ -1688,6 +1700,11 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==

universalify@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0"
integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==

universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
Expand All @@ -1705,6 +1722,14 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"

url-parse@^1.5.3:
version "1.5.10"
resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1"
integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==
dependencies:
querystringify "^2.1.1"
requires-port "^1.0.0"

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
Expand Down

0 comments on commit d45945f

Please sign in to comment.