Skip to content

feat: add optional project_id field to Bedrock and Bedrock Mantle key configs - #5134

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
07-13-feat_project_id_support_for_ui
Jul 13, 2026
Merged

feat: add optional project_id field to Bedrock and Bedrock Mantle key configs#5134
Pratham-Mishra04 merged 1 commit into
devfrom
07-13-feat_project_id_support_for_ui

Conversation

@impoiler

@impoiler impoiler commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional project_id field to both BedrockKeyConfig and BedrockMantleKeyConfig, allowing users to scope Bedrock Mantle-routed models (OpenAI-family / Gemma) to a specific project via the OpenAI-Project / anthropic-workspace-id header. When left empty, the account's default project is used.

Changes

  • Added project_id as an optional SecretVar field to BedrockKeyConfig and BedrockMantleKeyConfig types and their corresponding defaults.
  • Extended the Zod validation schemas (bedrockKeyConfigSchema, bedrockMantleKeyConfigSchema, BedrockKeyConfigSchema, BedrockMantleKeyConfigSchema) to include the optional project_id field.
  • Added UI form fields for project_id in both the Bedrock and Bedrock Mantle provider configuration sections, accepting a project ID or an environment variable reference (e.g., proj_xxxxxxxx or env.BEDROCK_PROJECT_ID).

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

  1. Navigate to the Bedrock or Bedrock Mantle provider configuration in the workspace settings.
  2. Verify the new Mantle Project ID (Optional) / Project ID (Optional) field appears in the form.
  3. Enter a project ID (e.g., proj_xxxxxxxx) or an environment variable reference (e.g., env.BEDROCK_PROJECT_ID) and save.
  4. Confirm the value is persisted and sent correctly when routing requests to Mantle-backed models.
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Add before/after screenshots of the Bedrock and Bedrock Mantle provider configuration forms showing the new Project ID field.

Breaking changes

  • No

Related issues

Security considerations

The project_id field is handled as a SecretVar, consistent with other sensitive Bedrock configuration values, supporting both inline values and environment variable references.

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

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a508b68-a09c-4df4-8142-5c446b17fd80

📥 Commits

Reviewing files that changed from the base of the PR and between fa238f8 and 4c1b66a.

📒 Files selected for processing (4)
  • ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
  • ui/lib/schemas/providerForm.ts
  • ui/lib/types/config.ts
  • ui/lib/types/schemas.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added optional Project ID fields to Bedrock and Bedrock Mantle provider credentials.
    • Project IDs support request scoping through provider-specific headers and environment-backed values.
    • Added input guidance and validation for Project ID formats.
  • Documentation

    • Clarified when to enable Vertex’s “Force single region” setting for provisioned-throughput deployments.

Walkthrough

Bedrock and Bedrock Mantle key configurations now support optional project IDs across UI fields, validation schemas, TypeScript types, defaults, and secret-variable schemas. Vertex single-region guidance was also reworded.

Changes

Bedrock project ID configuration

Layer / File(s) Summary
Project ID configuration contracts
ui/lib/schemas/providerForm.ts, ui/lib/types/config.ts, ui/lib/types/schemas.ts
Bedrock and Bedrock Mantle schemas, interfaces, defaults, and secret-variable schemas now include optional project_id values. Empty request type formatting was also normalized.
Provider key form fields
ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx
Bedrock and Bedrock Mantle sections now render optional project ID inputs with descriptions, placeholders, and validation messages; Vertex single-region guidance was reformatted and expanded.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SecretVarInput
  participant ProviderFormSchema
  participant BedrockKeyConfig
  SecretVarInput->>ProviderFormSchema: Submit optional project_id
  ProviderFormSchema->>BedrockKeyConfig: Validate project_id
Loading

Possibly related PRs

  • maximhq/bifrost#4737: Adds related Bedrock Mantle project configuration in UI and schema areas.
  • maximhq/bifrost#4886: Updates backend handling of BedrockMantleKeyConfig, connecting to this data-model change.

Suggested reviewers: akshaydeo, danpiths, roroghost17, tejasghatte

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is concise and accurately describes the main change: adding optional project_id fields to Bedrock configs.
Description check ✅ Passed The PR description covers summary, changes, testing, type, affected areas, breaking changes, security, and checklist; only related issues is empty.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-13-feat_project_id_support_for_ui

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

@impoiler
impoiler force-pushed the 07-13-feat_project_id_support_for_ui branch 2 times, most recently from 907213d to fa238f8 Compare July 13, 2026 09:19
@impoiler
impoiler force-pushed the 07-13-feat_project_id_support_for_bedrock_provider branch from 2592af4 to e4118c0 Compare July 13, 2026 09:19
@impoiler impoiler changed the title feat: project id support for UI feat: add optional project_id field to Bedrock and Bedrock Mantle key configs Jul 13, 2026
@impoiler impoiler self-assigned this Jul 13, 2026
@impoiler
impoiler marked this pull request as ready for review July 13, 2026 11:16
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
ui/app/workspace/providers/fragments/apiKeysFormFragment.tsx Adds project ID inputs for Bedrock and Bedrock Mantle provider configuration.
ui/lib/schemas/providerForm.ts Allows optional project ID values in the provider form schemas.
ui/lib/types/config.ts Adds project ID fields to Bedrock config types and defaults.
ui/lib/types/schemas.ts Allows optional SecretVar project IDs in frontend provider key schemas.

Reviews (4): Last reviewed commit: "feat: project id support for UI" | Re-trigger Greptile

Comment thread ui/lib/types/schemas.ts
Comment thread ui/lib/types/schemas.ts
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 13, 2026
@impoiler
impoiler force-pushed the 07-13-feat_project_id_support_for_bedrock_provider branch from e4118c0 to 774393b Compare July 13, 2026 11:20
@impoiler
impoiler force-pushed the 07-13-feat_project_id_support_for_ui branch 2 times, most recently from ee94c89 to fbb2a4f Compare July 13, 2026 11:44
@impoiler
impoiler force-pushed the 07-13-feat_project_id_support_for_bedrock_provider branch from 774393b to 41b7be7 Compare July 13, 2026 11:44

Pratham-Mishra04 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Jul 13, 2:14 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 13, 2:18 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 13, 2:20 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 13, 2:21 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 13, 2:21 PM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 07-13-feat_project_id_support_for_bedrock_provider to graphite-base/5134 July 13, 2026 14:14
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/5134 to dev July 13, 2026 14:17
@Pratham-Mishra04
Pratham-Mishra04 dismissed coderabbitai[bot]’s stale review July 13, 2026 14:17

The base branch was changed.

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-13-feat_project_id_support_for_ui branch 2 times, most recently from 0db5afe to de2fc56 Compare July 13, 2026 14:19
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 07-13-feat_project_id_support_for_ui branch from de2fc56 to 4c1b66a Compare July 13, 2026 14:20
@Pratham-Mishra04
Pratham-Mishra04 merged commit ec38ed9 into dev Jul 13, 2026
13 of 14 checks passed
@Pratham-Mishra04
Pratham-Mishra04 deleted the 07-13-feat_project_id_support_for_ui branch July 13, 2026 14:21
akshaydeo pushed a commit that referenced this pull request Jul 14, 2026
…ey configs (#5134)

## Summary

Adds an optional `project_id` field to both `BedrockKeyConfig` and `BedrockMantleKeyConfig`, allowing users to scope Bedrock Mantle-routed models (OpenAI-family / Gemma) to a specific project via the `OpenAI-Project` / `anthropic-workspace-id` header. When left empty, the account's default project is used.

## Changes

- Added `project_id` as an optional `SecretVar` field to `BedrockKeyConfig` and `BedrockMantleKeyConfig` types and their corresponding defaults.
- Extended the Zod validation schemas (`bedrockKeyConfigSchema`, `bedrockMantleKeyConfigSchema`, `BedrockKeyConfigSchema`, `BedrockMantleKeyConfigSchema`) to include the optional `project_id` field.
- Added UI form fields for `project_id` in both the Bedrock and Bedrock Mantle provider configuration sections, accepting a project ID or an environment variable reference (e.g., `proj_xxxxxxxx` or `env.BEDROCK_PROJECT_ID`).

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [x] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the Bedrock or Bedrock Mantle provider configuration in the workspace settings.
2. Verify the new **Mantle Project ID (Optional)** / **Project ID (Optional)** field appears in the form.
3. Enter a project ID (e.g., `proj_xxxxxxxx`) or an environment variable reference (e.g., `env.BEDROCK_PROJECT_ID`) and save.
4. Confirm the value is persisted and sent correctly when routing requests to Mantle-backed models.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

_Add before/after screenshots of the Bedrock and Bedrock Mantle provider configuration forms showing the new Project ID field._

## Breaking changes

- [x] No

## Related issues

## Security considerations

The `project_id` field is handled as a `SecretVar`, consistent with other sensitive Bedrock configuration values, supporting both inline values and environment variable references.

## 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
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