-
Notifications
You must be signed in to change notification settings - Fork 2
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(api): ensure head deployment retrieval for projects and workspaces #839
base: main
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@kasugamirai has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 50 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 (1)
WalkthroughThe pull request modifies how deployments are filtered and versioned. Both in-memory and Mongo implementations of the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Repository
participant DeploymentService
Client->>DeploymentService: Request deployment by project ID
DeploymentService->>Repository: Call FindByProject(projectID)
Repository-->>DeploymentService: Check if (d.Project != nil) && (d.Project == id) && (d.IsHead())
DeploymentService-->>Client: Return head deployment if exists
sequenceDiagram
participant Caller
participant Interactor
participant Repository
Caller->>Interactor: Create deployment (with or without project)
Interactor->>Repository: Check for existing head deployment
alt Head exists
Interactor->>Repository: Mark existing deployment as non-head
Interactor->>Interactor: Increment version
else No head exists
Interactor->>Interactor: Set version to "v1"
end
Interactor-->>Caller: Return new deployment as head
Possibly related PRs
Suggested reviewers
Poem
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
Documentation and Community
|
✅ Deploy Preview for reearth-flow canceled.
|
4bfdc9d
to
29cdc56
Compare
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: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
api/internal/infrastructure/memory/deployment.go
(1 hunks)api/internal/infrastructure/memory/deployment_test.go
(1 hunks)api/internal/infrastructure/mongo/deployment.go
(1 hunks)api/internal/usecase/interactor/deployment.go
(1 hunks)
🔇 Additional comments (3)
api/internal/infrastructure/memory/deployment_test.go (1)
27-27
: LGTM! Test updated to reflect head deployment changes.The test has been correctly updated to mark the deployment as head, which aligns with the new implementation.
api/internal/infrastructure/memory/deployment.go (1)
123-123
: LGTM! Head deployment filtering added.The
FindByProject
method now correctly filters for head deployments, ensuring consistent behavior with the MongoDB implementation.api/internal/infrastructure/mongo/deployment.go (1)
135-135
: LGTM! MongoDB query updated for head deployments.The MongoDB query now correctly filters for head deployments, ensuring consistent behavior with the memory implementation.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #839 +/- ##
==========================================
+ Coverage 25.56% 25.61% +0.04%
==========================================
Files 138 138
Lines 8073 8180 +107
==========================================
+ Hits 2064 2095 +31
- Misses 5806 5877 +71
- Partials 203 208 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Overview
What I've done
What I haven't done
How I tested
Screenshot
Which point I want you to review particularly
Memo
Summary by CodeRabbit
New Features
Tests