Skip to content

fix: raise GokartBuildError on FAILED_AND_SCHEDULING_FAILED status #465

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

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

kitagry
Copy link
Member

@kitagry kitagry commented May 31, 2025

This pull request enhances error handling in gokart by extending the set of statuses that trigger exceptions during task builds and adding corresponding unit tests. The changes ensure more robust handling of scheduling failures and improve test coverage.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request enhances error handling in gokart by extending the set of statuses that trigger exceptions during task builds.

  • Added new status checks (FAILED_AND_SCHEDULING_FAILED and SCHEDULING_FAILED) in the build function.
  • Introduced a unit test to verify that a GokartBuildError is raised in the new error scenario.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/test_build.py Added a unit test to validate error raising when the build result indicates failure due to scheduling issues.
gokart/build.py Updated the status check in _build_task to include additional failure statuses.
Comments suppressed due to low confidence (1)

test/test_build.py:212

  • Consider adding an additional unit test case for when result.status is LuigiStatusCode.SCHEDULING_FAILED to ensure that both newly handled statuses are adequately covered.
with patch('luigi.build') as mock_luigi_build:

@@ -204,7 +204,7 @@ def _build_task():
)
if task_lock_exception_raised.flag:
raise HasLockedTaskException()
Copy link
Preview

Copilot AI May 31, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider documenting the rationale for grouping the FAILED, FAILED_AND_SCHEDULING_FAILED, and SCHEDULING_FAILED statuses together. This makes the intention clearer, especially if their handling may diverge in the future.

Suggested change
raise HasLockedTaskException()
raise HasLockedTaskException()
# Grouping statuses that represent failure scenarios. These statuses indicate that the task either failed during execution,
# failed during scheduling, or both. They are treated similarly to trigger the same error handling logic.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

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

LGTM!

@Hi-king
Copy link
Member

Hi-king commented Jun 5, 2025

LGTM

Copy link
Contributor

@hiro-o918 hiro-o918 left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -204,7 +204,7 @@ def _build_task():
)
if task_lock_exception_raised.flag:
raise HasLockedTaskException()
if result.status == luigi.LuigiStatusCode.FAILED:
if result.status in (LuigiStatusCode.FAILED, LuigiStatusCode.FAILED_AND_SCHEDULING_FAILED, LuigiStatusCode.SCHEDULING_FAILED):
Copy link
Contributor

Choose a reason for hiding this comment

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

@kitagry kitagry force-pushed the catch-luigi-status branch from 42bbcb6 to 8c73d58 Compare June 5, 2025 02:32
@kitagry kitagry merged commit 0b457b3 into master Jun 5, 2025
8 checks passed
@kitagry kitagry deleted the catch-luigi-status branch June 5, 2025 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants