Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove double-unmarshalling #1046

Merged
merged 6 commits into from
Aug 19, 2022
Merged

Remove double-unmarshalling #1046

merged 6 commits into from
Aug 19, 2022

Conversation

vazexqi
Copy link
Contributor

@vazexqi vazexqi commented Aug 16, 2022

Description

Fixes #1045

Has your change been tested?

Modified existing tests and ran go test.

Screenshots (if appropriate):

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented (api.cloudflare.com or developers.cloudflare.com) and stable APIs.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 16, 2022

changelog detected ✅

@@ -320,31 +320,20 @@ func (api *API) UpdateTunnelConfiguration(ctx context.Context, rc *ResourceConta
}

uri := fmt.Sprintf("/accounts/%s/cfd_tunnel/%s/configurations", rc.Identifier, params.TunnelID)
res, err := api.makeRequestContext(ctx, http.MethodPut, uri, params.Config)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a slightly different bug but also has to do with the marshalling/unmarshalling of the config param.

@vazexqi
Copy link
Contributor Author

vazexqi commented Aug 16, 2022

I am new to this process so let me know if there's anything that I'm missing.
In the mean time, I am using my forked version at https://github.com/zuplo/cloudflare-go to unblock myself.

@jacobbednarz
Copy link
Member

let me confirm with the service team as this was the correct API response when it was added.

tunnel.go Outdated
@@ -73,9 +73,9 @@ type TunnelConnectionResponse struct {
// other than in the HTTP response unmarshaling. Use `TunnelConfigurationResult`
// for the correct types.
type TunnelConfigurationStringifiedConfigResult struct {
Copy link
Member

Choose a reason for hiding this comment

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

this should be renamed now to better reflect it's use

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it can be removed now (see my latest PR).

I think this is OK. It's not safe since it can be breaking because TunnelConfigurationStringifiedConfigResult was an exported type before in the SDK but I doubt anyone was directly referencing those types.

@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2022

Codecov Report

Merging #1046 (87eb8f9) into master (6c5ea4a) will increase coverage by 0.88%.
The diff coverage is 65.04%.

@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
+ Coverage   49.06%   49.94%   +0.88%     
==========================================
  Files         108      115       +7     
  Lines       10428    10991     +563     
==========================================
+ Hits         5116     5490     +374     
- Misses       4200     4338     +138     
- Partials     1112     1163      +51     
Impacted Files Coverage Δ
access_application.go 76.52% <ø> (ø)
access_bookmark.go 72.44% <ø> (ø)
workers_account_settings.go 35.71% <35.71%> (ø)
rulesets.go 35.09% <47.36%> (+7.43%) ⬆️
workers_tail.go 52.00% <52.00%> (ø)
workers_subdomain.go 57.14% <57.14%> (ø)
email_routing_settings.go 60.00% <60.00%> (ø)
email_routing_rules.go 65.64% <65.64%> (ø)
lockdown.go 57.69% <66.00%> (+6.94%) ⬆️
email_routing_destination.go 66.25% <66.25%> (ø)
... and 16 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jacobbednarz
Copy link
Member

this still needs a CHANGELOG too

.changelog/1046.txt Outdated Show resolved Hide resolved
Co-authored-by: Jacob Bednarz <[email protected]>
@jacobbednarz jacobbednarz merged commit 31436d7 into cloudflare:master Aug 19, 2022
@github-actions github-actions bot added this to the v0.48.0 milestone Aug 19, 2022
@jacobbednarz
Copy link
Member

thanks for getting this over the line 🎉

github-actions bot pushed a commit that referenced this pull request Aug 19, 2022
@vazexqi
Copy link
Contributor Author

vazexqi commented Aug 19, 2022

@jacobbednarz - Thanks for helping with this PR. Do you know when you will cut a new release so that I can switch over to the official version instead of my fork?

@jacobbednarz
Copy link
Member

details in https://github.com/cloudflare/cloudflare-go/blob/master/docs/release-process.md.

you can also check the milestone that this PR was added to.

@github-actions
Copy link
Contributor

This functionality has been released in v0.48.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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.

Double-unmarshalling of config from cfd_tunnel/{{TUNNEL_ID}}/configurations is unnecessary
3 participants