-
Notifications
You must be signed in to change notification settings - Fork 1
chore: update metadata match relationship #35
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
Conversation
|
Warning Rate limit exceeded@adityachoudhari26 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 23 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 (10)
WalkthroughThis change removes the ability to create release channels and deployment version channels from the CLI and API client. All related command files, flags, and API client methods are deleted or refactored. Additionally, resource relationship metadata matching is restructured to use explicit key mappings, and new API support for listing deployment versions and pinning/unpinning release targets is introduced. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant API Client
User->>CLI: Create Environment (without release/deployment version channels)
CLI->>API Client: Send environment creation request (no channel fields)
API Client-->>CLI: Return API response
sequenceDiagram
participant User
participant CLI
participant API Client
User->>CLI: Apply Resource Relationship (with metadata key mapping)
CLI->>API Client: Send relationship request (explicit SourceKey/TargetKey mapping)
API Client-->>CLI: Return API response
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
cmd/ctrlc/root/api/create/create.go(0 hunks)cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go(0 hunks)cmd/ctrlc/root/api/create/environment/environment.go(0 hunks)cmd/ctrlc/root/api/create/releasechannel/release-channel.go(0 hunks)cmd/ctrlc/root/apply/relationships.go(2 hunks)cmd/ctrlc/root/apply/types.go(1 hunks)internal/api/client.gen.go(57 hunks)
💤 Files with no reviewable changes (4)
- cmd/ctrlc/root/api/create/create.go
- cmd/ctrlc/root/api/create/deploymentversionchannel/deployment-version-channel.go
- cmd/ctrlc/root/api/create/releasechannel/release-channel.go
- cmd/ctrlc/root/api/create/environment/environment.go
🧰 Additional context used
🧬 Code Graph Analysis (2)
cmd/ctrlc/root/apply/relationships.go (2)
cmd/ctrlc/root/apply/types.go (2)
MetadataKeysMatch(110-114)ResourceRelationship(116-122)internal/api/client.gen.go (2)
CreateResourceRelationshipRule(178-197)ResourceRelationshipRuleDependencyType(681-681)
internal/api/client.gen.go (1)
cmd/ctrlc/root/apply/types.go (3)
Resource(89-97)DeploymentVariable(45-51)Deployment(58-67)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: docker (linux/amd64)
🔇 Additional comments (11)
cmd/ctrlc/root/apply/types.go (2)
110-114: Well-structured metadata matching enhancement.The new
MetadataKeysMatchstruct provides better flexibility for resource relationship metadata matching by supporting explicit key mappings. The optional pointer fields allow for different matching scenarios.
120-120: Approve the type change for enhanced metadata matching.The change from
[]stringto[]MetadataKeysMatchaligns with the improved metadata matching capabilities and the API client updates mentioned in the summary.cmd/ctrlc/root/apply/relationships.go (1)
75-78: Approve the updated metadata keys matching logic.The changes to use the new struct type and helper function are implemented correctly. The error handling and logging provide good visibility into any issues during the conversion process.
Also applies to: 115-131
internal/api/client.gen.go (8)
108-114: LGTM - Status constants for deployment version filteringThe new status constants are well-defined and consistent with other status enums in the codebase.
126-129: Status constants are complete and consistentThe
UpdateReleaseJSONBodyStatusconstants now include all four expected statuses, matching the pattern used in other status enums.
453-456: Good enhancement: Optional fields added to JobWithTriggerThe addition of optional
LinksandMetadatafields provides useful context without breaking backward compatibility.
663-666: Consistent application of MetadataKeysMatches structure changeThe restructuring of
MetadataKeysMatchesis consistently applied across all relationship rule types (Create, Read, Update). This maintains API consistency.Also applies to: 764-767
953-971: Well-structured API additionsThe new
ListDeploymentVersionsParamsprovides proper filtering capability for deployment versions, and the optionalDescriptionfield enhances environment creation.
1060-1075: Union type implementation for flexible release target pinningThe union type allows pinning by either
VersionIdorVersionTag, providing API flexibility. However, ensure proper marshaling/unmarshaling logic is implemented for this union type.Since this appears to be generated code, verify that the OpenAPI spec properly defines this as a discriminated union and that the code generator handles the marshaling/unmarshaling correctly.
2512-11563: Implementation of new API methods is complete and consistentThe client methods, request builders, and response parsers for the new deployment version listing and release target pinning/unpinning APIs are properly implemented following the established patterns in this generated code.
182-185: Breaking change:MetadataKeysMatchestype updated to source–target mappings- MetadataKeysMatches *[]string `json:"metadataKeysMatches,omitempty"` + MetadataKeysMatches *[]struct { + SourceKey string `json:"sourceKey"` + TargetKey string `json:"targetKey"` + } `json:"metadataKeysMatches,omitempty"`
- Location: internal/api/client.gen.go (lines 182–185)
This is a breaking API change—clients relying on the old
[]stringmust be updated to handle the new struct format. Please ensure all API consumers are notified and have migration plans in place.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores