-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix: locally #646
fix: locally #646
Conversation
WalkthroughThe pull request introduces modifications to the Earthfile, focusing on restructuring the build and deployment processes. The key changes involve shifting the build context from a local build to using a Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
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: 0
🔭 Outside diff range comments (1)
Earthfile (1)
Line range hint
67-86
: Security concerns in database schema export.There are several security considerations in the export-database-schema stage:
- Running PostgreSQL with root user credentials
- Using host network mode
- Hardcoded credentials in connection strings
Consider:
- Using a non-root user for PostgreSQL
- Using Docker networks instead of host networking
- Using environment variables for sensitive credentials
Example improvement:
- RUN docker run -d --rm -e POSTGRES_USER=root -e POSTGRES_PASSWORD=root -e POSTGRES_DB=formance --net=host postgres:15-alpine + RUN docker network create schema-export && \ + docker run -d --rm \ + -e POSTGRES_USER=schema_user \ + -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD \ + -e POSTGRES_DB=formance \ + --network schema-export \ + --name pg-server \ + postgres:15-alpine
🧹 Nitpick comments (1)
Earthfile (1)
Line range hint
8-21
: Consider optimizing the sources stage for better performance.The sources stage is well structured, but consider using
.dockerignore
or more specific COPY commands to minimize the build context size and improve performance.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Earthfile
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Tests
🔇 Additional comments (2)
Earthfile (2)
26-26
: Great improvement in build reproducibility!Switching from local build context to the
+sources
stage ensures better reproducibility and dependency tracking.
Line range hint
44-51
: Verify deployment tag generation consistency.The deployment tag is generated based on the source directory hash. Ensure this approach:
- Produces consistent tags across different environments
- Handles all relevant files that should influence the tag
✅ Verification successful
Deployment tag generation is consistent and well-scoped
The current approach:
- Generates deterministic tags by hashing only the source code files
- Correctly includes all relevant runtime files (internal/, pkg/, cmd/, main.go)
- Appropriately excludes build artifacts and dependencies
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the consistency of deployment tags # Check if any important files might be missing from the hash calculation # List files considered for the hash find /src -type f -not -path "*/\.*" -exec sha1sum {} \; # Check for potentially important files that might be missed fd -t f -E .git -E .githubLength of output: 40534
Script:
#!/bin/bash # Check Earthfile content for build context cat Earthfile # Check Docker-related files cat build.DockerfileLength of output: 2897
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #646 +/- ##
==========================================
- Coverage 81.78% 81.65% -0.13%
==========================================
Files 131 131
Lines 7070 7070
==========================================
- Hits 5782 5773 -9
- Misses 987 993 +6
- Partials 301 304 +3 ☔ View full report in Codecov by Sentry. |
No description provided.