Skip to content

Conversation

lordfolken
Copy link
Member

@lordfolken lordfolken commented Jul 16, 2025

Summary by CodeRabbit

  • Chores
    • Updated .gitignore to exclude Python virtual environments.
    • Upgraded Docker base images to Debian Bookworm for frontend and worker containers.
    • Removed installation and configuration of nginx and supervisor from the frontend container.
    • Updated server configuration to listen on all interfaces and port 9090, and disabled file logging.
    • Removed jQuery library and its inclusion from the web interface.
  • Bug Fixes
    • Improved download reliability by enabling resumption of interrupted downloads.
  • Refactor
    • Replaced jQuery usage in client-side scripts with standard DOM APIs.

Copy link

coderabbitai bot commented Jul 16, 2025

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 @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

Reviewing files that changed from the base of the PR and between 819ffd4 and 8b127d7.

📒 Files selected for processing (4)
  • lib/xcsoar/mapgen/server/job.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)

Walkthrough

The 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

File(s) Change Summary
.gitignore Added venv to ignored directories.
bin/mapgen-server Updated CherryPy server config: removed decode tool, set host/port, disabled log files.
container/frontend/Dockerfile Changed base image to bookworm; removed nginx and supervisor; now runs server directly.
container/worker/Dockerfile Changed base image to bookworm; no other changes.
lib/xcsoar/mapgen/downloader.py Added -c option to wget command for resuming downloads.
lib/xcsoar/mapgen/server/static/jquery.js Deleted entire jQuery 1.4.4 JavaScript file.
lib/xcsoar/mapgen/server/static/mapgen.js Refactored fill_boxes function to use native DOM API instead of jQuery; fixed loop variable scope.
lib/xcsoar/mapgen/server/views/index.html Removed script tag loading local jQuery.

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
Loading

Poem

A hop and a skip, jQuery's gone away,
Native DOM calls now brighten our day.
The Dockerfile's lighter, the server runs free,
Bookworm’s our base—how modern we’ll be!
With wget resuming, downloads don’t stall,
A bunny’s delight—clean code for all!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need 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)

  • @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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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

@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: 0

🧹 Nitpick comments (2)
container/frontend/Dockerfile (2)

2-2: Pin the base image digest to lock build reproducibility & reduce supply-chain risk

Relying 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 cleanup

Package versions are also unpinned; a future point-release of python3-cherrypy3 might break the service. Consider explicit versions or at least apt-mark hold.
While the layer already removes the APT lists, you can also fold apt-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

📥 Commits

Reviewing files that changed from the base of the PR and between 2a7115d and 1b4a84f.

📒 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 verified

All packages in MAPWRK_PKGS (ca-certificates, python3-jsonschema, python3-requests, p7zip, gdal-bin, mapserver-bin, wget) are available in Debian 12 (bookworm). The upgrade from debian:bullseye-slim to debian:bookworm-slim should succeed without package installation errors.

• File: container/worker/Dockerfile – base image updated to debian: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 selectors

The 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 IDs left, right, bottom, or top in the HTML/templates. Please verify that all four IDs are present in the client-side markup so that document.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 in container/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 or lib/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 removal

The line still says “Launch supervisord”, but the CMD now execs mapgen-server directly.

  1. Update the comment to avoid confusion.
  2. 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"]

@lordfolken lordfolken force-pushed the feat/93 branch 2 times, most recently from e71d6da to 819ffd4 Compare July 16, 2025 15:56
@lordfolken lordfolken linked an issue Jul 16, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant