spenserblack / github-stats-rs

A tool for using Github's API
Apache License 2.0
1 stars 5 forks source link

Support search parameters #11

Open spenserblack opened 4 years ago

spenserblack commented 4 years ago

query.rs needs to support more query options. If you would like to work on this issue, please tell me which of the tasks below you would like to work on. You can check out the PRs linked to the completed tasks to get an example of what to do. Happy hacking! :jack_o_lantern:

Helpful Links

pancreaflame commented 4 years ago

Hello, I am trying to add user to area issues. But when I try to test the result against with the return from API call via http, I find the results are not aligned.

I use the sample code from README.md and run cargo run. It returns # of merged PRs: 1339 for total_count, while the expected API should be (https://api.github.com/search/issues?per_page=1&page=1&q=repo:rust-lang/rust+is:pr+is:merged) has total_count value of 24961.

Is it the expected behavior? I cannot figure out the cause of differences.

My code to run:

use github_stats::{Query, Search};

fn main() {
    // Gets latest merged PR
    let search = Search::new(
        "issues",
        &Query::new().repo("rust-lang", "rust").is("pr").is("merged"),
    )
    .per_page(1)
    .search();

    match search {
        Ok(results) => println!("# of merged PRs: {}", results.total_count()),
        Err(_e) => eprintln!(":("),
    }
}
spenserblack commented 4 years ago

Thanks for bringing that up, @pancreaflame! I've created #21 for this bug. In the future, in situations like this, could you open up a new issue? While what you found is definitely important, I don't think it's related to an issue tracking enhancements.

pancreaflame commented 4 years ago

Oh Yes! I didn't realize it was a bug. What I was thinking is: Is it related to I've logged in to GitHub account or not?

Now I know more about the testing strategy and how to do better issue tracking. Thank you! :smile:

eupn commented 4 years ago

@spenserblack I'll take these: author, assignee! 🎃

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been closed for being stale.