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

fix assets_url attribute typo #448

Closed
wants to merge 4 commits into from

Conversation

smiller171
Copy link
Contributor

@smiller171 smiller171 commented May 8, 2020

I noticed that the attribute assets_url was typod to be asserts_url. This PR is my attempt to fix that mistake without breaking anyone's existing Terraform code.

I'm not sure I've handled the deprecation message properly, but I'm happy to make any adjustments needed.

I definitely didn't do the deprecation message right and have removed it to allow the tests to pass. Any guidance on how to implement the deprecation message would be appreciated.

@ghost ghost added size/XS dependencies Type: Documentation Improvements or additions to documentation labels May 8, 2020
@jcudit
Copy link
Contributor

jcudit commented May 8, 2020

The CI failure looks related to a previously merged PR.

ERRO Running error: varcheck: analysis skipped: errors in package: [/home/travis/gopath/src/github.com/terraform-providers/terraform-provider-github/main.go:5:2: could not import github.com/terraform-providers/terraform-provider-github/github (/home/travis/gopath/src/github.com/terraform-providers/terraform-provider-github/github/config.go:11:2: could not import github.com/google/go-github/v31/github (/home/travis/gopath/src/github.com/terraform-providers/terraform-provider-github/vendor/github.com/google/go-github/v31/github/github-accessors.go:11338:2: undeclared name: dataSource))] 

/cc @anGie44 in case this looks familiar ☝️

@smiller171
Copy link
Contributor Author

@jcudit No, that CI failure was from me copying code without understanding it to try to make a deprecation message work.

@@ -147,7 +151,8 @@ func dataSourceGithubReleaseRead(d *schema.ResourceData, meta interface{}) error
d.Set("published_at", release.GetPublishedAt())
d.Set("url", release.GetURL())
d.Set("html_url", release.GetHTMLURL())
d.Set("asserts_url", release.GetAssetsURL())
d.Set("asserts_url", release.GetAssertsURL())
Copy link
Contributor

@anGie44 anGie44 May 13, 2020

Choose a reason for hiding this comment

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

hi @smiller171, thank you for catching this! I'd recommend leaving this as d.Set("asserts_url", release.GetAssetsURL()) so existing users/configs can still access this value with the method available in the Github Go SDK. If we go in the direction of Deprecating the asserts_url attribute, within the "assets_url" block, after L87, you can add the key/value pair: Deprecated: "Use assets_url instead",. please refer to these docs for additional examples and recommendations: https://www.terraform.io/docs/extend/best-practices/deprecations.html#renaming-a-computed-attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the link. I hope to have time to fix this soon

@@ -11332,6 +11332,16 @@ func (r *RepositoryPermissionLevel) GetUser() *User {
return r.User
}

// GetAssertsURL returns the AssetsURL field if it's non-nil, zero value otherwise. Created to generate a deprecation warning
Copy link
Contributor

Choose a reason for hiding this comment

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

this custom method can be safely omitted here as we can reuse GetAssetsURL() to populate the misspelled attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intent with the extra method was to have a place to handle the deprecation message. I haven't made the time to go through the deprecation docs you linked, but hopefully I'll get to that soon

@jcudit jcudit added this to the v2.10.0 milestone Jun 3, 2020
@anGie44 anGie44 linked an issue Jun 11, 2020 that may be closed by this pull request
@jcudit jcudit modified the milestones: v2.10.0, v3.1.0 Jul 10, 2020
@anGie44 anGie44 modified the milestones: v3.1.0, v3.2.0 Jul 31, 2020
@jcudit jcudit modified the milestones: v3.2.0, v3.1.1 Oct 17, 2020
@jcudit jcudit modified the milestones: v4.0.1, v4.0.2 Nov 11, 2020
@jcudit
Copy link
Contributor

jcudit commented Dec 8, 2020

@smiller171 are you around to take care of the conflict here? 🤔 seems like we can remove the edit to vendor/github.com/google/go-github/v31/github/github-accessors.go and we'll be good to merge.

@smiller171
Copy link
Contributor Author

@jcudit I've rebased and reverted the change to github-accessors. It's been a very long time since I looked at this, and I know I never came back to implement that deprecation message.

Also it looks like a bunch of tests are failing now...

@ghost ghost removed the Awaiting response label Dec 9, 2020
@jcudit
Copy link
Contributor

jcudit commented Dec 9, 2020

Ah, didn't realize there was more to be done here. We can circle back on this effort another day.

@jcudit jcudit removed this from the v4.1.1 milestone Dec 9, 2020
@shabbyrobe shabbyrobe mentioned this pull request Jun 19, 2022
@kfcampbell kfcampbell added Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR and removed Dependencies labels Oct 31, 2022
@nickfloyd nickfloyd added the Status: Stale Used by stalebot to clean house label Nov 30, 2022
@nickfloyd
Copy link
Contributor

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions
Copy link

github-actions bot commented Sep 6, 2023

👋 Hey Friends, this pull request has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Sep 6, 2023
@github-actions github-actions bot closed this Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Status: Stale Used by stalebot to clean house Type: Documentation Improvements or additions to documentation Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attribute 'asserts_url' should be 'assets_url'
5 participants