-
-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: Streamline initialization script and permissions setup for Yii2 directories; update PHPStan tmpDir configuration and add .gitignore for runtime. #110
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
Conversation
…Yii2 directories; update PHPStan tmpDir configuration and add .gitignore for runtime.
Warning Rate limit exceeded@terabytesoftw has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 51 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 (3)
WalkthroughDirectory creation and permission management were moved from the Dockerfile to the Changes
Sequence Diagram(s)sequenceDiagram
participant Entrypoint as entrypoint.sh
participant InitScript as init.sh
participant System as OS
participant Composer as Composer
participant Supervisor as supervisord
Entrypoint->>InitScript: Run initialization script
InitScript->>System: Create /app/runtime/cache, /app/runtime/logs, /app/public/assets
InitScript->>System: Set ownership and permissions
InitScript->>System: Verify directory existence and writability
InitScript->>Composer: Conditional dependency installation
InitScript->>System: Set ownership on vendor directory
InitScript->>Supervisor: Start supervisord
InitScript-->>Entrypoint: Return success or failure
Entrypoint->>Entrypoint: Print startup messages and exit accordingly
Possibly related PRs
Suggested labels
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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 36 36
===========================================
Files 23 23
Lines 621 621
===========================================
Hits 621 621 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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: 2
🧹 Nitpick comments (2)
docker/init.sh (2)
11-20
: Collapse mkdir/permission logic into singleinstall -d
callsYou can avoid three separate commands per directory:
-mkdir -p /app/runtime/cache -mkdir -p /app/runtime/logs -mkdir -p /app/public/assets -chmod -R 775 /app/runtime -chmod -R 775 /app/public/assets -chown -R www-data:www-data /app/runtime -chown -R www-data:www-data /app/public/assets +install -d -m 775 -o www-data -g www-data /app/runtime/cache \ + /app/runtime/logs \ + /app/public/assetsThis is faster, atomic, and avoids redundant
chmod
/chown
passes over large trees.
41-58
: Composer install: add resilience & speed flags
- Fail early if
composer
is missing:command -v composer >/dev/null || { echo "Composer not found"; exit 1; }
- Use
--prefer-dist --no-progress
to cut network traffic and log noise.-composer install --no-dev --optimize-autoloader --no-interaction +composer install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-interactionSame for the dev branch.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docker/frankenphp/Dockerfile
(0 hunks)docker/init.sh
(2 hunks)phpstan.neon
(1 hunks)
💤 Files with no reviewable changes (1)
- docker/frankenphp/Dockerfile
🧰 Additional context used
🧠 Learnings (1)
docker/init.sh (1)
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.805Z
Learning: In docker/apache/Dockerfile, the queue.conf copy command is intentionally commented out because yii2-queue is optional. Users should uncomment the line `COPY docker/apache/supervisord/conf.d/queue.conf /etc/supervisor/conf.d/queue.conf` only if they install yii2-queue.
⏰ 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). (7)
- GitHub Check: codeception / PHP 8.3-windows-latest
- GitHub Check: codeception / PHP 8.1-windows-latest
- GitHub Check: codeception / PHP 8.2-windows-latest
- GitHub Check: codeception / PHP 8.4-windows-latest
- GitHub Check: test-frankenphp
- GitHub Check: codeception / PHP 8.4-windows-latest
- GitHub Check: test-frankenphp
🔇 Additional comments (1)
phpstan.neon (1)
17-17
: tmpDir relocation looks good – just confirm the folder exists before CI runsMoving PHPStan’s
tmpDir
outsidepublic/
reduces surface-area and matches the new runtime layout.
Please double-check that theruntime/
directory is created (locally and in CI) before PHPStan executes; otherwise PHPStan will fail to create its cache.
…ermission checks for Yii2 directories.
…amline the process.
…ency across environments.
… and enhance debugging with logs.
…d ownership checks.
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: 2
🧹 Nitpick comments (1)
docker/entrypoint.sh (1)
8-9
: Avoid the repeatedchmod
at runtime
init.sh
is already copied with the correct mode in the Dockerfile (RUN chmod +x …
).
Touching it again on every container start:
- Wastes a layer-cache hit by updating the mtime.
- Fails when the filesystem is mounted read-only / non-root.
You can safely drop these two lines.
-# Ensure init script is executable -chmod +x /usr/local/bin/init.sh
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/docker.yml
(1 hunks)docker/entrypoint.sh
(1 hunks)docker/frankenphp/Dockerfile
(1 hunks)docker/init.sh
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- docker/frankenphp/Dockerfile
- docker/init.sh
- .github/workflows/docker.yml
⏰ 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). (5)
- GitHub Check: codeception / PHP 8.4-windows-latest
- GitHub Check: codeception / PHP 8.3-windows-latest
- GitHub Check: codeception / PHP 8.2-windows-latest
- GitHub Check: test-frankenphp
- GitHub Check: test-frankenphp
…d execution flow.
…nd ensure entrypoint is set.
Summary by CodeRabbit