-
Notifications
You must be signed in to change notification settings - Fork 11
Feat/93 #96
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
base: master
Are you sure you want to change the base?
Feat/93 #96
Conversation
Warning Rate limit exceeded@lordfolken has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 11 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (4)
WalkthroughThe updates remove jQuery from the project by deleting its static file, refactoring JavaScript to use native DOM APIs, and removing its inclusion in HTML. The frontend Dockerfile is simplified to run the server directly, dropping nginx and supervisor. Additional changes update Debian base images and adjust server and downloader configurations. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Browser
participant MapgenServer
User->>Browser: Load index.html
Browser->>MapgenServer: Request /static/mapgen.js
Browser->>MapgenServer: Request OpenLayers script
Note over Browser: No longer loads jQuery
User->>Browser: Interact with UI
Browser->>Browser: fill_boxes() uses native DOM API
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (2)
container/frontend/Dockerfile (2)
2-2
: Pin the base image digest to lock build reproducibility & reduce supply-chain riskRelying on the moving tag
debian:bookworm-slim
means every build might silently pull a newer layer with different binaries or CVEs. Pinning by digest (e.g.debian@sha256:…
) preserves repeatability and hardens the image provenance chain.Example:
-FROM debian:bookworm-slim +FROM debian@sha256:<bookworm-slim-digest>
7-7
: Package layer could be tighter: pin versions & collapse cleanupPackage versions are also unpinned; a future point-release of
python3-cherrypy3
might break the service. Consider explicit versions or at leastapt-mark hold
.
While the layer already removes the APT lists, you can also foldapt-get clean
into the same command chain to ensure no intermediate layer keeps them:-RUN apt-get update && apt-get install -y --no-install-recommends $MAPFRNT_PKG && apt-get clean && rm -rf /var/lib/apt/lists/* +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends $MAPFRNT_PKG; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/*Minor, but it standardises error handling (
set -euo pipefail
).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
.gitignore
(1 hunks)bin/mapgen-server
(1 hunks)container/frontend/Dockerfile
(2 hunks)container/worker/Dockerfile
(1 hunks)lib/xcsoar/mapgen/downloader.py
(1 hunks)lib/xcsoar/mapgen/server/static/jquery.js
(0 hunks)lib/xcsoar/mapgen/server/static/mapgen.js
(1 hunks)lib/xcsoar/mapgen/server/views/index.html
(0 hunks)
💤 Files with no reviewable changes (2)
- lib/xcsoar/mapgen/server/views/index.html
- lib/xcsoar/mapgen/server/static/jquery.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (6)
container/worker/Dockerfile (1)
2-2
: All Bookworm packages verifiedAll packages in
MAPWRK_PKGS
(ca-certificates, python3-jsonschema, python3-requests, p7zip, gdal-bin, mapserver-bin, wget) are available in Debian 12 (bookworm). The upgrade fromdebian:bullseye-slim
todebian:bookworm-slim
should succeed without package installation errors.• File:
container/worker/Dockerfile
– base image updated todebian:bookworm-slim
Please ensure your CI/integration tests pass against the new base image before merging.
.gitignore (1)
18-18
: LGTM! Standard Python development practice.Adding
venv
to.gitignore
is the correct approach for excluding Python virtual environments from version control.lib/xcsoar/mapgen/downloader.py (1)
120-120
: Excellent improvement for download resilience.Adding the
-c
flag to wget enables resume capability for interrupted downloads, which can significantly improve reliability and efficiency for large file downloads.lib/xcsoar/mapgen/server/static/mapgen.js (1)
67-83
: Ensure corresponding DOM elements exist for the replaced selectorsThe jQuery-to-vanilla-DOM refactoring in
lib/xcsoar/mapgen/server/static/mapgen.js
is correct, but our automated search did not locate any elements with IDsleft
,right
,bottom
, ortop
in the HTML/templates. Please verify that all four IDs are present in the client-side markup so thatdocument.querySelector()
calls succeed at runtime.• Check your HTML or template files for:
<* id="left">
<* id="right">
<* id="bottom">
<* id="top">
bin/mapgen-server (1)
18-21
: Container-friendly server configuration validated; confirm external security measures
"server.socket_host": "0.0.0.0"
correctly binds to all interfaces.- Port
9090
is exposed incontainer/frontend/Dockerfile
and the default server config.- Empty log file paths redirect access/error logs to stdout/stderr.
- No firewall/security/auth settings were found in
bin/mapgen-server
orlib/xcsoar/mapgen/server
.These changes align with container best practices. Please ensure appropriate network policies or firewall rules are enforced at the orchestration or infrastructure level to restrict access.
container/frontend/Dockerfile (1)
19-20
: Stale comment & signal-handling verification after supervisor removalThe line still says “Launch supervisord”, but the CMD now execs
mapgen-server
directly.
- Update the comment to avoid confusion.
- Double-check that
mapgen-server
runs in the foreground and handles SIGTERM/SIGINT correctly, otherwise graceful shutdown in Docker/K8s will fail without supervisor.-# Launch supervisord on container startup -CMD ["/opt/mapgen/bin/mapgen-server"] +# Launch mapgen-server directly (supervisord removed) +CMD ["/opt/mapgen/bin/mapgen-server"]
e71d6da
to
819ffd4
Compare
Summary by CodeRabbit
.gitignore
to exclude Python virtual environments.