Skip to content

Conversation

terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Sep 3, 2025

Q A
Is bugfix ✔️
New feature
Breaks BC

Summary by CodeRabbit

  • Documentation
    • Updated workflow badges to point to the apache branch and clarified CI status links.
  • Bug Fixes
    • Fixed incorrect workflow badge links and a step name typo in CI.
  • Chores
    • CI switched to Docker Compose v2 and now performs a loop-based readiness probe for more reliable startups.
    • PHP error logging enabled to emit to stderr.
    • Queue worker defaults adjusted: no autostart, single worker, graceful shutdown, and logs routed to stdout.

@terabytesoftw terabytesoftw added the bug Something isn't working label Sep 3, 2025
Copy link

coderabbitai bot commented Sep 3, 2025

Walkthrough

Replaces docker-compose v1 usage with Docker Compose v2 in CI, adds a loop-based readiness probe and diagnostic version checks in the GitHub Actions workflow, fixes a Codeception step name, updates README badge links, appends a changelog entry, enables PHP error logging to stderr, and tightens Supervisor queue startup/termination and logging settings.

Changes

Cohort / File(s) Summary of changes
CI workflow (Compose v2, readiness loop, Codeception step)
.github/workflows/build.yml
Use docker compose (v2) and show docker/docker compose versions; replace docker-compose commands; rename readiness step and replace fixed 30s sleep with looped in-container curl probe (2s intervals, up to 60 attempts) that succeeds on HTTP 200/302, dumps logs and fails on timeout; fix step name typo "Codeceptcion" → "Codeception" (command unchanged).
Documentation updates
CHANGELOG.md, README.md
Add changelog entry for Docker commands and badge updates; update README badge and workflow links to include ?query=branch%3Aapache branch filter.
PHP runtime logging
docker/php/php.ini
Enable log_errors = On and set error_log = /proc/self/fd/2 to route PHP errors to stderr.
Supervisor queue config
docker/supervisor/conf.d/queue.conf
Set autostart=false; reduce numprocs to 1; add stopasgroup=true, killasgroup=true, stopsignal=TERM; route stdout to /dev/stdout and remove previous stdout maxbytes setting.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GA as GitHub Actions
  participant DE as Docker Engine
  participant C as Container (service)
  participant H as Health Probe (curl)

  GA->>DE: docker compose up -d --build
  DE-->>GA: Containers started

  rect rgba(200,230,255,0.25)
    note right of GA: Readiness loop (max 60 × 2s)
    loop until 200/302 or timeout
      GA->>C: docker exec ... curl https://localhost -s -o /dev/null -w "%{http_code}"
      C-->>GA: HTTP status (200/302 or other)
    end
  end

  alt success (200/302)
    GA-->>GA: "Service is ready" (exit 0)
  else timeout
    GA->>DE: docker compose logs
    DE-->>GA: Container logs
    GA-->>GA: "Service not ready" (exit 1)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I tapped my paws — compose v2 in tow,
I curl for health in the warm server glow.
Errors to stderr, queues start with care,
Badges point true to Apache’s branch there.
Thump-thump — build ready, hop! 🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-mini-76

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@terabytesoftw
Copy link
Member Author

@coderabbitai review

Copy link

coderabbitai bot commented Sep 3, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Caution

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

⚠️ Outside diff range comments (1)
README.md (1)

72-74: Update to Docker Compose v2 syntax.

Docs still show docker-compose v1. Please switch to docker compose to match the workflow and modern Docker.

- docker-compose up -d
+ docker compose up -d
🧹 Nitpick comments (4)
docker/php/php.ini (1)

5-6: Good move: route PHP errors to stderr for container logging.

This aligns logs with Docker’s stdout/stderr streams. Consider optionally setting log_errors_max_len = 16384 to avoid truncation in verbose traces.

 log_errors = On
 error_log = /proc/self/fd/2
+log_errors_max_len = 16384
README.md (1)

139-141: Optional: align PHPStan badge link with branch-filtered pattern.

For consistency with the top badges, add the branch query to the link target.

-[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
+[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml?query=branch%3Aapache)
docker/supervisor/conf.d/queue.conf (1)

5-11: Queue autostart off + sane signals: good defaults for optional component.

This avoids starting a missing queue and ensures group termination. Consider adding a graceful stop window.

 stopasgroup=true
 killasgroup=true
 stopsignal=TERM
+stopwaitsecs=30
.github/workflows/build.yml (1)

45-46: Fix typo in step name.

“Codeceptcion” → “Codeception”.

-      - name: Codeceptcion build.
+      - name: Codeception build.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 93af7cb and e4d57b5.

📒 Files selected for processing (5)
  • .github/workflows/build.yml (1 hunks)
  • CHANGELOG.md (1 hunks)
  • README.md (1 hunks)
  • docker/php/php.ini (1 hunks)
  • docker/supervisor/conf.d/queue.conf (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-08-31T15:34:39.060Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#142
File: README.md:0-0
Timestamp: 2025-08-31T15:34:39.060Z
Learning: In yii2-extensions/app-basic project, the dev-road-runner branch is treated as the main configuration branch with no stable releases available. Static badges pointing to dev branches are intentionally used to direct users to the development version.

Applied to files:

  • README.md
📚 Learning: 2025-07-09T14:52:41.210Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#97
File: docs/installation.md:5-8
Timestamp: 2025-07-09T14:52:41.210Z
Learning: The Yii2 framework has multiple active branches including the 2.0.x branch (maintenance/LTS) and the 22.0 branch (development). When specifying version requirements, "2.0.53+ or 22.x" is accurate and should not be changed to only reference the 2.x branch.

Applied to files:

  • README.md
📚 Learning: 2025-09-02T15:21:03.184Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#170
File: docker/apache/Dockerfile:27-35
Timestamp: 2025-09-02T15:21:03.184Z
Learning: In yii2-extensions/app-basic, this is a demo template where simplicity and ease of use are prioritized over production-grade security hardening. Security trade-offs like using curl | bash for Node.js installation are acceptable for demonstration purposes.

Applied to files:

  • README.md
📚 Learning: 2025-09-02T15:23:37.606Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#170
File: docker/init.sh:26-49
Timestamp: 2025-09-02T15:23:37.606Z
Learning: The yii2-extensions/app-basic repository is a demo template where practical functionality and ease of setup take priority over security hardening measures.

Applied to files:

  • README.md
📚 Learning: 2025-09-02T09:36:57.071Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#166
File: .github/workflows/build.yml:31-33
Timestamp: 2025-09-02T09:36:57.071Z
Learning: The yii2-extensions/app-basic repository is a demo template that includes pre-generated SSL certificates using mkcert, designed to provide a "one-click" transparent demo experience for users.

Applied to files:

  • README.md
📚 Learning: 2025-09-02T15:20:17.088Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#170
File: config/web/modules.php:14-15
Timestamp: 2025-09-02T15:20:17.088Z
Learning: In the yii2-extensions/app-basic repository, this is a demo template where permissive development settings like allowedIPs => ['*'] for debug and gii modules are acceptable for ease of setup and demonstration purposes.

Applied to files:

  • README.md
📚 Learning: 2025-09-02T15:23:30.902Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#170
File: docker/init.sh:1-1
Timestamp: 2025-09-02T15:23:30.902Z
Learning: In yii2-extensions/app-basic repository, the maintainer terabytesoftw prefers to keep demo template scripts simple without additional bash safety measures like strict mode (set -Eeuo pipefail), as they consider different quality standards appropriate for demo/template code versus production code.

Applied to files:

  • README.md
📚 Learning: 2025-07-10T13:59:10.839Z
Learnt from: terabytesoftw
PR: yii2-extensions/app-basic#102
File: docker/apache/Dockerfile:0-0
Timestamp: 2025-07-10T13:59:10.839Z
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.

Applied to files:

  • docker/supervisor/conf.d/queue.conf
🔇 Additional comments (6)
CHANGELOG.md (1)

20-20: Changelog entry looks correct.

Entry matches PR scope and version section. No further action needed.

README.md (1)

18-23: Badge links correctly filter workflow runs by branch.

Nice improvement for clarity when viewing status for apache branch.

docker/supervisor/conf.d/queue.conf (1)

14-15: Log to stdout with no rotation cap: LGTM.

Matches container log collection best practices.

.github/workflows/build.yml (3)

28-31: Compose v2 detection step is helpful.

Showing Docker and Compose versions simplifies CI debugging.


34-34: Compose v2 migration: LGTM.

docker compose up -d --build is the right call here.


36-44: Container name matches configuration
Confirmed container_name: yii2-apache in docker-compose.yml; the readiness loop will target the correct container.

@terabytesoftw
Copy link
Member Author

@coderabbitai review

Copy link

coderabbitai bot commented Sep 3, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 (3)
.github/workflows/build.yml (3)

28-31: Compose v2 detection is fine; add a quick guard and make shell explicit.

Minor hardening so failures are clearer on runners without the Compose plugin.

-      - name: Show docker version.
-        run: |
-          docker version
-          docker compose version
+      - name: Show docker version.
+        shell: bash
+        run: |
+          docker version
+          if ! docker compose version; then
+            echo "Docker Compose v2 not available"; docker plugin ls || true; exit 1
+          fi

34-34: Pull latest base images during build to avoid stale caches.

Keeps CI green when upstream bases get security fixes.

-        run: docker compose up -d --build
+        run: docker compose up -d --build --pull always

36-44: Make the readiness probe resilient: container naming, scheme, and timing.

Two potential flakiness sources: relying on a fixed container name and assuming HTTPS inside the container. Use the service’s container ID from Compose, try HTTP then HTTPS, and give a bit more time.

-      - name: Wait for readiness.
-        run: |
-          for i in {1..60}; do
-            if docker exec yii2-apache sh -lc "curl -ksS -o /dev/null -w '%{http_code}' https://localhost | grep -qE '200|302'"; then
-              echo "Service is ready"; exit 0; fi
-            sleep 2
-          done
-          echo "Service not ready"; docker logs yii2-apache; exit 1
+      - name: Wait for readiness.
+        shell: bash
+        run: |
+          CID="$(docker compose ps -q yii2-apache)"
+          if [[ -z "$CID" ]]; then
+            echo "Container for service 'yii2-apache' not found."
+            docker compose ps
+            exit 1
+          fi
+          for i in {1..90}; do
+            if docker exec "$CID" sh -lc "for u in http://localhost https://localhost; do code=\$(curl -ksS -o /dev/null -w '%{http_code}' \"\$u\" || true); case \$code in 200|302) exit 0;; esac; done; exit 1"; then
+              echo 'Service is ready'; exit 0
+            fi
+            sleep 2
+          done
+          echo 'Service not ready'
+          docker compose logs yii2-apache || true
+          exit 1

Verification requested:

  • Confirm the service inside the container actually listens on HTTP or HTTPS localhost.
  • Confirm the Compose service name is yii2-apache; if it differs, adjust the service key used in docker compose ps -q.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e4d57b5 and ad6afd1.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (1 hunks)
  • README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md
🔇 Additional comments (1)
.github/workflows/build.yml (1)

45-46: Typo fix in step name looks good.

No functional change; improves readability.

@terabytesoftw terabytesoftw merged commit 85b26f5 into apache Sep 3, 2025
11 checks passed
@terabytesoftw terabytesoftw deleted the fix-mini-76 branch September 3, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant