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

Restore osd path as it does not correctly fix windows error #5405

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ci:
name: opensearchstaging/ci-runner:ci-runner-almalinux8-opensearch-dashboards-build-v1
components:
- name: OpenSearch-Dashboards
repository: https://github.com/opensearch-project/OpenSearch-Dashboards.git
repository: https://github.com/peterzhuamazon/OpenSearch-Dashboards.git
ref: main
- name: functionalTestDashboards
repository: https://github.com/opensearch-project/opensearch-dashboards-functional-test.git
Expand Down
9 changes: 1 addition & 8 deletions src/build_workflow/builder_from_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@

class BuilderFromSource(Builder):
def checkout(self, work_dir: str) -> None:
# TODO: Reduce temp dir randomized dirname char counts or remove this after qualifier
# This is a temporary fix for OSD Core
# Due to path of node installation is longer than 200 chars and cause path not able to be removed
# https://github.com/opensearch-project/OpenSearch-Dashboards/issues/9397#issuecomment-2727641857
# Even 'osd' would not be enough for the proper cleanup so switch to 'o' for now
# https://github.com/opensearch-project/OpenSearch-Dashboards/issues/9397#issuecomment-2731257431
component_name = self.component.name if self.component.name != 'OpenSearch-Dashboards' else 'o'
self.git_repo = GitRepository(
self.component.repository,
self.component.ref,
os.path.join(work_dir, component_name),
os.path.join(work_dir, self.component.name),
self.component.working_directory,
)

Expand Down
2 changes: 1 addition & 1 deletion src/system/temporary_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, keep: bool = False, chdir: bool = False) -> None:
self.keep = keep
if current_platform() == "windows":
windows_home_dir = os.path.abspath("C:\\") # Reduce char counts on windows path
self.name = tempfile.mkdtemp(dir=windows_home_dir)
self.name = tempfile.mkdtemp(dir=windows_home_dir, prefix='') # Reduce char counts on windows path
else:
self.name = tempfile.mkdtemp()

Expand Down
1 change: 1 addition & 0 deletions tests/tests_system/test_temporary_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_path_windows(self) -> None:
with TemporaryDirectory() as work_dir:
if current_platform() == "windows":
windows_home_dir = os.path.abspath("C:\\")
self.assertTrue(not str(work_dir.path).startswith("tmp"))
self.assertTrue(str(work_dir.path).startswith(windows_home_dir))
else:
self.assertTrue(str(work_dir.path).startswith(tempfile.gettempdir()))
Loading