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

Fix issue when bootstrapping on 2.x #7901

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

huyaboo
Copy link
Member

@huyaboo huyaboo commented Aug 29, 2024

Description

Fixes bootstrap within 2.x branch caused by #7194 . This is due to @opensearch-project/opensearch major version difference between main and 2.x, which has interface changes that break bootstrap (#3464).

Screenshot

Testing the changes

Changelog

  • fix: Fix bootstrap errors in 2.x

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Copy link
Contributor

❌ Changelog Entry Missing Hyphen

Changelog entries must begin with a hyphen (-).

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.30%. Comparing base (92a9592) to head (f376df9).
Report is 85 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7901      +/-   ##
==========================================
+ Coverage   64.21%   64.30%   +0.09%     
==========================================
  Files        3673     3673              
  Lines       81185    81126      -59     
  Branches    12943    12928      -15     
==========================================
+ Hits        52130    52171      +41     
+ Misses      25847    25744     -103     
- Partials     3208     3211       +3     
Flag Coverage Δ
Linux_1 30.21% <ø> (+0.01%) ⬆️
Linux_2 56.19% <ø> (+0.11%) ⬆️
Linux_3 40.62% <ø> (+0.06%) ⬆️
Linux_4 31.41% <ø> (+0.09%) ⬆️
Windows_1 30.23% <ø> (+0.01%) ⬆️
Windows_2 56.14% <ø> (+0.11%) ⬆️
Windows_3 40.61% <ø> (+0.07%) ⬆️
Windows_4 31.41% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hailong-am
Copy link
Collaborator

Hailong-am commented Aug 29, 2024

@huyaboo will this fixed OSD start issue? Try to build a distribution and start OSD, it reports error as below

export { dynamicConfigServiceMock } from './mocks';

➜  opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64 ./bin/opensearch-dashboards
Error: Cannot find module './mocks'
Require stack:
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/config/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/discovery/plugin_manifest_parser.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/discovery/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/plugins_service.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/serve/serve.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/cli.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/dist.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
    at Module.Hook._require.Module.require (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/node_modules/require-in-the-middle/index.js:61:29)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/config/index.js:156:14)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at Module.Hook._require.Module.require (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/node_modules/require-in-the-middle/index.js:80:39)
➜  opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64

@BionIT BionIT merged commit 07504f6 into opensearch-project:main Aug 29, 2024
67 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7901-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 07504f6b8bfa7fe7389849b16f6f9aa6a0de87be
# Push it to GitHub
git push --set-upstream origin backport/backport-7901-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7901-to-2.x.

@huyaboo
Copy link
Member Author

huyaboo commented Aug 29, 2024

@huyaboo will this fixed OSD start issue? Try to build a distribution and start OSD, it reports error as below

export { dynamicConfigServiceMock } from './mocks';

➜  opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64 ./bin/opensearch-dashboards
Error: Cannot find module './mocks'
Require stack:
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/config/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/discovery/plugin_manifest_parser.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/discovery/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/plugins_service.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/plugins/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/index.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/serve/serve.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/cli.js
- /local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/cli/dist.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
    at Module.Hook._require.Module.require (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/node_modules/require-in-the-middle/index.js:61:29)
    at require (internal/modules/cjs/helpers.js:107:18)
    at Object.<anonymous> (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/src/core/server/config/index.js:156:14)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
    at Function.Module._load (internal/modules/cjs/loader.js:819:12)
    at Module.require (internal/modules/cjs/loader.js:1003:19)
    at Module.Hook._require.Module.require (/local/home/ihailong/build/opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64/node_modules/require-in-the-middle/index.js:80:39)
➜  opensearch-dashboards-3.0.0-SNAPSHOT-linux-x64

No, but #7922 does

huyaboo added a commit to huyaboo/OpenSearch-Dashboards that referenced this pull request Sep 2, 2024
* Add dynamic config service to core

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add opensearch client implementation

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add descriptions for the DAO clients

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor DynamicConfigService

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor dynamic config service start

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
(cherry picked from commit 8a96664)

Fix issue when bootstrapping on 2.x (opensearch-project#7901)

* Fix issue bootstrapping dynamic config service

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Changeset file for PR opensearch-project#7901 created/updated

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 07504f6)

Fix mock import (opensearch-project#7922)

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
(cherry picked from commit b370871)
BionIT pushed a commit that referenced this pull request Sep 3, 2024
* Add dynamic config service to core

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add opensearch client implementation

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add descriptions for the DAO clients

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor DynamicConfigService

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Refactor dynamic config service start

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
(cherry picked from commit 8a96664)

Fix issue when bootstrapping on 2.x (#7901)

* Fix issue bootstrapping dynamic config service

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Changeset file for PR #7901 created/updated

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 07504f6)

Fix mock import (#7922)

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
(cherry picked from commit b370871)

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants