Skip to content

Conversation

MichaelBuessemeyer
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer commented Nov 15, 2024

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • I suggest to test locally
  • checkout master
  • run yarn enable-jobs, in application.conf set exportTiffMaxVolumeMVx = 100 and exportTiffMaxEdgeLengthVx = 100
  • open a relatively large dataset and try to run an inferral job on the whole dataset. The form input should be rejected by the frontend due to the whole ds being too large for whats allowed
  • checkout this branch
  • Do the same again, this time submitting the job should succeed (with [email protected])

Issues:


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

Summary by CodeRabbit

  • New Features

    • System now ignores format prefixes like precomputed:// when pasting remote URIs from Neuroglancer.
    • Asynchronous image file reading for improved performance.
    • Removed bounding box size restrictions for super users, enhancing job configuration flexibility.
  • Bug Fixes

    • Resolved performance bottleneck when deleting multiple trees.
    • Fixed import issues with NML files containing only groups.
    • Corrected deletion error when attempting to delete a non-existing node via the API.
  • Enhancements

    • Improved user permission handling for bounding box selection in job initiation processes.
    • Enhanced error messages for starting jobs on datasets from other organizations.

Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

Walkthrough

The changes in this pull request involve updates to the WEBKNOSSOS project, focusing on asynchronous image file handling and modifications to bounding box configurations for super users. The changelog highlights performance improvements and bug fixes, including resolving issues with tree deletions and NML file imports. Additionally, user permissions related to bounding box selection have been refined in the frontend code, allowing super users to bypass certain validation checks.

Changes

File Path Change Summary
CHANGELOG.unreleased.md Updated to document asynchronous image file handling, removal of bounding box size restrictions for super users, and various bug fixes related to performance and tree deletions.
frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx Enhanced bounding box selection functionality by adding isSuperUser property, updating validation logic, and modifying UI rendering based on user permissions. Adjusted type signatures for relevant props.

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • normanrz

🐇 In a world of boxes, big and small,
Super users can now stand tall.
With bugs all fixed and files in line,
Asynchronous reads make it all just fine.
So hop along, let’s start the show,
In WEBKNOSSOS, we’re ready to go! 🌟


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 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.

@MichaelBuessemeyer
Copy link
Contributor Author

@normanrz I just assigned you in case you have time. If you do not, feel free to re-assign the review :)

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

🧹 Outside diff range and nitpick comments (2)
CHANGELOG.unreleased.md (2)

17-17: Consider spelling and clarity improvements

The changelog entry could be improved for clarity and consistent spelling:

-Removed bounding box size restriction for inferral jobs for super users. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
+Removed bounding box size restriction for inference jobs for superusers. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
🧰 Tools
🪛 LanguageTool

[grammar] ~17-~17: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)


17-17: Add more context about the change's impact

Consider expanding the changelog entry to provide more context about:

  • The previous limitation that was removed
  • The impact and benefits for superusers
  • Any related configuration changes needed

This would help users better understand the significance of this change.

Example:

-Removed bounding box size restriction for inferral jobs for super users. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
+Removed bounding box size restriction for inference jobs for superusers, allowing them to process larger datasets without size limitations. Previously enforced size restrictions no longer apply to superuser accounts. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
🧰 Tools
🪛 LanguageTool

[grammar] ~17-~17: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff5b67 and 47a623b.

📒 Files selected for processing (2)
  • CHANGELOG.unreleased.md (1 hunks)
  • frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx (5 hunks)
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.unreleased.md

[grammar] ~17-~17: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)

🔇 Additional comments (3)
frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx (3)

114-114: LGTM: Type definition updated correctly

The isSuperUser property has been properly added to the BoundingBoxSelectionProps type definition.


Line range hint 223-241: LGTM: Validation bypass for super users implemented correctly

The validation logic has been updated to bypass bounding box size restrictions for super users while maintaining the restrictions for regular users. The implementation:

  1. Early returns for non-configurable boxes or super users
  2. Maintains existing validation for regular users
  3. Provides clear error messages

538-538: Verify super user state handling

The super user state is correctly retrieved from the Redux store and properly passed down to the BoundingBoxSelectionFormItem. However, let's verify that the super user state is consistently handled across the application.

Also applies to: 649-649

✅ Verification successful

Let me search for more specific patterns to verify the super user state handling.


Let me search for the actual usage of bounding box validation in the codebase.


Based on the code analysis, I can now provide a final response about the super user state handling in relation to bounding box validation.

Super user state handling is correctly implemented

The super user state handling for bounding box validation is properly implemented with appropriate checks:

  • The isSuperUser flag is correctly retrieved from the Redux store and passed down to components
  • Super users are exempted from bounding box size restrictions as seen in the validation logic: if (!isBoundingBoxConfigurable || isSuperUser) return Promise.resolve();
  • The isBoundingBoxExportable function is consistently used across the application for validating bounding box sizes
  • The validation is properly bypassed for super users while still being enforced for regular users
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent handling of super user state
# Look for other instances where super user checks might be needed for bounding box validation

# Check for other bounding box validation logic
rg -A 5 "isBoundingBoxExportable|boundingBox.*validation"

# Check for other super user checks that might need similar updates
rg -A 5 "isSuperUser.*boundingBox"

Length of output: 2994


Script:

#!/bin/bash
# Search for all occurrences of isSuperUser to understand its usage patterns
rg -A 5 "isSuperUser"

# Search for bounding box related components and forms
ast-grep --pattern 'const $_ = $$$boundingBox$$$'

Length of output: 143834


Script:

#!/bin/bash
# Search for bounding box validation logic and its relationship with super user checks
rg -A 5 "boundingBox.*validation|isBoundingBoxExportable" frontend/

# Search for bounding box related components and their props
ast-grep --pattern 'function $name($props) { $$$boundingBox$$$ }'

Length of output: 3035

@MichaelBuessemeyer MichaelBuessemeyer requested review from knollengewaechs and removed request for normanrz November 18, 2024 10:01
@MichaelBuessemeyer
Copy link
Contributor Author

@dieknolle3333 Do you maybe have some time to look at this PR? It is pretty small 🐌

Copy link
Contributor

@knollengewaechs knollengewaechs left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. Testing went well and code LGTM! 🎉 🙏

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

🧹 Outside diff range and nitpick comments (1)
CHANGELOG.unreleased.md (1)

19-19: Consider enhancing clarity and fixing spelling.

Two minor suggestions:

  1. "super users" should be "superusers" as it's commonly written as one word
  2. Consider adding more context about the implications, e.g.: "Removed bounding box size restriction for inferral jobs when initiated by superusers, allowing them to process larger datasets."
-Removed bounding box size restriction for inferral jobs for super users. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
+Removed bounding box size restriction for inferral jobs when initiated by superusers, allowing them to process larger datasets. [#8200](https://github.com/scalableminds/webknossos/pull/8200)
🧰 Tools
🪛 LanguageTool

[grammar] ~19-~19: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 47a623b and 2a6badc.

📒 Files selected for processing (2)
  • CHANGELOG.unreleased.md (1 hunks)
  • frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.unreleased.md

[grammar] ~19-~19: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)

🔇 Additional comments (1)
CHANGELOG.unreleased.md (1)

19-19: LGTM! The changelog entry accurately reflects the changes.

The entry is appropriately placed in the "Changed" section and includes the correct PR reference.

🧰 Tools
🪛 LanguageTool

[grammar] ~19-~19: This is normally spelled as one word.
Context: ... size restriction for inferral jobs for super users. [#8200](https://github.com/scalablemin...

(SUPER_COMPOUNDS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants