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

Base class for searching GitHub #301

Merged
merged 5 commits into from
Jan 14, 2014
Merged

Conversation

hahmed
Copy link
Contributor

@hahmed hahmed commented Jan 13, 2014

http://developer.github.com/v3/search/#search

We are repeating a lot of logic inside the searches, hopefully this class will allow us to simply our searching.

I will close hahmed#1 so we can keep our discussions on the octokit repo (if anyone else has any input).

How do you want this to be merged?

I have created the base class, so we can now iterate on it till it's right...

Once this is merged - we can open a PR for every search to inherit from base class? @alfhenrik can then use it for his PR #290 and I can also use it for #289

cc:// @shiftkey @alfhenrik

it's simpler if we join the qualifiers...
@hahmed
Copy link
Contributor Author

hahmed commented Jan 13, 2014

The reason for sort:

    public abstract string Sort
    {
        get;
    }

All searches - Search/Repo, Search/Users, Search/Issues, Search/Files have sort added to the query string, so we can get inherited class to simply pass us the string representation of whatever Sort means to them.

@hnrkndrssn
Copy link
Contributor

Sounds good to me!


From: Haroon
Sent: 13/01/2014 19:38
To: octokit/octokit.net
Cc: Henrik Andersson
Subject: [octokit.net] WIP: Base class for searching GitHub (#301)

We are repeating a lot of logic inside the searches, hopefully this class will allow us to simply our searching.

I will close hahmed#1 so we can keep our discussions on the octokit repo (if anyone else has any input).

How do you want this to be merged?

I have created the base class, so we can now iterate on it till it's right...

Once this is merged - we can open a PR for every search to inherit from base class? @alfhenrik can then use it for his PR #290 and I can also use it for #289

cc:// @shiftkey @alfhenrik

You can merge this Pull Request by running:

git pull https://github.com/hahmed/octokit.net search-base-class

Or you can view, comment on it, or merge it online at:

#301

-- Commit Summary --

  • base class for searching

-- File Changes --

A Octokit/Models/Request/SearchBase.cs (90)

-- Patch Links --

https://github.com/octokit/octokit.net/pull/301.patch
https://github.com/octokit/octokit.net/pull/301.diff


Reply to this email directly or view it on GitHub:
#301

/// <summary>
/// All qualifiers that are used for this search
/// </summary>
public abstract System.Collections.Generic.IReadOnlyCollection<string> MergedQualifiers();
Copy link
Contributor

Choose a reason for hiding this comment

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

You could add System.Collections.Generic in a using statement together with the other usings at the top, makes the method a bit cleaner.

@@ -56,6 +56,7 @@
<Compile Include="Clients\ActivitiesClient.cs" />
<Compile Include="Clients\SearchClient.cs" />
<Compile Include="Clients\ISearchClient.cs" />
<Compile Include="Models\Request\SearchBase.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the file name be BaseSearchRequest.cs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alfhenrik thanks! 👍

@shiftkey
Copy link
Member

@hahmed it still says "WIP:" in the PR - is there anything left to implement on this?

👍 on this change, hopefully this tidies up a bunch of our boilerplate code

@hahmed
Copy link
Contributor Author

hahmed commented Jan 13, 2014

Nope... forgot to remove that. Was not sure if you wanted to add anything else to this.

@hahmed
Copy link
Contributor Author

hahmed commented Jan 14, 2014

@shiftkey removed the WIP... ready for review now.

@hahmed hahmed mentioned this pull request Jan 14, 2014
2 tasks
@shiftkey
Copy link
Member

Given we already discussed a bunch of this over in hahmed#1, I don't have anything else really to find fault with.

thumbsup

shiftkey added a commit that referenced this pull request Jan 14, 2014
Base class for searching GitHub
@shiftkey shiftkey merged commit 7890f70 into octokit:master Jan 14, 2014
@hahmed hahmed deleted the search-base-class branch January 19, 2014 21:15
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.

3 participants