Skip to content

fix: Correct error handling in delete function #6269

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 1 commit into from
Feb 25, 2025
Merged

fix: Correct error handling in delete function #6269

merged 1 commit into from
Feb 25, 2025

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Feb 24, 2025

Tracking issue

NA

Why are the changes needed?

Failed to delete the task since we always return err on delete

What changes were proposed in this pull request?

check if the error is nil first

How was this patch tested?

Run an agent task and terminate it

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

NA

Docs link

NA

Summary by Bito

Fixed a critical bug in the agent plugin's Delete function by correcting error handling logic. The function now properly returns nil for successful deletions and only returns errors when actual error conditions occur, replacing the previous implementation that always returned an error.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

@flyte-bot
Copy link
Collaborator

flyte-bot commented Feb 24, 2025

Code Review Agent Run #66338d

Actionable Suggestions - 0
Additional Suggestions - 1
  • flyteplugins/go/tasks/plugins/webapi/agent/plugin.go - 1
Review Details
  • Files reviewed - 1 · Commit Range: 91a6b6f..91a6b6f
    • flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
  • Files skipped - 0
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Error Handling Fix in Agent Task Deletion

plugin.go - Fixed error handling logic in Delete function to properly check error condition

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 36.88%. Comparing base (e9e227b) to head (91a6b6f).
Report is 92 commits behind head on master.

Files with missing lines Patch % Lines
...yteplugins/go/tasks/plugins/webapi/agent/plugin.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6269      +/-   ##
==========================================
+ Coverage   36.86%   36.88%   +0.01%     
==========================================
  Files        1318     1318              
  Lines      134773   134832      +59     
==========================================
+ Hits        49683    49728      +45     
- Misses      80758    80770      +12     
- Partials     4332     4334       +2     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 51.87% <ø> (ø)
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.22% <ø> (ø)
unittests-flyteplugins 53.98% <0.00%> (-0.03%) ⬇️
unittests-flytepropeller 42.86% <ø> (+0.07%) ⬆️
unittests-flytestdlib 55.33% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pingsutw pingsutw changed the title fix: Correct error handling in Delete function fix: Correct error handling in delete function Feb 24, 2025
@pingsutw pingsutw merged commit 8fc1a30 into master Feb 25, 2025
50 of 51 checks passed
@pingsutw pingsutw deleted the nil branch February 25, 2025 17:33
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.

3 participants