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: correct value for config variable UPLOAD_FOLDER #25166

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

Conversation

sebastianliebscher
Copy link
Contributor

@sebastianliebscher sebastianliebscher commented Sep 2, 2023

SUMMARY

This PR fixes an incorrect default value for config variable UPLOAD_FOLDER:

  • current superset/app/static/uploads/
  • new superset/static/uploads/

Additionally:

  • static/uploads/ is now checked into git (analog to superset/static/assets/)
  • static/assets/ was initially checked into git years before, but in another commit (also years before) then .gitignored without removal from git (I think unintentionally)

The config variables IMG_UPLOAD_FOLDER and IMG_UPLOAD_URL were never used (found nothing using full text search) and are therefore removed.

TESTING INSTRUCTIONS

  1. docker build . -t test
  2. run integrations (+unit) tests based on that docker image
  3. look for correct directories

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Comment on lines -68 to +69
superset/static/assets
superset/static/assets/*
!superset/static/assets/.gitkeep
superset/static/uploads/*
!superset/static/uploads/.gitkeep
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This checks both directories into git, thus being empty default directories. Any content will be ignored.

.gitignore Outdated
local_config.py
/superset_config.py
/superset_text.yml
superset.egg-info/
superset/bin/supersetc
tmp
rat-results.txt
superset/app/
Copy link
Contributor Author

@sebastianliebscher sebastianliebscher Sep 2, 2023

Choose a reason for hiding this comment

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

This is the incorrect path that contained static/uploads/. superset/app/ shouldn't be a valid directory anyway. For developers, this change could potentially pop up affected files in their git repo as untracked files.

UPLOAD_CHUNK_SIZE = 4096

# The image upload folder, when using models with images
IMG_UPLOAD_FOLDER = BASE_DIR + "/app/static/uploads/"
Copy link
Contributor Author

@sebastianliebscher sebastianliebscher Sep 2, 2023

Choose a reason for hiding this comment

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

I couldn't find any usage of these variables.

@sebastianliebscher
Copy link
Contributor Author

sebastianliebscher commented Sep 2, 2023

This PR is ready for review, but may require further discussion. I'm not sure, but that could quite possibly be a breaking change. Possibly one would have to move important files? Or a mention in the release notes is sufficient?

@sebastianliebscher sebastianliebscher changed the title fix: set UPLOAD_FOLDER to superset/static/uploads/ fix: correct value for config variable UPLOAD_FOLDER Sep 3, 2023
@sfirke sfirke added the hold! On hold label Jan 19, 2024
@rusackas
Copy link
Member

We're working toward 5.0, and I think that's the safe time to get this merged (finally). I've put it on the kanban board, just FYI :) Thanks for the contributions!

@michael-s-molina michael-s-molina added the risk:breaking-change Issues or PRs that will introduce breaking changes label Dec 11, 2024
@rusackas rusackas removed the hold! On hold label Jan 9, 2025
@rusackas
Copy link
Member

rusackas commented Jan 9, 2025

/korbit-review

@rusackas
Copy link
Member

rusackas commented Jan 9, 2025

Closing and reopening to get CI to spin again. @sebastianliebscher can you please add an entry to UPDATING.md to help folks who are upgrading mitigate any risks here?

@rusackas rusackas closed this Jan 9, 2025
@rusackas rusackas reopened this Jan 9, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset/config.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Current Korbit Configuration

General Settings
Setting Value
Review Schedule Automatic excluding drafts
Max Issue Count 10
Automatic PR Descriptions
Issue Categories
Category Enabled
Naming
Database Operations
Documentation
Logging
Error Handling
Systems and Environment
Objects and Data Structures
Readability and Maintainability
Asynchronous Processing
Design Patterns
Third-Party Libraries
Performance
Security
Functionality

Feedback and Support

Note

Korbit Pro is free for open source projects 🎉

Looking to add Korbit to your team? Get started with a free 2 week trial here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
risk:breaking-change Issues or PRs that will introduce breaking changes size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants