Skip to content

feat: devenvs #135

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

Merged
merged 1 commit into from
Jul 1, 2025
Merged

feat: devenvs #135

merged 1 commit into from
Jul 1, 2025

Conversation

gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Jun 26, 2025

No description provided.

@gfyrag gfyrag requested a review from a team as a code owner June 26, 2025 11:11
Copy link

coderabbitai bot commented Jun 26, 2025

Warning

Rate limit exceeded

@gfyrag has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between fda1316 and 4413d56.

⛔ Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
📒 Files selected for processing (2)
  • Earthfile (3 hunks)
  • internal/membership_listener.go (1 hunks)

Walkthrough

The Earthfile was updated to replace a fixed core image import with a parameterized argument, allowing dynamic image selection. The deploy target now requires a REPOSITORY argument and supports conditional Helm configuration based on a new FORMANCE_DEV_CLUSTER_V2 argument, adjusting Helm upgrade parameters and namespace accordingly.

Changes

File(s) Change Summary
Earthfile Replaced fixed core image import with parameter; added REPOSITORY and FORMANCE_DEV_CLUSTER_V2 args; updated Helm upgrade logic and namespace; conditional Helm set parameters based on cluster type.

Poem

A rabbit hops through Earthly fields,
Where arguments now yield new shields.
Helm commands adapt and grow,
Dev clusters get a special flow.
With REPOSITORY set just right,
Deployments leap—oh, what a sight!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch feat/devenvs

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (2)
Earthfile (2)

118-128: Simplify the conditional argument building logic.

The current approach of string concatenation for ADDITIONAL_ARGS works but could be more maintainable. Consider using arrays or a more structured approach for building Helm arguments.

Alternative approach using multiple SET commands:

-    LET ADDITIONAL_ARGS=""
     ARG FORMANCE_DEV_CLUSTER_V2=no
+    LET HELM_ARGS=""
     IF [ "$FORMANCE_DEV_CLUSTER_V2" == "yes" ]
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set imagePullSecrets[0].name=zot"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.address=membership.formance.svc.cluster.local:8082"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.tls.enabled=false"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.traces.endpoint=otel-shared-admin.default.svc.cluster.local"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.metrics.endpoint=otel-shared-admin.default.svc.cluster.local"
+        SET HELM_ARGS="--set imagePullSecrets[0].name=zot --set server.address=membership.formance.svc.cluster.local:8082 --set server.tls.enabled=false --set global.monitoring.traces.endpoint=otel-shared-admin.default.svc.cluster.local --set global.monitoring.metrics.endpoint=otel-shared-admin.default.svc.cluster.local"
     ELSE
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.address=$user.$tld:443"
+        SET HELM_ARGS="--set server.address=$user.$tld:443"
     END

122-125: Consider externalizing hardcoded service addresses.

The internal service addresses are hardcoded in the conditional block. Consider making these configurable through arguments or environment variables for better flexibility across different environments.

+    ARG MEMBERSHIP_SERVICE=membership.formance.svc.cluster.local:8082
+    ARG OTEL_ENDPOINT=otel-shared-admin.default.svc.cluster.local
     IF [ "$FORMANCE_DEV_CLUSTER_V2" == "yes" ]
         SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set imagePullSecrets[0].name=zot"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.address=membership.formance.svc.cluster.local:8082"
+        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.address=$MEMBERSHIP_SERVICE"
         SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set server.tls.enabled=false"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.traces.endpoint=otel-shared-admin.default.svc.cluster.local"
-        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.metrics.endpoint=otel-shared-admin.default.svc.cluster.local"
+        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.traces.endpoint=$OTEL_ENDPOINT"
+        SET ADDITIONAL_ARGS="$ADDITIONAL_ARGS --set global.monitoring.metrics.endpoint=$OTEL_ENDPOINT"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 990ca87 and fda1316.

📒 Files selected for processing (1)
  • Earthfile (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Dirty
🔇 Additional comments (4)
Earthfile (4)

3-4: LGTM: Good parameterization of core image.

The change from a fixed import to a parameterized ARG core allows for flexible core image version selection while maintaining a sensible default. This improves maintainability and deployment flexibility.


134-137: LGTM: Proper use of dynamic repository and arguments.

The helm upgrade command correctly incorporates the new REPOSITORY argument and ADDITIONAL_ARGS, maintaining proper syntax and functionality.


129-129: Verify the namespace change impact.

The namespace changed from formance-system to formance. Ensure this change is intentional and won't break existing deployments or cause conflicts with existing resources.

#!/bin/bash
# Description: Check for references to the old namespace to ensure consistency
# Expected: All references should be updated or the change should be documented

# Search for references to the old namespace
rg -i "formance-system"

# Search for other helm/kubectl commands that might reference namespaces
rg -A 3 -B 3 "namespace.*formance"

117-117: Verify all callers provide the REPOSITORY argument.

The new required REPOSITORY argument improves configurability, but ensure all existing deploy target invocations are updated to provide this argument.

#!/bin/bash
# Description: Search for deploy target usage to verify REPOSITORY argument is provided
# Expected: All deploy target calls should include REPOSITORY argument

# Search for deploy target invocations
rg -A 10 -B 5 "BUILD.*\+deploy" 

# Search for any earthly command that might call deploy
rg -A 5 -B 5 "earthly.*deploy"

@gfyrag gfyrag force-pushed the feat/devenvs branch 4 times, most recently from 055fe4d to 4c2696b Compare July 1, 2025 11:12
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Refactoring Changes TLS Behavior in Stargate Spec

The refactoring of the Stargate spec's TLS configuration changed its behavior. Previously, the tls field was omitted from the spec when DisableTLS was false (implying default TLS settings). Now, an empty tls: {} object is always included in the spec in this scenario. This alters the API contract, as downstream systems may interpret an empty tls object differently from a missing tls field, potentially causing unintended TLS behavior.

internal/membership_listener.go#L274-L292

tlsSpec := map[string]any{}
if membershipStack.StargateConfig.DisableTLS {
tlsSpec["disable"] = true
}
if _, err := c.createOrUpdateStackDependency(ctx, stack.GetName(), stack.GetName(), stack, v1beta1.GroupVersion.WithKind("Stargate"), map[string]any{
"metadata": metadata,
"spec": map[string]any{
"organizationID": parts[0],
"stackID": parts[1],
"serverURL": membershipStack.StargateConfig.Url,
"auth": map[string]any{
"issuer": membershipStack.AuthConfig.Issuer,
"clientID": membershipStack.AuthConfig.ClientId,
"clientSecret": membershipStack.AuthConfig.ClientSecret,
},
"tls": tlsSpec,
},

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

@gfyrag gfyrag merged commit baed701 into main Jul 1, 2025
7 checks passed
@gfyrag gfyrag deleted the feat/devenvs branch July 1, 2025 11:25
This was referenced Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants