Repository: opensearch-project/opensearch-build

Issue:
Revert component-based scripts lookup
### Is your feature request related to a problem? Please describe

In https://github.com/opensearch-project/opensearch-build/pull/2934 we have added a way to include component build scripts. There are several problems with that.

1. In https://github.com/opensearch-project/opensearch-build/issues/2188 we agreed to split monorepos. The maps monorepo came in as another new kind of monorepo that should not be supported. 
2. There are no tests in the PR.
3. The new feature of path lookup is not documented in https://github.com/opensearch-project/opensearch-build/blob/cbe6841a3c459b65d5fb17b713994e5c01d7ee8e/src/paths/script_finder.py#L27

### Describe the solution you'd like

1. Add tests and documentation on top of https://github.com/opensearch-project/opensearch-build/pull/2934.
1. Split the maps monorepo, https://github.com/opensearch-project/opensearch-build/issues/2188
1. Revert https://github.com/opensearch-project/opensearch-build/pull/2934



### Describe alternatives you've considered

_No response_

### Additional context

_No response_


Discussion:
[Triage] Hi @junqiu-lei Any plans on separating the repos?
Hi @gaiksaya , will take actions based on decision from https://github.com/opensearch-project/dashboards-maps/issues/95
@junqiu-lei @gaiksaya Can you provide an update on this issue?
I believe this PR took care of adding tests and documentation: https://github.com/opensearch-project/opensearch-build/pull/2952
These are the components in build repo that still have scripts here: https://github.com/opensearch-project/opensearch-build/tree/main/scripts/components
I'll raise a PR for the revert of https://github.com/opensearch-project/opensearch-build/pull/2934 https://github.com/opensearch-project/opensearch-build/pull/2952, thanks!

Resolving patch:
diff --git a/src/paths/script_finder.py b/src/paths/script_finder.py
--- a/src/paths/script_finder.py
+++ b/src/paths/script_finder.py
@@ -26,7 +26,6 @@ def __init__(self, kind: str, paths: List[str]) -> None:
     For build.sh and integtest.sh scripts, given a component name and a checked-out Git repository,
     it will look in the following locations, in order:
       * <component_scripts_path>/<component_name>/<script-name>
-      * /<component_name>/<script-name> in the component's Git repository
       * root of the component's Git repository
       * /scripts/<script-name> in the component's Git repository
       * <default_scripts_path>/<script-name>
@@ -49,7 +48,6 @@ def __find_script(cls, name: str, paths: List[str]) -> str:
     def __find_named_script(cls, script_name: str, component_name: str, git_dir: str) -> str:
         paths = [
             os.path.realpath(os.path.join(cls.component_scripts_path, component_name, script_name)),
-            os.path.realpath(os.path.join(git_dir, component_name, script_name)),
             os.path.realpath(os.path.join(git_dir, script_name)),
             os.path.realpath(os.path.join(git_dir, "scripts", script_name)),
             os.path.realpath(os.path.join(cls.default_scripts_path, script_name)),
@@ -61,7 +59,6 @@ def __find_named_script(cls, script_name: str, component_name: str, git_dir: str
     def find_build_script(cls, project: str, component_name: str, git_dir: str) -> str:
         paths = [
             os.path.realpath(os.path.join(cls.component_scripts_path, component_name, "build.sh")),
-            os.path.realpath(os.path.join(git_dir, component_name, "build.sh")),
             os.path.realpath(os.path.join(git_dir, "build.sh")),
             os.path.realpath(os.path.join(git_dir, "scripts", "build.sh")),
             os.path.realpath(


Test patch:
diff --git a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/build.sh b/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/build.sh
deleted file mode 100644
--- a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/build.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-#
-# Copyright OpenSearch Contributors
-# The OpenSearch Contributors require contributions made to
-# this file be licensed under the Apache-2.0 license or a
-# compatible open source license.
-#
-# This page intentionally left blank.
diff --git a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/bwctest.sh b/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/bwctest.sh
deleted file mode 100644
--- a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/bwctest.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-#
-# Copyright OpenSearch Contributors
-# The OpenSearch Contributors require contributions made to
-# this file be licensed under the Apache-2.0 license or a
-# compatible open source license.
-#
-# This page intentionally left blank.
diff --git a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/install.sh b/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/install.sh
deleted file mode 100644
--- a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-#
-# Copyright OpenSearch Contributors
-# The OpenSearch Contributors require contributions made to
-# this file be licensed under the Apache-2.0 license or a
-# compatible open source license.
-#
-# This page intentionally left blank.
diff --git a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/integtest.sh b/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/integtest.sh
deleted file mode 100644
--- a/tests/tests_paths/data/git/component_with_scripts_in_component_folder/Component/integtest.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: Apache-2.0
-#
-# Copyright OpenSearch Contributors
-# The OpenSearch Contributors require contributions made to
-# this file be licensed under the Apache-2.0 license or a
-# compatible open source license.
-#
-# This page intentionally left blank.
diff --git a/tests/tests_paths/test_script_finder.py b/tests/tests_paths/test_script_finder.py
--- a/tests/tests_paths/test_script_finder.py
+++ b/tests/tests_paths/test_script_finder.py
@@ -20,7 +20,6 @@ def setUp(self) -> None:
         self.component_with_scripts = os.path.join(self.data_path, "git", "component-with-scripts")
         self.component_with_scripts_folder = os.path.join(self.data_path, "git", "component-with-scripts-folder")
         self.component_without_scripts = os.path.join(self.data_path, "git", "component-without-scripts")
-        self.component_with_scripts_in_component_folder = os.path.join(self.data_path, "git", "component_with_scripts_in_component_folder")
 
     # find_build_script
 
@@ -66,13 +65,6 @@ def test_find_build_script_component_script_in_folder_with_default(self) -> None
             msg="A component with a scripts folder resolves to the override.",
         )
 
-    def test_find_build_script_component_script_in_component_folder(self) -> None:
-        self.assertEqual(
-            os.path.join(self.component_with_scripts_in_component_folder, "Component", "build.sh"),
-            ScriptFinder.find_build_script("Component", "Component", self.component_with_scripts_in_component_folder),
-            msg="A component with a script in component folder resolves to the override.",
-        )
-
     @patch("os.path.exists", return_value=False)
     def test_find_build_script_does_not_exist(self, *mocks: MagicMock) -> None:
         with self.assertRaisesRegex(
@@ -118,13 +110,6 @@ def test_find_integ_test_script_component_script_in_folder_with_default(self) ->
             msg="A component with a scripts folder resolves to a script in that folder.",
         )
 
-    def test_find_integ_test_script_component_script_in_component_folder(self) -> None:
-        self.assertEqual(
-            os.path.join(self.component_with_scripts_in_component_folder, "Component", "integtest.sh"),
-            ScriptFinder.find_integ_test_script("Component", self.component_with_scripts_in_component_folder),
-            msg="A component with a script in component folder resolves to the override.",
-        )
-
     @patch("os.path.exists", return_value=False)
     def test_find_integ_test_script_does_not_exist(self, *mocks: MagicMock) -> None:
         with self.assertRaisesRegex(
@@ -194,13 +179,6 @@ def test_find_bwc_test_script_component_script_in_folder_with_default(self) -> N
             msg="A component with a scripts folder resolves to a script in that folder.",
         )
 
-    def test_find_bwc_test_script_component_script_in_component_folder(self) -> None:
-        self.assertEqual(
-            os.path.join(ScriptFinder.default_scripts_path, "bwctest.sh"),
-            ScriptFinder.find_bwc_test_script("Component", self.component_with_scripts_in_component_folder),
-            msg="A component with a script in component folder resolves to the override.",
-        )
-
     @patch("os.path.exists", return_value=False)
     def test_find_bwc_test_script_does_not_exist(self, *mocks: MagicMock) -> None:
         with self.assertRaisesRegex(