Skip to content

refactor(internal/surfer): encapsulate provider logic into new package#4724

Merged
sarahheacock merged 1 commit intomainfrom
surfer-provider
Mar 27, 2026
Merged

refactor(internal/surfer): encapsulate provider logic into new package#4724
sarahheacock merged 1 commit intomainfrom
surfer-provider

Conversation

@sarahheacock
Copy link
Copy Markdown
Contributor

@sarahheacock sarahheacock commented Mar 23, 2026

The core gcloud configuration, field, loader, method, resource, and service information logic has been extracted from the package into a new, dedicated package. This separates generic surfer API rules and configuration definitions from the gcloud-specific command and argument builder implementations.

provider should slowly decrease in size as sidekick improves and the gcloud config decreases in size. This abstracts away the current current sources of data so that they can be updated over time.

Fix: #4714

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 88.37209% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.39%. Comparing base (71f7d3b) to head (a19a604).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
internal/surfer/gcloud/provider/config.go 75.00% 4 Missing and 2 partials ⚠️
internal/surfer/gcloud/provider/loader.go 0.00% 5 Missing ⚠️
internal/surfer/gcloud/generate.go 81.81% 2 Missing ⚠️
internal/surfer/gcloud/provider/method.go 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4724      +/-   ##
==========================================
+ Coverage   81.37%   81.39%   +0.01%     
==========================================
  Files         130      131       +1     
  Lines       10905    10946      +41     
==========================================
+ Hits         8874     8909      +35     
- Misses       1392     1397       +5     
- Partials      639      640       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request successfully refactors the core logic for gcloud command generation into a new provider package. The changes correctly update import paths, function calls, and types to reflect the new package structure, enhancing modularity and encapsulation as described in the pull request description. All moved functions have been appropriately exported and integrated into the provider.Config struct where applicable. The corresponding test files have also been updated to reflect these changes, ensuring continued test coverage for the refactored logic.

@sarahheacock sarahheacock force-pushed the surfer-arg-builder-cleanup branch from 1692c92 to 83a1fd3 Compare March 23, 2026 03:05
@sarahheacock sarahheacock force-pushed the surfer-arg-builder-cleanup branch 4 times, most recently from 6755a03 to d499318 Compare March 24, 2026 19:33
@sarahheacock sarahheacock force-pushed the surfer-arg-builder-cleanup branch 5 times, most recently from 5ae1737 to 62e300e Compare March 25, 2026 13:32
Base automatically changed from surfer-arg-builder-cleanup to main March 25, 2026 21:25
…ation

The provider package is relocated from internal/surfer/provider into
internal/surfer/gcloud/provider to better encapsulate abstraction code
used exclusively by the gcloud command builders. By bringing the provider
internals closer to their usage site, we prevent tight coupling across
the broader surfer module.
Helper functions like FindFieldHelpText are moved into config.go. ReadGcloudConfig migrated from gopkg.in/yaml.v3 over to the internal/yaml
generic package.
@sarahheacock sarahheacock marked this pull request as ready for review March 26, 2026 17:15
@sarahheacock sarahheacock requested a review from a team as a code owner March 26, 2026 17:15
Copy link
Copy Markdown
Contributor

@quirogas quirogas left a comment

Choose a reason for hiding this comment

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

LGTM

@sarahheacock sarahheacock merged commit 9062025 into main Mar 27, 2026
37 of 38 checks passed
@sarahheacock sarahheacock deleted the surfer-provider branch March 27, 2026 14:29
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.

surfer: refactor files for clear separation of concerns

2 participants