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

Implemented GetLatestRelease API. #975

Merged
merged 2 commits into from
Feb 3, 2016

Conversation

poisonous-milk
Copy link
Contributor

trying to fix
#966

/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <returns></returns>
public static Uri LatestReleases(string owner, string name)
Copy link
Member

Choose a reason for hiding this comment

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

💄 perhaps make this singular i.e. LatestRelease

@shiftkey
Copy link
Member

shiftkey commented Dec 7, 2015

Looking good so far @chenjiaming93!

A couple of things I'd like to verify as part of integration tests:

  • that we're able to deserialize a release correctly using this endpoint
  • what happens when no releases exist for a repository?

@poisonous-milk
Copy link
Contributor Author

I have added tests. This one is similar to GetRelease API. Just replaced release id with "latest". In the tests for getrelease we are only checking if we can receive the get request at that endpoint and throw proper exceptions when missing arguments. If there is no latest release, are we expected to get a Null JSON or we a 500 error?

@shiftkey
Copy link
Member

shiftkey commented Dec 7, 2015

@chenjiaming93 we have some existing tests which use the real GitHub API - let's add a couple of tests for this endpoint there: https://github.com/octokit/octokit.net/blob/master/Octokit.Tests.Integration/Clients/ReleasesClientTests.cs

A couple of tests I think we can do to complete this feature:

  • "get the latest release for Octokit" - we get a non-null Release back
  • "get the latest release for a new repository" -> get a helpful error back

If there is no latest release, are we expected to get a Null JSON or we a 500 error?

I'm honestly not sure - let's find out by writing the test!

I think the end result should be a custom exception that we throw to the user. There's a detailed example here for how we handle when creating a repository fails - I think you'll have to do something similar and try-catch the call and then check if the error is something we're familiar with.

@poisonous-milk
Copy link
Contributor Author

@shiftkey I see. I will add integration tests soon.

@khalidabuhakmeh
Copy link

Any update on this issue?

@poisonous-milk
Copy link
Contributor Author

@khalidabuhakmeh I am busy with my final exams this week. I will add integration tests this weekend.

@haacked
Copy link
Contributor

haacked commented Jan 2, 2016

Happy New Year! @chenjiaming93 were you still planning to add integration tests?

@poisonous-milk
Copy link
Contributor Author

@haacked I'm just back to school. Will start working tmr

@shiftkey
Copy link
Member

shiftkey commented Feb 3, 2016

I've moved the integration tests out to #1086 rather than hold this up any longer.

Thanks for the contribution @chenjiaming93!

shiftkey added a commit that referenced this pull request Feb 3, 2016
@shiftkey shiftkey merged commit 7ca0140 into octokit:master Feb 3, 2016
@shiftkey shiftkey mentioned this pull request Feb 3, 2016
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.

4 participants