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 for failing OSD distribution build #3084

Merged
merged 1 commit into from
Jan 11, 2023
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
3 changes: 1 addition & 2 deletions manifests/2.5.0/opensearch-dashboards-2.5.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ components:
repository: https://github.com/opensearch-project/dashboards-query-workbench.git
ref: '2.5'
- name: notificationsDashboards
repository: https://github.com/opensearch-project/notifications.git
working_directory: dashboards-notifications
repository: https://github.com/opensearch-project/dashboards-notifications.git
ref: '2.5'
- name: observabilityDashboards
repository: https://github.com/opensearch-project/dashboards-observability.git
Expand Down
87 changes: 0 additions & 87 deletions scripts/components/customImportMapDashboards/build.sh

This file was deleted.

88 changes: 0 additions & 88 deletions scripts/components/notificationsDashboards/build.sh

This file was deleted.

9 changes: 8 additions & 1 deletion scripts/default/opensearch-dashboards/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ if [ "$PLATFORM" = "windows" ]; then
NVM_CMD="volta install node@`cat ../OpenSearch-Dashboards/.nvmrc` && volta install yarn@`jq -r '.engines.yarn' ../OpenSearch-Dashboards/package.json`"
fi

HELPER_CMD=$(jq -r '.scripts.plugin_helpers' package.json)
if [ "$HELPER_CMD" != null ]; then
HELPER_STRING=plugin_helpers
else
HELPER_STRING=plugin-helpers
fi
Comment on lines +75 to +80
Copy link
Member

@gaiksaya gaiksaya Jan 11, 2023

Choose a reason for hiding this comment

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

Is this a fast fix that otherwise all dashboards plugins needs to make a change in their package.json? Changing config during build can be dangerous.

Copy link
Member

Choose a reason for hiding this comment

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

There is no consistency on all the dashboards on how to call plugin helper.
Not sure which repo starts using plugin-helpers and some follows but some dont.
At this point this is a quick fix but the permanent fix is to let everyone use plugin_helpers.


mkdir -p $OUTPUT/plugins
PLUGIN_NAME=$(basename "$PWD")
# TODO: [CLEANUP] Needed OpenSearch Dashboards git repo to build the required modules for plugins
Expand All @@ -80,7 +87,7 @@ cp -r ../$PLUGIN_NAME/ ../OpenSearch-Dashboards/plugins
echo "BUILD MODULES FOR $PLUGIN_NAME"
(cd ../OpenSearch-Dashboards && eval $NVM_CMD && yarn osd bootstrap)
echo "BUILD RELEASE ZIP FOR $PLUGIN_NAME"
(cd ../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_NAME && yarn plugin-helpers build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER)
(cd ../OpenSearch-Dashboards && eval $NVM_CMD && cd plugins/$PLUGIN_NAME && yarn $HELPER_STRING build --opensearch-dashboards-version=$VERSION$QUALIFIER_IDENTIFIER)
echo "COPY $PLUGIN_NAME.zip"
cp -r ../OpenSearch-Dashboards/plugins/$PLUGIN_NAME/build/$PLUGIN_NAME-$VERSION$QUALIFIER_IDENTIFIER.zip $OUTPUT/plugins/
rm -rf ../OpenSearch-Dashboards/plugins/$PLUGIN_NAME