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

Add button to set failed job to pending #8377

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

frcroth
Copy link
Member

@frcroth frcroth commented Feb 5, 2025

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Enable jobs
  • Set a job to "FAILURE"
  • Resume the job. The issue did not specify what should happen to the job so I assumed "PENDING". Should it be "RUNNING" instead?

TODOs:

  • @ frontend (@knollengewaechs ?) Can you please configure the button to only show for super users? I don't know how to do that.

Issues:


(Please delete unneeded items, merge only when none are left open)

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

📝 Walkthrough

Walkthrough

This pull request updates the changelog with various feature additions, textual corrections, bug fixes, and behavior improvements across the system. It adds a new job resume functionality that enables super-users to resume failed jobs. The backend (controller, routes) and frontend (API and job list view) have been updated to support this feature, ensuring that only authorized users can perform the operation.

Changes

Files Change Summary
CHANGELOG.unreleased.md Documented new features including split-merger evaluation, dataset rotation, unified annotation history, measurement text update, removal of volume annotation downsampling, slider scroll improvements, and various bug fixes.
app/.../JobController.scala, conf/.../webknossos.latest.routes, frontend/.../api/jobs.ts, frontend/.../job_list_view.tsx Introduced job resume functionality: added a resume method in the controller with super-user validation, a new PATCH route /jobs/:id/resume, a corresponding resumeJob API function, and UI updates in the job list view to enable super-users to resume failed jobs.

Assessment against linked issues

Objective Addressed Explanation
Job resume functionality for superusers (#8370)

Possibly related PRs

  • scalableminds/webknosos#8181: Enhances the JobController.scala with resume functionality and error handling improvements.
  • scalableminds/webknosos#8188: Introduces a new PATCH route for resuming jobs, aligning closely with the new backend changes.
  • scalableminds/webknosos#8200: Focuses on enhancing super-user capabilities in job management by adjusting restrictions and enabling job resume functionality.

Suggested labels

bug, enhancement, backend, frontend

Suggested reviewers

  • philippotto

Poem

I'm a bunny in the code warren so deep,
Hopping through functions while others sleep.
I found a resume path for jobs thrown off course,
With PATCH and checks, I’ve enforced the force.
Super-users rejoice as errors take a bow,
Carrots and code—together, we plow!
Happy hops to our now smoother job flow!

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@frcroth frcroth self-assigned this Feb 5, 2025
@frcroth frcroth changed the title Add route to set failed job to pending Add button to set failed job to pending Feb 10, 2025
@frcroth frcroth marked this pull request as ready for review February 10, 2025 12:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
CHANGELOG.unreleased.md (1)

19-19: New Feature: Resume Failed Jobs for Super-Users

The changelog correctly reflects the new feature allowing super-users to resume failed jobs. Please verify that the backend and frontend behavior (i.e., whether the job state transitions to "PENDING" or "RUNNING") is clearly defined in the documentation and aligns with the intended functionality as discussed in PR [#8377].

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5d04993 and 24c529e.

📒 Files selected for processing (5)
  • CHANGELOG.unreleased.md (1 hunks)
  • app/controllers/JobController.scala (3 hunks)
  • conf/webknossos.latest.routes (1 hunks)
  • frontend/javascripts/admin/api/jobs.ts (1 hunks)
  • frontend/javascripts/admin/job/job_list_view.tsx (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build
🔇 Additional comments (8)
frontend/javascripts/admin/api/jobs.ts (1)

77-81: LGTM! The implementation follows the established pattern.

The resumeJob function is well-implemented, following the same pattern as other job-related functions in the file, making it consistent and maintainable.

frontend/javascripts/admin/job/job_list_view.tsx (3)

10-10: LGTM! Icon import follows the established pattern.

The PlayCircleOutlined icon import is correctly added, maintaining consistency with other icon imports.


139-139: LGTM! Super user check is properly implemented.

The Redux selector is correctly used to determine if the current user is a super user, ensuring proper access control.


305-316: LGTM! Resume action follows the same pattern as cancel action.

The resume functionality is well-implemented:

  • Correctly checks for failed job state and super user status
  • Uses AsyncLink for handling the action
  • Follows the same pattern as the cancel action
  • Updates the job list after resuming
app/controllers/JobController.scala (2)

53-67: LGTM! UserService is properly injected.

The UserService is correctly added to the constructor using dependency injection, following the established pattern.


115-123: LGTM! Resume method is secure and follows established patterns.

The implementation:

  • Properly checks if jobs feature is enabled
  • Verifies super user permissions with proper error handling
  • Updates job state using existing DAO methods
  • Returns consistent response format
conf/webknossos.latest.routes (1)

271-271: LGTM! Route follows RESTful conventions.

The new route is well-defined:

  • Uses appropriate HTTP method (PATCH) for state transition
  • Follows the same pattern as other job routes
  • Is correctly placed in the jobs section
CHANGELOG.unreleased.md (1)

18-18: Accessibility Update: Measurement Tools Enhancement

This changelog entry now notes that measurement tools are accessible when viewing datasets outside an annotation. Ensure that this entry remains consistent with the UI changes and accessibility guidelines applied in [#8334].

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.

Add button to processing jobs page to resume failed jobs for superusers.
2 participants