fix: webhook validation logic, unsafe type assertion, non-idiomatic loops#36
Merged
Conversation
…-idiomatic loops Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/d5f3dece-c858-4a4b-99da-c3fe36d74b01 Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
bzimmer
April 26, 2026 17:56
View session
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
==========================================
+ Coverage 72.37% 81.94% +9.56%
==========================================
Files 34 35 +1
Lines 1564 1429 -135
==========================================
+ Hits 1132 1171 +39
+ Misses 309 144 -165
+ Partials 123 114 -9
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
…s, bump Go to 1.26.1 Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/2afd90f3-b4c5-4ff6-a409-a326f0cf44f3 Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
- Remove all //go:generate genwith directives from strava, rwgps, zwift, cyclinganalytics
- Remove '// Code generated by genwith' headers from all four *_with.go files
- Drop outdated //nolint:golint,structcheck comments from service structs
- Fix mismatched doc comment 'WithAPICredentials' -> 'WithClientCredentials'
- Modernize do() method: interface{} -> any, errors.Is(err, io.EOF),
eliminate dead-code type switch (always *Fault on HTTP errors)
Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/cf291181-aaea-4089-a988-3570072e0098
Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
…ault] Create internal/httpclient.Client[F Fault] — a generic base type that encapsulates the shared HTTP state (HTTP, Token, Config) and the single Do() implementation. Package-specific Client structs embed a *Client[*Fault] field, and their *_with.go files become thin wrappers delegating to shared Apply* helpers (ApplyRateLimiter, ApplyHTTPTracing, ApplyTransport, ApplyHTTPClient, ApplyAutoRefresh). Also adds SetDefaults(int, string) to all four Fault types to satisfy the httpclient.Fault interface constraint used by the generic Do method. Net result: the four identical 170-line *_with.go files are each ~115 lines shorter; the single Do() implementation replaces four copies; and all transport-mutation logic lives in one place. Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/c39b4139-1c51-43e3-9ff9-e3885d9c5ad7 Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/c39b4139-1c51-43e3-9ff9-e3885d9c5ad7 Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
bzimmer
approved these changes
Apr 27, 2026
…analytics Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/2ad0d420-ca26-4998-81fd-041ad6a00431 Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
bzimmer
approved these changes
Apr 27, 2026
Owner
|
@copilot fix failing ci build |
…, gosec) Agent-Logs-Url: https://github.com/bzimmer/activity/sessions/8268f39d-981e-4a7a-b63b-57f78a3b4d2a Co-authored-by: bzimmer <12852+bzimmer@users.noreply.github.com>
Contributor
Author
Fixed in 7005cde. The CI failures were:
|
bzimmer
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
internal/httpclient(New, Do, ApplyRateLimiter, ApplyHTTPTracing, ApplyTransport, ApplyHTTPClient, ApplyAutoRefresh) — 97.1% coverageTestFault,TestOptions,TestFaultFromServertorwgps(coverFault.Error(),WithConfig,WithToken,WithRateLimiter,WithTransport,WithHTTPClient) — 88.4% (was 69.3%)TestTripUploadtorwgps(coverTripsService.Uploadand theuploaderadapter)TestUploaderUploadAndStatustorwgps(coveruploader.Upload,uploader.Status)TestOptionsinstrava(coverWithToken,WithTransport,WithHTTPClient) — 86.2% (was 84.2%)TestFault,TestOptions,TestExporttozwift(coverWithToken,WithAutoRefresh,WithRateLimiter,WithTransport,Fault.SetDefaults,Export) — 90.0% (was 80.0%)TestWithTransportandTestStreamSetstocyclinganalytics— 86.7% (was 84.7%)