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

Update binaryspec for deb creation as debmake=4.3.2-1 and above introduced nodejs #5401

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
6 changes: 3 additions & 3 deletions scripts/components/OpenSearch-Dashboards/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ fi

if [ "$DISTRIBUTION" = "rpm" -o "$DISTRIBUTION" = "deb" ]; then
cp -v ../../../config/opensearch_dashboards-$MAJOR_VERSION.x.yml "$OUTPUT/../etc/opensearch-dashboards/opensearch_dashboards.yml"
cp -a ../../../scripts/pkg/service_templates/opensearch-dashboards/* "$OUTPUT/../"
cp -va ../../../scripts/pkg/service_templates/opensearch-dashboards/* "$OUTPUT/../"

if [ "$MAJOR_VERSION" = "1" ]; then
cp -a ../../../scripts/pkg/build_templates/legacy/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
cp -va ../../../scripts/pkg/build_templates/legacy/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
else
cp -a ../../../scripts/pkg/build_templates/current/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
cp -va ../../../scripts/pkg/build_templates/current/opensearch-dashboards/$DISTRIBUTION/* "$OUTPUT/../"
fi
else
cp -v ../../../config/opensearch_dashboards-$MAJOR_VERSION.x.yml "$OUTPUT/config/opensearch_dashboards.yml"
Expand Down
5 changes: 5 additions & 0 deletions src/assemble_workflow/bundle_linux_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ def build(self, name: str, dest: str, archive_path: str, build_cls: BuildManifes
deb_version = build_cls.version.replace('-', '.')
self.generate_changelog_file(ext_dest, deb_version)

# 20250316: debmake since 4.3.2-1 introduced nodejs type with auto detection of js
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954828
# Official update to 4.4.0-3 further replace pkg-js-tools with dh-nodejs here:
# https://launchpad.net/ubuntu/+source/debmake/+changelog
bundle_cmd = " ".join(
[
'debmake',
Expand All @@ -117,6 +121,7 @@ def build(self, name: str, dest: str, archive_path: str, build_cls: BuildManifes
'--invoke debuild',
f'--package {self.filename}',
'--native',
f'--binaryspec {self.filename}:bin' if self.filename == 'opensearch' else f'--binaryspec {self.filename}:nodejs',
'--revision 1',
f"--upstreamversion {deb_version}"
]
Expand Down
6 changes: 4 additions & 2 deletions tests/tests_assemble_workflow/test_bundle_linux_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def test_build_deb(self, generate_changelog_file_call_mock: Mock, check_call_moc

self.assertRaises(KeyError, lambda: os.environ['OPENSEARCH_PATH_CONF'])
self.assertEqual(check_call_mock.call_count, 1)
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native --revision 1 --upstreamversion 1.3.0',
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native '
'--binaryspec opensearch:bin --revision 1 --upstreamversion 1.3.0',
args_list_deb[0][0][0])
self.assertEqual(shutil_move_mock.call_count, 2)
self.assertEqual(generate_changelog_file_call_mock.call_count, 1)
Expand All @@ -74,7 +75,8 @@ def test_build_deb_qualifier(self, generate_changelog_file_call_mock: Mock, chec

self.assertRaises(KeyError, lambda: os.environ['OPENSEARCH_PATH_CONF'])
self.assertEqual(check_call_mock.call_count, 1)
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native --revision 1 --upstreamversion 2.0.0.alpha1',
self.assertEqual('debmake --fullname "OpenSearch Team" --email "release@opensearch.org" --invoke debuild --package opensearch --native '
'--binaryspec opensearch:bin --revision 1 --upstreamversion 2.0.0.alpha1',
args_list_deb_qualifier[0][0][0])
self.assertEqual(shutil_move_mock.call_count, 2)
self.assertEqual(generate_changelog_file_call_mock.call_count, 1)
Expand Down