Skip to content

Deleting cancelled jobs#1744

Open
ArneTR wants to merge 2 commits into
mainfrom
delete-cancelled-jobs
Open

Deleting cancelled jobs#1744
ArneTR wants to merge 2 commits into
mainfrom
delete-cancelled-jobs

Conversation

@ArneTR

@ArneTR ArneTR commented Jun 24, 2026

Copy link
Copy Markdown
Member

This PR forces deletion of cancelled jobs also.

To ensure no status is forgotten an enum is introduced into the database

This change makes job cleanup include cancelled jobs and tightens job state handling with a database enum.

  • Job.clear_old_jobs now deletes CANCELLED jobs along with the existing old FAILED and FINISHED jobs, while preserving the other cleanup rules.
  • The job state column is migrated from ազատ-form text to a job_state enum, with jobs.state now NOT NULL and defaulting to WAITING.
  • The schema definition is updated to match the new enum-based state model.

@ArneTR

ArneTR commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes introduce a job_state PostgreSQL enum type with values WAITING, PAUSED, CANCELLED, FINISHED, FAILED, and RUNNING. In docker/structure.sql, the jobs.state column is changed from an unconstrained text field to job_state NOT NULL DEFAULT 'WAITING'. A new migration file (migrations/2026_06_24_jobs_delete_cancelled.sql) creates the enum type and alters the existing column via state::job_state casting while setting the default. In lib/job/base.py, the clear_old_jobs deletion predicate is updated to use state IN (...) instead of the previous FAILED ... OR FINISHED ... boolean structure.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main behavioral change of deleting cancelled jobs, though it omits the database enum update.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1684705-a785-44b5-aa92-f60f41018950

📥 Commits

Reviewing files that changed from the base of the PR and between 03e07d4 and 8ba1088.

📒 Files selected for processing (3)
  • docker/structure.sql
  • lib/job/base.py
  • migrations/2026_06_24_jobs_delete_cancelled.sql

Comment thread lib/job/base.py Outdated
Comment thread migrations/2026_06_24_jobs_delete_cancelled.sql
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.

1 participant