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

Allow downloading tasks of teams you are not in #8155

Merged
merged 5 commits into from
Oct 30, 2024

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Oct 29, 2024

You can not list tasks of teams you are not in, but you can view individual task annotations if you know the ID/URL. This is consistent with our permission model. (Default task visibility “Internal”)

Now if you wanted to download them, this worked in the skeleton-only case but failed in the volume case. This PR unifies the behavior by allowing this also in the volume case.

URL of deployed dev instance (used for testing):

Steps to test:

  • Set a dataset to accessible for the Default team
  • Create a new team
  • Create a project for this new team
  • Create a volume/hybrid task type
  • Create a task for this dataset using the this project + task type
  • Request this task, annotate some
  • Log in as another non-privileged user (e.g. [email protected]), view this annotation by URL
  • Download it. This should work now. Previously you’d get Failed to download annotation

Issues:


Summary by CodeRabbit

  • New Features

    • Added metadata support for annotations on Trees and Segments.
    • Introduced a summary row in the time tracking overview.
    • Improved slider functionality and enhanced search for unnamed segments.
    • Increased loading speeds for precomputed meshes.
    • New button added in the search popover for selecting all matching non-group results.
    • Unified terminology in the UI, replacing "Resolution" with "Magnification."
    • Support for remote OME-Zarr NGFF version 0.5 datasets.
  • Bug Fixes

    • Resolved issues with dataset uploads and bbox export.
    • Fixed handling of insufficient sharing tokens when saving annotations.
    • Addressed automatic group expansion in skeleton searches and shape returns in zarr streaming.
    • Corrected sorting issues in outbound zarr streaming.
    • Fixed the inability to create annotations for public datasets from other organizations.
    • Specific fix for downloading task annotations via URI.
  • Improvements

    • Enhanced error messages for better clarity and user comprehension.

@fm3 fm3 self-assigned this Oct 29, 2024
Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

Warning

Rate limit exceeded

@fm3 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between babb046 and 16e6b90.

Walkthrough

The pull request introduces several user-facing enhancements and bug fixes to the WEBKNOSSOS application. Key updates include new features for metadata in annotations, improved search capabilities, and enhanced loading speeds for precomputed meshes. It also modifies error handling in the AnnotationIOController to improve context management and updates error messages for clarity. Additionally, the migration of nightly screenshot tests to GitHub Actions is included, along with various bug fixes related to dataset uploads and annotation handling.

Changes

File Change Summary
CHANGELOG.unreleased.md Updated to include new features, performance improvements, and bug fixes.
app/controllers/AnnotationIOController.scala Modified download and downloadWithoutType methods for better error handling and context management.
conf/messages Enhanced clarity of error messages, specifically updating team.notFound.

Assessment against linked issues

Objective Addressed Explanation
Error downloading task annotation (issue #1205)

Possibly related PRs

  • Fix bbox export via bbox menu #8152: The changes in this PR address an issue with the bbox export functionality, which is directly related to the bug fixes mentioned in the main PR regarding the bbox export menu item.

Suggested labels

frontend

Suggested reviewers

  • normanrz

Poem

In the meadow where data flows,
Bugs are fixed, and new features grow.
Annotations now sing with metadata bright,
Searching is swift, a pure delight!
With clarity in messages, we leap and bound,
WEBKNOSSOS shines, in joy we're found! 🐇✨


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.

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: 2

🧹 Outside diff range and nitpick comments (1)
app/controllers/AnnotationIOController.scala (1)

459-461: Consider separating access control from task retrieval.

The current implementation mixes task retrieval with access control concerns. To better align with the PR objective of allowing downloads from other teams, consider:

  1. Separating the task retrieval logic from access control
  2. Adding explicit team access validation
  3. Handling different error cases separately (task not found vs. no team access)

Consider refactoring the task retrieval and access control:

+        // First, try to find the task
+        task <- Fox.runOptional(annotation._task)(taskDAO.findOne(_)(GlobalAccessContext)) ?~> "task.notFound"
+        // Then, verify team access separately
+        _ <- validateTaskAccess(task, issuingUser) ?~> "team.access.denied"
-        taskOpt <- Fox.runOptional(annotation._task)(taskDAO.findOne(_)(GlobalAccessContext)) ?~> "team.notFound"

This separation would make the code more maintainable and the error handling more precise.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between d40dfbe and babb046.

📒 Files selected for processing (3)
  • CHANGELOG.unreleased.md (1 hunks)
  • app/controllers/AnnotationIOController.scala (1 hunks)
  • conf/messages (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.unreleased.md

[typographical] ~38-~38: Usually, there’s no comma before “when”.
Context: ...task annotations of teams you are not in, when accessing directly via URI. [#8155](htt...

(IF_NO_COMMA)

🔇 Additional comments (1)
conf/messages (1)

26-26: LGTM! Error message update aligns with PR objectives.

The updated error message "Team could not be found or accessed" better reflects the actual scenarios where this error might occur, particularly in the context of allowing users to download tasks from teams they're not members of. This change improves clarity for users by explicitly indicating that the issue could be either due to the team not existing or due to access restrictions.

CHANGELOG.unreleased.md Show resolved Hide resolved
app/controllers/AnnotationIOController.scala Outdated Show resolved Hide resolved
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the good testing instructions.

Fix works for me 🎉

🟢

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.

Error downloading task annotation, annotation.download.hybridToFile.failed
2 participants