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

Fix S3 file storage import #6893

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kossnocorp
Copy link

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

I'm not sure what I can do, I don't have a ticket id.

Change has impacts in these area(s)

  • Product design
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

When using cloud storage, a task created from an imported image has a relative URL (e.g., upload/1/d0672b53-ff-template.jpg) that breaks when enabling cloud file storage.

image

What does this fix?

The fix adds CustomS3Boto3Storage::url and utilizes it in the FileUpload::read_task_from_uploaded_file to make the app correctly display imported images.

What is the new behavior?

When manually importing, the task URL will have s3://BUCKER_NAME/ prefix.

What is the current behavior?

The task URL has no prefix (e.g., upload/1/d0672b53-ff-template.jpg), so it fails to display in the app.

What libraries were added/updated?

NA

Does this change affect performance?

NA

Does this change affect security?

NA

What alternative approaches were there?

The alternative was to resolve to the storage URL when displaying, but using the file storage instance was a more straightforward approach and matched the storage-imported task schema.

What feature flags were used to cover this change?

NA

Does this PR introduce a breaking change?

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

I'm not sure what was the current setup, but it was clearly not working for cloud file storage, but I can imagine there was a working setup that might get affected, but it is not clear from the source code if there was any.

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

When using cloud storage, a task created from an imported image has a relative URL (e.g., `upload/1/d0672b53-ff-template.jpg`) that breaks when enabling cloud file storage.

The fix adds `CustomS3Boto3Storage::url` and utilizes it in the `FileUpload::read_task_from_uploaded_file` to make the app correctly display imported images.
Copy link

netlify bot commented Jan 13, 2025

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 18aecfb

Copy link

netlify bot commented Jan 13, 2025

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 18aecfb

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.

1 participant