Skip to content

Add cancel as final state (#918) - #17352

Merged
wangq8 merged 2 commits into
infiniflow:mainfrom
wangq8:bugfix/add-cancel-state-as-final-state
Jul 24, 2026
Merged

wangq8 merged 2 commits into
infiniflow:mainfrom
wangq8:bugfix/add-cancel-state-as-final-state

Conversation

@wangq8

@wangq8 wangq8 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@wangq8 wangq8 added the ci Continue Integration label Jul 24, 2026
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 742ab11f-d995-49fe-89cb-73dbd7894a2d

📥 Commits

Reviewing files that changed from the base of the PR and between 30742b6 and d3f90d4.

📒 Files selected for processing (1)
  • api/db/services/pipeline_operation_log_service.py

📝 Walkthrough

Walkthrough

PipelineOperationLogService now recognizes progress and terminal statuses through one predicate, derives fan-out operation statuses from progress, and applies requested operation-status values directly when querying file and dataset logs.

Changes

Pipeline operation logging

Layer / File(s) Summary
Final-state detection and log creation
api/db/services/pipeline_operation_log_service.py
Fan-out statuses derive from task progress with a running fallback, and fan-out and file-level logging use _is_final_state to skip non-final operations.
Direct operation-status filtering
api/db/services/pipeline_operation_log_service.py
File and dataset KB log queries filter using the supplied enum values or string representations directly.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kevinhush

Poem

A rabbit hops through logs today,
As running states find their way.
Done and fail and cancel too,
Filtered by the status view.
Hop, hop—the pipeline’s clear!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No PR description was provided, so the required Summary section is missing. Add a Summary section that briefly explains the problem, the change, and any relevant background context.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: treating cancel as a final state.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
api/db/services/pipeline_operation_log_service.py (1)

59-68: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for cancellation and nonterminal states.

Test _is_final_state() and _final_operation_statuses() for CANCEL, DONE, FAIL, RUNNING, and progress values 1/-1; these branches now control both log creation and operation-status filtering.

As per coding guidelines, “Preserve valid behavior with focused tests.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/db/services/pipeline_operation_log_service.py` around lines 59 - 68, Add
focused regression tests for PipelineOperationLogService._is_final_state and
_final_operation_statuses, covering CANCEL, DONE, FAIL, and RUNNING statuses
plus progress values 1 and -1. Assert terminal statuses are included and
recognized, RUNNING remains nonterminal unless progress is 1 or -1, and empty or
supplied operation-status filters preserve the expected final-status results.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/db/services/pipeline_operation_log_service.py`:
- Around line 179-185: Update the status derivation around operation_status in
the fan-out task handling to preserve TaskStatus.CANCEL whenever the task is
canceled, before applying progress-based DONE, FAIL, or RUNNING mapping. Add a
focused regression test covering canceled tasks both while in progress and with
progress == -1, verifying they remain CANCEL.

---

Nitpick comments:
In `@api/db/services/pipeline_operation_log_service.py`:
- Around line 59-68: Add focused regression tests for
PipelineOperationLogService._is_final_state and _final_operation_statuses,
covering CANCEL, DONE, FAIL, and RUNNING statuses plus progress values 1 and -1.
Assert terminal statuses are included and recognized, RUNNING remains
nonterminal unless progress is 1 or -1, and empty or supplied operation-status
filters preserve the expected final-status results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed12a8f7-e894-4925-b65a-5e3a67d0469e

📥 Commits

Reviewing files that changed from the base of the PR and between bdfc3ad and 30742b6.

📒 Files selected for processing (1)
  • api/db/services/pipeline_operation_log_service.py

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (cd9db94) to head (d3f90d4).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17352   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wangq8
wangq8 merged commit 7180d30 into infiniflow:main Jul 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant