Skip to content

Introduce an SDK seam so the reconcile logic is unit-testable - #96

Open
aswinsuryan wants to merge 1 commit into
openshift:mainfrom
aswinsuryan:test/gcp-platform-seams-and-tests
Open

Introduce an SDK seam so the reconcile logic is unit-testable#96
aswinsuryan wants to merge 1 commit into
openshift:mainfrom
aswinsuryan:test/gcp-platform-seams-and-tests

Conversation

@aswinsuryan

Copy link
Copy Markdown
Contributor

The GCP platform's interfaces sat at the Platform level, leaving the logic that decides what to write to the Cloud Router and to NCC spokes with no boundary a test could substitute below it, so it could only run against live Google APIs. AWS addressed the same problem in PR #69 with its ec2API seam; this brings that shape to GCP.

The seam lives at the SDK boundary:

  • computeAPI / gceAPI in compute.go
  • nccAPI / gcpNCCAPI in ncc.go

The concrete pass-throughs are the only code that touches the SDK; the reconcile logic moves above them with its behavior unchanged, and a fake can now stand in for Google in tests. Unlike ec2API these are semantic seams rather than method-for-method mirrors, because the GCE and NCC clients are fluent builders with no interface to mirror.

The GCP platform's interfaces sat at the Platform level, leaving the
logic that decides what to write to the Cloud Router and to NCC spokes
with no boundary a test could substitute below it, so it could only run
against live Google APIs. AWS addressed the same problem in PR openshift#69 with
its ec2API seam; this brings that shape to GCP.

The seam lives at the SDK boundary:

  - computeAPI / gceAPI  in compute.go
  - nccAPI    / gcpNCCAPI in ncc.go

The concrete pass-throughs are the only code that touches the SDK; the
reconcile logic moves above them with its behavior unchanged, and a fake
can now stand in for Google in tests. Unlike ec2API these are semantic
seams rather than method-for-method mirrors, because the GCE and NCC
clients are fluent builders with no interface to mirror.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Aswin Suryanarayanan <asuryana@redhat.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 54 minutes.

View limit details

Limit details: You’ve used the included review currently available.

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 89363639-456e-48ba-8ee4-7d60e67cf195

📥 Commits

Reviewing files that changed from the base of the PR and between 149a02f and 14817af.

📒 Files selected for processing (5)
  • internal/platform/gcp/compute.go
  • internal/platform/gcp/compute_test.go
  • internal/platform/gcp/gcp_test.go
  • internal/platform/gcp/ncc.go
  • internal/platform/gcp/ncc_test.go

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

@openshift-ci
openshift-ci Bot requested review from alebedev87 and frobware August 28, 2026 01:22
@openshift-ci

openshift-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aswinsuryan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2026
@openshift-ci

openshift-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown

@aswinsuryan: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ci-bundle-bgp-cloud-connector-bundle 14817af link true /test ci-bundle-bgp-cloud-connector-bundle

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant