Add integration-smoke workflow.#72
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughAdds a Docker Compose stack (Postgres, Redis, Weblate with plugin), Dockerfile overlay, bash orchestration and lifecycle scripts, integration test helpers and pytest fixtures, a P0 smoke test suite exercising plugin import and endpoints, and a GitHub Actions workflow to run the smoke tests and collect logs on failure. ChangesIntegration Testing Stack
Sequence DiagramsequenceDiagram
participant GitHub as GitHub Actions
participant Smoke as integration-smoke.sh
participant StackLib as weblate-stack.sh
participant Compose as Docker Compose
participant Weblate as Weblate container
participant Pytest as pytest
participant Artifact as Artifact Upload
GitHub->>Smoke: workflow trigger
Smoke->>StackLib: call stack_build()
StackLib->>Compose: compose build (weblate image)
Compose-->>StackLib: image ready
Smoke->>StackLib: stack_up()
Compose-->>Weblate: containers started
Smoke->>StackLib: stack_wait_healthy()
StackLib->>Weblate: poll /healthz/ until 200
Weblate-->>StackLib: healthy
Smoke->>StackLib: stack_create_token(admin)
StackLib->>Weblate: exec python → create token
Weblate-->>Smoke: token (stdout)
Smoke->>Pytest: install & run tests/integration/test_smoke.py
Pytest->>Weblate: HTTP checks & container-exec assertions
Weblate-->>Pytest: responses
Pytest-->>Smoke: test results
Smoke->>StackLib: stack_logs() → /tmp/compose-logs.txt (on failure)
Smoke->>StackLib: stack_down()
GitHub->>Artifact: upload /tmp/compose-logs.txt (on failure)
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/integration-smoke.yml:
- Around line 18-29: Replace floating action refs with pinned commit SHAs and
explicitly disable checkout credential persistence: update the steps using
actions/checkout, actions/setup-python, and actions/upload-artifact to use their
corresponding commit SHA refs instead of `@v4/`@v5/@v4, and add
persist-credentials: false to the actions/checkout step (the step referencing
actions/checkout) so credentials are not persisted to the workspace; ensure the
Run integration smoke tests and Upload logs on failure steps continue to
reference the same action step names (Run integration smoke tests, Upload logs
on failure) when making these changes.
In `@docker/docker-compose.yml`:
- Around line 14-15: Replace the weak fallbacks for DB credentials with a
fail-closed approach: remove the hardcoded defaults in the docker-compose env
substitutions (e.g., change POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-weblate} to
require POSTGRES_PASSWORD without a default) or implement secure
generation/validation at startup; ensure the same change is applied to the other
occurrences noted (the admin/ weblate fallbacks around lines 45–50). Update
references to POSTGRES_PASSWORD (and any POSTGRES_USER/POSTGRES_DB defaults) so
the service fails fast when those env vars are not provided, or wire in a secure
random-secret generator in the container entrypoint to populate them instead.
In `@docker/Dockerfile.weblate-plugin`:
- Line 9: The Dockerfile currently uses the floating base image reference
"weblate/weblate:latest" in the FROM instruction; update that FROM line to pin
to a stable, reproducible tag or an exact sha256 digest (e.g., replace
"weblate/weblate:latest" with a specific version tag like
"weblate/weblate:<version>" or "weblate/weblate@sha256:<digest>"); obtain the
desired tag/digest from the official Weblate Docker Hub/GitHub release, update
the FROM reference in Dockerfile.weblate-plugin accordingly, and commit the
change so CI uses a fixed image.
In `@scripts/integration-smoke.sh`:
- Around line 15-21: The cleanup() function should be made best-effort by
disabling errexit at its start so teardown always runs: capture the original
exit code into local exit_code as-is, run set +e (or otherwise disable -e)
before calling stack_logs and stack_down so failures there don't abort the rest
of cleanup, ensure both stack_logs and stack_down are executed even if one
fails, and finally exit with the preserved exit_code; reference the cleanup
function and the stack_logs and stack_down calls when making this change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1b21d530-fc3e-4d4d-9618-39d7e85f2159
📒 Files selected for processing (15)
.github/workflows/integration-smoke.ymldocker/Dockerfile.weblate-plugindocker/README.mddocker/docker-compose.ymlpyproject.tomlscripts/README.mdscripts/integration-smoke.shscripts/lib/compose.shscripts/lib/weblate-stack.shtests/integration/__init__.pytests/integration/conftest.pytests/integration/lib/__init__.pytests/integration/lib/docker_exec.pytests/integration/lib/http.pytests/integration/test_smoke.py
|
@CodeRabbit, resume |
|
✅ Actions performedReviews resumed. |
|
@CodeRabbit, resume |
|
✅ Actions performedReviews resumed. |
Close #55.
Close #56.
Close #57.
Close #58.
Summary by CodeRabbit
Documentation
Tests
Chores