Conversation
◈ PR Lens
Architecture 1 component touched across 4 lanes. Data flow
View
Tip Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion. 🪧 More tips
Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…d URLs
AWS_S3_URL_PROTOCOL was derived from the scheme of WEB_URL, ignoring
MINIO_ENDPOINT_SSL. S3Storage checks that flag directly at
plane/settings/storage.py:41, so every presigned URL built through it is
correct, but the export task at plane/bgtasks/export_task.py:67 builds its
own boto3 client from AWS_S3_URL_PROTOCOL and AWS_S3_CUSTOM_DOMAIN and so
never saw the flag.
Deployments that terminate TLS at a proxy and leave WEB_URL on http
therefore get http:// download links on an https site, which browsers
block silently. The community compose config makes this the default path,
since deployments/cli/community/variables.env hardcodes
WEB_URL=http://${APP_DOMAIN}.
Mirror the check storage.py already makes so the two paths agree.
Fixes makeplane#9550
fb1667c to
c2e873b
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change updates ChangesS3 URL protocol resolution
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change is scoped to correcting export URL protocol selection, with coverage for SSL override and fallback behavior; no merge-blocking risk is established. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
Add regression tests covering SSL-enabled and fallback configurations.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request fixes export presigned URLs to honor MINIO_ENDPOINT_SSL.
Changes:
- Uses HTTPS when
MINIO_ENDPOINT_SSL=1. - Preserves the existing
WEB_URLscheme fallback.
File summaries
| File | Summary |
|---|---|
apps/api/plane/settings/common.py |
Applies the MinIO SSL flag to export URL protocol generation; regression tests are still needed. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
AWS_S3_URL_PROTOCOL is computed at plane.settings.common import time, so the existing S3Storage tests do not reach it. Reload the settings module under a patched environment and assert both directions: the flag forces https over an http WEB_URL, and an unset or 0 flag still falls back to the WEB_URL scheme. Verified the suite catches the regression. With the fix reverted, test_ssl_flag_forces_https_when_web_url_is_http fails and the three fallback cases still pass, which is the intended split.
|
Good catch, added in dc63f51.
I checked the suite actually catches the regression rather than just passing alongside the fix. Reverting the one-line change locally: The three fallback cases pass in both states, which is the point of them, and only the new behaviour fails without the fix. With the fix, 5 passed. An autouse fixture reloads |
Description
Presigned download URLs generated by the export task come back on
http://even whenMINIO_ENDPOINT_SSL=1is set, so on an https instance the browser blocks the download silently.There are two presigned-URL paths and only one of them honoured the flag.
S3Storagechecks it directly,apps/api/plane/settings/storage.py:41:The export task never touches
S3Storage. It builds its own boto3 client,apps/api/plane/bgtasks/export_task.py:65-73:and
AWS_S3_URL_PROTOCOLwas taken from the scheme ofWEB_URL, not fromMINIO_ENDPOINT_SSLand not fromAWS_S3_ENDPOINT_URL. That is the only definition and the only use of the setting in the repo.This is the default path for self-hosters rather than an edge case:
deployments/cli/community/variables.env:15hardcodesWEB_URL=http://${APP_DOMAIN}, so anyone terminating TLS at a proxy getshttp:here regardless of what they set.This PR makes the setting mirror the check
storage.pyalready makes, so the two paths agree.Type of Change
Test Scenarios
Exercised the settings logic across the realistic configurations to confirm nothing but the intended case moves:
MINIO_ENDPOINT_SSL=1http://plane.example.com/https://plane.example.com/http://plane.example.com/WEB_URLalready httpshttps://plane.example.com/MINIO_ENDPOINT_SSL=0http://192.168.1.50/Only a deployment that explicitly opted into SSL changes behaviour.
ruff checkpasses and the changed line isruff formatclean.Two things reviewers should know:
ExporterHistory.urlis a storedURLFieldwritten once atexport_task.py:118, so rows created before this change keep their oldhttp://links. Only new exports come back corrected.There is already a
# TODO: Change the upload_to_s3 function to use the new storage methodatexport_task.py:41. Routing export throughS3Storagewould remove this whole class of divergence rather than patching one symptom, but it is a much larger change, so I kept this to the single line that makes the two paths agree. Happy to take it that way instead if you would prefer.References
Fixes #9550
Related #5827
Summary by CodeRabbit