Skip to content

[CRE] Allow the Gateway to handle multiple dons#22437

Merged
agparadiso merged 2 commits into
developfrom
gateway_handles_multiple_vault_dons
May 14, 2026
Merged

[CRE] Allow the Gateway to handle multiple dons#22437
agparadiso merged 2 commits into
developfrom
gateway_handles_multiple_vault_dons

Conversation

@agparadiso
Copy link
Copy Markdown
Contributor

@agparadiso agparadiso commented May 13, 2026

Description

if multiple vault dons are listed, select the correct one using the gatewayConfig.ShardedDONs.DonName
currently our motivation is to have cre reliability environment vault don, given this is in staging we need to handle two different vault dons (staging and reliability). The change is backwards compatible, so if one only vault don is present the same behaviour is maintained

Requires

Supports

@github-actions
Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 13, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cl-sonarqube-production
Copy link
Copy Markdown

@agparadiso agparadiso changed the title feat: if multiple vault dons are listed, select the correct one using… [CRE] Allow the Gateway to handle multiple dons May 14, 2026
@agparadiso agparadiso marked this pull request as ready for review May 14, 2026 12:52
@agparadiso agparadiso requested review from a team as code owners May 14, 2026 12:52
Copilot AI review requested due to automatic review settings May 14, 2026 12:52
@agparadiso agparadiso added this pull request to the merge queue May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: MEDIUM

This PR updates the Vault gateway aggregation path so that when the capabilities registry reports multiple DONs hosting the Vault capability, the handler selects the DON associated with the gateway job’s configured DON name.

Changes:

  • Passes the handler DON identifier into baseAggregator.
  • Adds multi-DON Vault capability selection by DON name, with legacy numeric ID fallback.
  • Adds tests for name-based selection, ID fallback, no-match, and ambiguous-match cases.

Targeted human review areas:

  • Multi-DON selection logic in donForVaultCapability.
  • Consistency between gateway ShardedDONs.DonName, legacy DONConfig.DonId, and registry DON names/IDs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
core/services/gateway/handlers/vault/handler.go Wires the configured DON identifier into the Vault aggregator.
core/services/gateway/handlers/vault/aggregator.go Selects the correct Vault DON when multiple registry DONs host the capability.
core/services/gateway/handlers/vault/handler_test.go Extends the mock registry and updates a public-key test aggregator setup.
core/services/gateway/handlers/vault/aggregator_test.go Adds tests for multi-DON selection and error cases.

Comment on lines +69 to +70
return nil, fmt.Errorf("multiple DONs (%d) host vault capability %s but vault handler DonId is empty; set ShardedDONConfig.DonName so DONConfig.DonId matches the vault DON name or id in the registry (%s)",
len(dons), vaultcommon.CapabilityID, summarizeVaultRegistryDONs(dons))
Comment on lines +59 to +60
if len(dons) == 0 {
return nil, fmt.Errorf("no DON found for vault capability %s", vaultcommon.CapabilityID)
Merged via the queue into develop with commit 89f677d May 14, 2026
218 checks passed
@agparadiso agparadiso deleted the gateway_handles_multiple_vault_dons branch May 14, 2026 13:14
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.

4 participants