Skip to content

chore(ZMS): optimize dev container setup#1874

Open
Fabinatix97 wants to merge 3 commits intonextfrom
chore-zms-optimize-dev-container-setup
Open

chore(ZMS): optimize dev container setup#1874
Fabinatix97 wants to merge 3 commits intonextfrom
chore-zms-optimize-dev-container-setup

Conversation

@Fabinatix97
Copy link
Member

@Fabinatix97 Fabinatix97 commented Jan 29, 2026

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.

Summary by CodeRabbit

  • Chores
    • Updated development environment configuration, including Node.js version to 24.x and dev container setup automation.
    • Added environment configuration templates for development setup.
    • Optimized URL routing and database initialization in the development container.
    • Made HTTPS enforcement configurable for local development scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This PR updates development container configuration with Node.js version upgrade from v18 to v24, disables SSL setup, adds database initialization and environment variable management, modifies routing logic, and introduces conditional HTTPS enforcement control for local development environments.

Changes

Cohort / File(s) Summary
Development Container Configuration
.devcontainer/.env.template, .devcontainer/Containerfile, .devcontainer/devcontainer.json, .devcontainer/docker-compose.yaml
API endpoint updated to http://web/..., Node.js upgraded to v24, SSL module and certificate generation disabled, VS Code extensions expanded, build commands added for npm and Composer, and database initialization volume mapping added.
HTTPS & Routing Configuration
.htaccess, zmsadmin/.env.example, zmsadmin/js/index.js
Routing changed from external 302 redirect to internal rewrite rule, HTTPS enforcement made conditional via environment variable, with example configuration provided for zmsadmin module.
Environment Management
zmsadmin/.gitignore
Added ignore patterns for environment variable files: .env, .env.local, .env.*.local.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hops of joy as containers evolve,
Node twenty-four, SSL we dissolve,
Routes rewritten, HTTPS bends to will,
Dev tools dance on the dev machine's hill! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore(ZMS): optimize dev container setup' accurately summarizes the main changes—multiple modifications to dev container configuration files (.devcontainer folder) and related development setup, including container optimization, Node.js version updates, VS Code extensions, and local development enablement.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
zmsadmin/js/index.js (1)

146-146: Remove console.log from the production bundle

Replace with your structured logger or drop the message.

As per coding guidelines: “Flag any usage of console.log() as it should be replaced with proper logging or removed.”

🤖 Fix all issues with AI agents
In @.htaccess:
- Around line 6-7: The RewriteRule change altered behavior: restore the previous
semantics by adding back the query-string check and performing an external
redirect; specifically, update the RewriteCond to check %{QUERY_STRING} ^$ and
change the RewriteRule flags to [R=302,L] and append a trailing ? to the target
to avoid preserving the query string (referencing the existing RewriteCond,
RewriteRule, %{QUERY_STRING}, and the flag tokens [L] and [R=302,L]);
alternatively, if you intend to preserve query strings and keep an internal
rewrite, document this breaking behavior for callers that relied on the visible
redirect to /terminvereinbarung/admin.

In `@zmsadmin/.env.example`:
- Around line 1-6: Add a trailing newline at the end of the .env example so
dotenv-linter stops complaining; specifically ensure the file ends with a blank
line after the final variable declaration (ZMS_ADMIN_FORCE_HTTPS) so the file
terminates with a newline character.
🧹 Nitpick comments (3)
.devcontainer/docker-compose.yaml (1)

27-29: Document init-script behavior for existing volumes

MariaDB only executes /docker-entrypoint-initdb.d scripts on first initialization; with an existing db-data volume this SQL won’t run. Consider documenting a volume reset step or ensuring the script is idempotent so developers don’t get stale schemas.

.devcontainer/devcontainer.json (1)

22-29: Consider moving the long postCreateCommand into a script + add DB readiness guard

The one-liner is hard to maintain, and the migration step can be flaky if the DB isn’t ready. A dedicated script makes this easier to read and extend (and to add a small wait/retry around the migration).

As per coding guidelines: “Code is clean if it can be understood easily – by everyone on the team.”

.devcontainer/Containerfile (1)

32-47: Consider reducing commented SSL blocks for maintainability.

Now that SSL is disabled, the commented-out sections make the Dockerfile harder to scan. Consider either removing them or gating SSL setup behind a build ARG (so it’s explicit and easy to re-enable).

Comment on lines +6 to +7
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ /terminvereinbarung/admin [L]
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the .htaccess file
find . -name ".htaccess" -type f

Repository: it-at-m/eappointment

Length of output: 75


🏁 Script executed:

# Check if .htaccess exists and view its content
if [ -f "./.htaccess" ]; then
  echo "=== Current .htaccess ==="; 
  cat -n ./.htaccess;
else
  echo ".htaccess not found in root";
fi

Repository: it-at-m/eappointment

Length of output: 3289


🏁 Script executed:

# Check git history of .htaccess to see what changed
git log --oneline -20 -- .htaccess 2>/dev/null || echo "Git history not available"

Repository: it-at-m/eappointment

Length of output: 118


🏁 Script executed:

# Get the diff of the last change to .htaccess
git diff HEAD~1 HEAD -- ./.htaccess 2>/dev/null || echo "Cannot retrieve git diff"

Repository: it-at-m/eappointment

Length of output: 88


🏁 Script executed:

# Get more detailed git history for .htaccess
git log --all --oneline -- ./.htaccess | head -20

Repository: it-at-m/eappointment

Length of output: 529


🏁 Script executed:

# Try to get the previous version of .htaccess
git show HEAD:./.htaccess | head -20

Repository: it-at-m/eappointment

Length of output: 734


🏁 Script executed:

# Look at the parent commit's version
git show HEAD~1:./.htaccess 2>/dev/null | head -20 || echo "Cannot access parent commit"

Repository: it-at-m/eappointment

Length of output: 46


🏁 Script executed:

# Search for any files mentioning QUERY_STRING
rg "QUERY_STRING" . --type-list

Repository: it-at-m/eappointment

Length of output: 453


🏁 Script executed:

# Get a broader git diff context
git log -p -1 --all -- ./.htaccess 2>/dev/null | head -80 || echo "Cannot retrieve detailed history"

Repository: it-at-m/eappointment

Length of output: 46


🏁 Script executed:

# Check earlier commits to see if QUERY_STRING was present
git show a5d24d147:./.htaccess 2>/dev/null | head -20 || echo "Cannot access that commit"

Repository: it-at-m/eappointment

Length of output: 742


🏁 Script executed:

# Try checking an even earlier commit
git show 2de6104e7:./.htaccess 2>/dev/null | head -20 || echo "Cannot access that commit"

Repository: it-at-m/eappointment

Length of output: 742


🏁 Script executed:

# Search for QUERY_STRING in the entire repo history using git log
git log -p --all -S "QUERY_STRING" -- ./.htaccess 2>/dev/null | head -100 || echo "No matches found"

Repository: it-at-m/eappointment

Length of output: 46


🏁 Script executed:

# Look at the specific commit that modified this file most recently
git show 2c9165b23 2>/dev/null | head -100

Repository: it-at-m/eappointment

Length of output: 4415


Confirm behavior change: rewrite rule now applies to all / requests regardless of query string.

The previous version checked RewriteCond %{QUERY_STRING} ^$ (empty query string only) and performed an external redirect with [R=302,L] and a trailing ?. The current version removed the query string condition and uses an internal rewrite [L] instead, fundamentally changing when and how the rule fires.

This creates two separate concerns:

  1. Query string handling: Requests like /?foo=bar now match and rewrite internally, whereas before they were ignored.
  2. URL visibility: The browser URL now stays at / (internal rewrite) instead of redirecting to /terminvereinbarung/admin (external redirect).

The suggested fix restores the empty query string condition, but fully reverting to prior behavior requires reinstating the redirect flag and trailing ?:

✅ Complete restore of prior trigger and redirect behavior
 RewriteCond %{REQUEST_URI} ^/$
+RewriteCond %{QUERY_STRING} ^$
-RewriteRule ^ /terminvereinbarung/admin [L]
+RewriteRule ^ /terminvereinbarung/admin? [R=302,L]

If query-string preservation is intended, keep the rewrite but document this as a breaking change for callbacks or assets expecting the old visible URL.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ /terminvereinbarung/admin [L]
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^ /terminvereinbarung/admin? [R=302,L]
🤖 Prompt for AI Agents
In @.htaccess around lines 6 - 7, The RewriteRule change altered behavior:
restore the previous semantics by adding back the query-string check and
performing an external redirect; specifically, update the RewriteCond to check
%{QUERY_STRING} ^$ and change the RewriteRule flags to [R=302,L] and append a
trailing ? to the target to avoid preserving the query string (referencing the
existing RewriteCond, RewriteRule, %{QUERY_STRING}, and the flag tokens [L] and
[R=302,L]); alternatively, if you intend to preserve query strings and keep an
internal rewrite, document this breaking behavior for callers that relied on the
visible redirect to /terminvereinbarung/admin.

Comment on lines +1 to +6
# Environment variables for zmsadmin JavaScript build
# Copy this file to .env and adjust as needed

# Set to 'false' to disable HTTPS enforcement (useful for local development)
# Set to 'true' or omit to enforce HTTPS (production default)
ZMS_ADMIN_FORCE_HTTPS=false No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add trailing newline to satisfy dotenv-linter

Static analysis reports a missing ending blank line.

✅ Proposed fix
 ZMS_ADMIN_FORCE_HTTPS=false
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Environment variables for zmsadmin JavaScript build
# Copy this file to .env and adjust as needed
# Set to 'false' to disable HTTPS enforcement (useful for local development)
# Set to 'true' or omit to enforce HTTPS (production default)
ZMS_ADMIN_FORCE_HTTPS=false
# Environment variables for zmsadmin JavaScript build
# Copy this file to .env and adjust as needed
# Set to 'false' to disable HTTPS enforcement (useful for local development)
# Set to 'true' or omit to enforce HTTPS (production default)
ZMS_ADMIN_FORCE_HTTPS=false
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 6-6: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🤖 Prompt for AI Agents
In `@zmsadmin/.env.example` around lines 1 - 6, Add a trailing newline at the end
of the .env example so dotenv-linter stops complaining; specifically ensure the
file ends with a blank line after the final variable declaration
(ZMS_ADMIN_FORCE_HTTPS) so the file terminates with a newline character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant