Skip to content

Short-circuit if we have a v2 capability#22356

Open
cedric-cordenier wants to merge 1 commit into
developfrom
CRE-4087-short-circuit-v2-caps
Open

Short-circuit if we have a v2 capability#22356
cedric-cordenier wants to merge 1 commit into
developfrom
CRE-4087-short-circuit-v2-caps

Conversation

@cedric-cordenier
Copy link
Copy Markdown
Contributor

Requires

Supports

Copilot AI review requested due to automatic review settings May 8, 2026 16:17
@cedric-cordenier cedric-cordenier requested review from a team as code owners May 8, 2026 16:17
@cedric-cordenier cedric-cordenier added the build-publish Build and Publish image to SDLC label May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

👋 cedric-cordenier, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

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.

if errAdd != nil {
return fmt.Errorf("failed to add remote v2 capability %s: %w", capability.ID, errAdd)
}
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Won't this break cron? It's used by both, but was upgraded to v2.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CRON is not a remote capability.
We only care about chain caps and vault here and they all have methodConfig set.

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 fixes the remote capability registration flow by ensuring that once a v2 capability is successfully added via the CombinedClient path, the launcher does not continue into the v1 shim-registration logic, preventing duplicate/incorrect registration attempts.

Changes:

  • Add an early return nil after successfully adding a remote v2 capability to short-circuit further processing.

Areas requiring scrupulous human review:

  • addRemoteCapability v2 detection/branching: confirm that capabilityConfig.CapabilityMethodConfig != nil is the definitive signal for “v2 capability” across all supported configurations, and that no v2 capability should ever also go through the v1 switch capability.CapabilityType block.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 8, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

if errAdd != nil {
return fmt.Errorf("failed to add remote v2 capability %s: %w", capability.ID, errAdd)
}
return nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CRON is not a remote capability.
We only care about chain caps and vault here and they all have methodConfig set.

@cl-sonarqube-production
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-publish Build and Publish image to SDLC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants