Repository navigation
feat(ci): implement a CI/CD Pipeline - #1850
balazs-szucs wants to merge 23 commits into
Conversation
…implement loading and toast services with tests Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
|
This all sounds great and the direction makes a lot of sense 👍 Do you think it would be possible to break this down into smaller, incremental PRs, for example, introducing one or two workflows at a time? That would make review, feedback, and iteration much easier, and reduce the risk of subtle issues slipping through. Happy to re-review once it’s split up, and thanks for putting in the effort on this, it’s clearly a substantial contribution. |
…d workflows Standardized status output to Title Case (Pass, Fail, Skipped) across advanced-testing-suite, integration-contract-tests, and security-enhanced workflows. Moved workflows from booklore-api/.github/workflows to root .github/workflows for better organization.
| VOLUME /tmp | ||
| ARG JAR_FILE=build/libs/*.jar | ||
| COPY ${JAR_FILE} app.jar | ||
| ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] |
Check failure
Code scanning / Semgrep OSS
Semgrep Finding: dockerfile.security.missing-user-entrypoint.missing-user-entrypoint
Add a non-root user 'booklore' to the booklore-api/testing/Dockerfile to mitigate the 'missing-user-entrypoint' Semgrep security finding. The application now runs as a dedicated non-root user, enhancing container security.
# Conflicts: # .github/workflows/docker-build-publish.yml # booklore-api/build.gradle
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Updated concurrency, large-upload, and chaos test workflows to use the project root as the Docker build context. This resolves build failures where the multi-stage Dockerfile could not access 'booklore-api' and 'booklore-ui' directories.
Updated concurrency, large-upload, and chaos test workflows to use the main project Dockerfile as requested. Implemented log capture and artifact upload for the booklore-app container when it fails to become healthy within the timeout period, aiding in debugging startup issues.
…check Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…imeout for health check Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…nd application containers Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…in test workflows Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…t workflows Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
… workflows Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…and authentication Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…ness check and enhanced login response handling Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…d hashing Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…and application log verification Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…and application log verification Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
…rification and extended wait times Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Sorry for the late response (I totally forgot! 😅). I am currently in the process of decoupling the workflows from each other. The current plan is to introduce the workflows in the following order:
For more detailed info see the table from the PR message. Obviously, this PR aims to be similar what I envision as the overall structure. I am also in favor of making the changes gradually. I just got a bit overzealous with this (which admittedly happens) and didn't realize I should stop to get feedback until, well, we got here.
Thanks 😄 |
…g, link checking, and database migration integrity Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
# Conflicts: # .github/workflows/docker-build-publish.yml
🚀 Pull Request
📝 Description
This PR introduces a complete CI/CD pipeline using GitHub Actions (GHA). It covers build automation, extensive testing, security scanning, and deployment processes.
🛠️ Changes Made
What's Included
Key Workflows###Core CI/CD
ci-comprehensive.yml: A multi-stage pipeline that runs different steps based on which files changed.build.yml: Validates builds for the Frontend (Angular) and Backend (Java/Gradle).type-checking.yml: Checks TypeScript types and runs a production build.Database Quality
db-migration-check.yml: Checks migration integrity, checksums, and SQL syntax.db-migration-regression.yml: Tests all migration paths, including fresh installs and upgrades.db-migration-full.yml: runs a full matrix of tests from a baseline.Advanced Testing
load-performance-tests.yml: Tests performance with 10k-50k books; requires P95 response times under 5 seconds.corpus-of-doom-tests.yml: Checks how the system handles malformed EPUBs and corrupted files.arm64-qemu-tests.yml: Tests compatibility with ARM64 devices like Raspberry Pi.reverse-proxy-tests.yml: Validates deployment behind Nginx, Traefik, and Caddy.docker-persistence-test.yml: Verifies that data remains after a container restarts.API & Integration
api-tests.yml: Validates Swagger/OpenAPI endpoints.integration-contract-tests.yml: Tests integrations with Kobo API, OPDS, and Calibre.wiremock-protocol-tests.yml: Tests specific protocol edge cases.Security
security-enhanced.yml: Checks dependencies (OWASP), leaks (Gitleaks), and code issues (Semgrep, Trivy).codeql-analysis.yml: Runs advanced GitHub CodeQL analysis.security.yml: Basic secret scanning and SAST.Automation
auto-labeler.yml: Labels PRs automatically based on file size and type.manual-gatekeeper.yml: Allows manual execution of all workflows.test-coverage.yml: Reports code coverage using JaCoCo (backend) and Karma (frontend).eink-visual-regression.yml: Tests for E-Ink visual regressions (currently disabled).Testing Infrastructure
testing/docker-integration-test.sh: A script for Docker integration testing (386 lines).testing/swagger_endpoint_test.py: A Python suite for API testing (1052 lines).testing/playwright/: A framework for E-Ink visual regression tests.scripts/check-migration-integrity.sh: A shell script to validate migrations.Configuration
.github/labeler.yml: Configures the auto-labeler..github/dependabot.yml: Automates dependency updates..github/owasp-suppressions.xml: Manages false positives in security scans..github/actions/java-gradle-setup/: A reusable action for Java/Gradle setup..dockerignore: Optimized the Docker build context.Code Quality
FlywayMigrationIntegrationTest.java.build.gradleto include Flyway and JaCoCo.Weekly Schedule
Security Hardening
step-security/harden-runner.Caching and Concurrency
Testing Coverage & Quality Metrics
Quality Standards
Success Criteria
PR Workflows Pass When:
Advanced Tests Pass When:
Deleted Files
.github/workflows/docker-build-publish.yml(Replaced by new workflows)Benefits
Mirror PR: https://github.com/balazs-szucs/booklore/pull/63
🧪 Testing
📸 Visual Changes (if applicable)
✅ Pre-submission Checklist
./gradlew testfor backend)developbranch💬 Additional Notes (optional)