Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Support Key Pair resources #51

Merged
merged 2 commits into from
May 18, 2019
Merged

Support Key Pair resources #51

merged 2 commits into from
May 18, 2019

Conversation

kamatama41
Copy link
Contributor

@kamatama41 kamatama41 commented May 14, 2019

This PR adds a support of Key Pair and Key Pair (generated) resources.

Although I wrote unit tests by following other resources, I didn't write integration tests because I don't have the right to modify the environment of integration test (probably https://travis-ci.org/shuheiktgwtest/go-travis-test ?) . What should I do?

@kamatama41 kamatama41 changed the title Implement Key Pair entities and their unit tests Support Key Pair resources May 14, 2019
@shuheiktgw
Copy link
Owner

Thank you for your PR! It seems great, but I need to test the endpoint myself before merging this PR. So give me a few days to review this PR since I need to migrate my testing repo to travis-ci.com to try the endpoint! 😄

As for integration tests, you don't have to care about them so far, since as you described above the configuration is hardcoded. Sorry for the inconvenience, I should probably dockernize the tests...

Copy link
Owner

@shuheiktgw shuheiktgw left a comment

Choose a reason for hiding this comment

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

I wrote integration tests and made sure it works perfectly. Thanks again for your PR!
Only one quick fix, so please check the comment! 👍

key_pair.go Outdated
// FindGeneratedByRepoId fetches the default key pair based on the given repository id
//
// Travis CI API docs: https://developer.travis-ci.com/resource/key_pair_generated#find
func (ks *KeyPairService) FindGeneratedByRepoId(ctx context.Context, repoId uint) (*KeyPair, *http.Response, error) {
Copy link
Owner

Choose a reason for hiding this comment

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

Would you create a new service like GeneratedKeyPairService and move FindGenerated~ and CreateGenerated~ there? I would like to keep the library's api coherent, which method names do not contain information about resource they interact with.

Copy link
Contributor Author

@kamatama41 kamatama41 May 17, 2019

Choose a reason for hiding this comment

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

Make sense 😃 I fixed it at cba3866

It might be better to separate GeneratedKeyPairService with an another file (like generated_key_pair.go), if it should be so, please let me know.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for the fix! Looks great! 👍

…ent methods related to the resources from KeyPairService
@shuheiktgw
Copy link
Owner

I'll release v0.2.1 after adding some integration tests. Thanks again for your PR! 👍

@shuheiktgw shuheiktgw merged commit 00ed074 into shuheiktgw:master May 18, 2019
@kamatama41
Copy link
Contributor Author

Thanks! 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants