Skip to content

feat: add optional gRPC port to bifrost cluster deployment and service#3617

Open
BearTS wants to merge 1 commit into
05-20-chore_add_timeout_example_in_providers_yaml_filefrom
05-20-chore_expose_grpc_service_port_if_mentioned
Open

feat: add optional gRPC port to bifrost cluster deployment and service#3617
BearTS wants to merge 1 commit into
05-20-chore_add_timeout_example_in_providers_yaml_filefrom
05-20-chore_expose_grpc_service_port_if_mentioned

Conversation

@BearTS
Copy link
Copy Markdown
Contributor

@BearTS BearTS commented May 20, 2026

Summary

Adds optional gRPC port support to the Bifrost Helm chart, allowing the cluster to expose a gRPC endpoint when configured.

Changes

  • Added a conditional gRPC container port (TCP) to the deployment template, rendered only when bifrost.cluster.grpc is defined in values
  • Added a corresponding conditional gRPC service port to the service template, targeting the named grpc port

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Set the following in your Helm values and confirm the deployment and service include the gRPC port:

bifrost:
  cluster:
    grpc:
      port: 50051
helm template ./helm-charts/bifrost | grep -A 4 grpc

Expected output should include the grpc port entry in both the deployment container ports and the service spec.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

The gRPC port is only exposed when explicitly configured. No authentication or TLS is configured at the Helm chart level; ensure appropriate network policies or ingress controls are in place when enabling this port.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

Review Change Stack

Warning

Rate limit exceeded

@BearTS has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 52 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a008c591-bea6-4699-ae9e-ea188fd256f7

📥 Commits

Reviewing files that changed from the base of the PR and between de7044b and 55c8715.

📒 Files selected for processing (2)
  • helm-charts/bifrost/templates/deployment.yaml
  • helm-charts/bifrost/templates/service.yaml
📝 Walkthrough

Walkthrough

The PR conditionally exposes a gRPC TCP port when bifrost.cluster.grpc is enabled: the Deployment's container ports gains a grpc entry using bifrost.cluster.grpc.port, and the Service's spec.ports gains a matching named grpc port mapping to targetPort: grpc.

Changes

gRPC Port Exposure

Layer / File(s) Summary
gRPC Port Exposure
helm-charts/bifrost/templates/deployment.yaml, helm-charts/bifrost/templates/service.yaml
Deployment adds conditional gRPC container port using bifrost.cluster.grpc.port. Service adds matching conditional gRPC port mapping that routes to the grpc named targetPort. Both gated on the bifrost.cluster.grpc enabled flag.

🎯 2 (Simple) | ⏱️ ~8 minutes


I’m a rabbit in the charted land,
I nudged a grpc port with my hand,
When the flag is true, connections hum,
Pods and services greet the drum. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an optional gRPC port to the Bifrost Helm chart deployment and service, which aligns with the changeset.
Description check ✅ Passed The description covers Summary, Changes, Type of change, Affected areas, How to test, Breaking changes, Security considerations, and Checklist sections from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-20-chore_expose_grpc_service_port_if_mentioned

Comment @coderabbitai help to get the list of available commands and usage tips.

@BearTS BearTS force-pushed the 05-20-chore_add_timeout_example_in_providers_yaml_file branch from 06e985b to f4a7c96 Compare May 20, 2026 10:56
@BearTS BearTS force-pushed the 05-20-chore_expose_grpc_service_port_if_mentioned branch from 5405e4c to 36a1311 Compare May 20, 2026 10:56
@BearTS BearTS changed the title chore: expose grpc service port if mentioned feat: add optional gRPC port to bifrost cluster deployment and service May 20, 2026
@BearTS BearTS marked this pull request as ready for review May 20, 2026 10:58
@BearTS BearTS requested a review from a team as a code owner May 20, 2026 10:58
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Confidence Score: 5/5

The changes are additive, scoped to Helm templates, and consistent with the identical pattern already shipped in stateful.yaml and service-headless.yaml.

Both modified templates follow the same guard and naming conventions already established in the rest of the chart. The gRPC port is only rendered inside the existing cluster-enabled block, the targetPort reference correctly matches the named container port, and no existing ports are affected.

No files require special attention.

Important Files Changed

Filename Overview
helm-charts/bifrost/templates/deployment.yaml Adds conditional gRPC container port inside the cluster guard; mirrors the pattern already present in stateful.yaml. Port rendering is structurally correct but relies on a truthiness check that is always true with default values.
helm-charts/bifrost/templates/service.yaml Adds corresponding gRPC service port with correct named targetPort reference; same always-truthy guard caveat, and missing the optional appProtocol: grpc hint for service mesh awareness.

Reviews (3): Last reviewed commit: "chore: expose grpc service port if menti..." | Re-trigger Greptile

Comment thread helm-charts/bifrost/templates/deployment.yaml
Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (2)
helm-charts/bifrost/templates/deployment.yaml (1)

79-83: ⚡ Quick win

Consider validating that the port value exists.

The conditional checks if .Values.bifrost.cluster.grpc is truthy but then accesses .Values.bifrost.cluster.grpc.port without verifying the port field exists. If a user sets bifrost.cluster.grpc: {} or defines grpc configuration without the port field, the template will fail with an unclear error during rendering.

While this follows the existing pattern used for gossip ports (lines 73-78), consider one of these approaches for better user experience:

-{{- if .Values.bifrost.cluster.grpc }}
+{{- if .Values.bifrost.cluster.grpc.port }}

or with an explicit validation message:

-{{- if .Values.bifrost.cluster.grpc }}
 - name: grpc
-  containerPort: {{ .Values.bifrost.cluster.grpc.port }}
+  containerPort: {{ .Values.bifrost.cluster.grpc.port | required "bifrost.cluster.grpc.port is required when grpc is enabled" }}
   protocol: TCP
-{{- end }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm-charts/bifrost/templates/deployment.yaml` around lines 79 - 83, The
template currently checks .Values.bifrost.cluster.grpc but dereferences
.Values.bifrost.cluster.grpc.port which can be missing; update the deployment
template to validate that the port field exists (e.g., check both
.Values.bifrost.cluster.grpc and .Values.bifrost.cluster.grpc.port or use
default/required logic) before rendering the grpc containerPort, and provide a
clear error or fallback value if port is absent; locate the grpc block in the
deployment template (the conditional using .Values.bifrost.cluster.grpc and the
reference to .Values.bifrost.cluster.grpc.port) and adjust the conditional or
add a validation message so the template won’t fail when grpc is defined without
a port.
helm-charts/bifrost/templates/service.yaml (1)

28-33: ⚡ Quick win

Consider validating that the port value exists.

The conditional checks if .Values.bifrost.cluster.grpc is truthy but then accesses .Values.bifrost.cluster.grpc.port without verifying the port field exists. This mirrors the same concern in the deployment template and could lead to unclear template rendering errors if misconfigured.

For consistency with the deployment template fix, consider the same validation approach:

-{{- if .Values.bifrost.cluster.grpc }}
+{{- if .Values.bifrost.cluster.grpc.port }}

or with an explicit validation message:

-{{- if .Values.bifrost.cluster.grpc }}
-- port: {{ .Values.bifrost.cluster.grpc.port }}
+- port: {{ .Values.bifrost.cluster.grpc.port | required "bifrost.cluster.grpc.port is required when grpc is enabled" }}
   targetPort: grpc
   protocol: TCP
   name: grpc
-{{- end }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm-charts/bifrost/templates/service.yaml` around lines 28 - 33, The service
template uses .Values.bifrost.cluster.grpc.port without ensuring the port field
exists; update the conditional around the grpc port block in service.yaml to
only render when both .Values.bifrost.cluster.grpc and
.Values.bifrost.cluster.grpc.port are present (or explicitly fail with a clear
message), so the port/targetPort/name grpc stanza is omitted or validated if
port is missing; target the .Values.bifrost.cluster.grpc and
.Values.bifrost.cluster.grpc.port symbols and the grpc port block when making
the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@helm-charts/bifrost/templates/deployment.yaml`:
- Around line 79-83: The template currently checks .Values.bifrost.cluster.grpc
but dereferences .Values.bifrost.cluster.grpc.port which can be missing; update
the deployment template to validate that the port field exists (e.g., check both
.Values.bifrost.cluster.grpc and .Values.bifrost.cluster.grpc.port or use
default/required logic) before rendering the grpc containerPort, and provide a
clear error or fallback value if port is absent; locate the grpc block in the
deployment template (the conditional using .Values.bifrost.cluster.grpc and the
reference to .Values.bifrost.cluster.grpc.port) and adjust the conditional or
add a validation message so the template won’t fail when grpc is defined without
a port.

In `@helm-charts/bifrost/templates/service.yaml`:
- Around line 28-33: The service template uses .Values.bifrost.cluster.grpc.port
without ensuring the port field exists; update the conditional around the grpc
port block in service.yaml to only render when both .Values.bifrost.cluster.grpc
and .Values.bifrost.cluster.grpc.port are present (or explicitly fail with a
clear message), so the port/targetPort/name grpc stanza is omitted or validated
if port is missing; target the .Values.bifrost.cluster.grpc and
.Values.bifrost.cluster.grpc.port symbols and the grpc port block when making
the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e4c5f43c-5a7b-40d6-9e52-721e99a93b1c

📥 Commits

Reviewing files that changed from the base of the PR and between f4a7c96 and 36a1311.

📒 Files selected for processing (2)
  • helm-charts/bifrost/templates/deployment.yaml
  • helm-charts/bifrost/templates/service.yaml

Copy link
Copy Markdown
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm-charts/bifrost/templates/deployment.yaml`:
- Around line 79-82: The template uses .Values.bifrost.cluster.grpc.port without
ensuring it exists; update the deployment template so that when
.Values.bifrost.cluster.grpc is truthy you require the port value (use Helm's
required function or an explicit check) before rendering the containerPort
stanza; specifically, guard or replace references to
.Values.bifrost.cluster.grpc.port (the grpc port lookup) with a
required("bifrost.cluster.grpc.port is required when bifrost.cluster.grpc is
configured", .Values.bifrost.cluster.grpc.port) call or an if/else that throws a
clear error so Helm fails fast with a meaningful message instead of producing an
invalid manifest.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ac42691-fc86-4301-ad34-fd72b5e8915e

📥 Commits

Reviewing files that changed from the base of the PR and between 36a1311 and de7044b.

📒 Files selected for processing (2)
  • helm-charts/bifrost/templates/deployment.yaml
  • helm-charts/bifrost/templates/service.yaml
✅ Files skipped from review due to trivial changes (1)
  • helm-charts/bifrost/templates/service.yaml

Comment thread helm-charts/bifrost/templates/deployment.yaml
@BearTS BearTS force-pushed the 05-20-chore_add_timeout_example_in_providers_yaml_file branch from 0c421c0 to d7856f0 Compare May 20, 2026 12:04
@BearTS BearTS force-pushed the 05-20-chore_expose_grpc_service_port_if_mentioned branch from de7044b to 55c8715 Compare May 20, 2026 12:04
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.

1 participant