Comments (5)
If you're referring to the List issues for a repository part of the API, it works for me.™
$ perl -wle 'use Pithub; $i = Pithub->new->issues->list( user => "gr2m", repo => "milestones", params => { milestone => "02 App & Plugin Templates" } ); print $i->first->{milestone}{title}'
02 App & Plugin Templates
Could you provide code demonstrating the problem?
from pithub.
Here's an example (changing the milestone parameter to the string doesn't produce any results):
#! /usr/bin/perl
use strict;
use Pithub;
my $i = Pithub::Issues->new(auto_pagination => 1);
my $result = $i->list(
user => 'wikkawik',
repo => 'WikkaWiki',
params => {
milestone => "1.3.6",
#milestone => 21,
state => "closed",
sort => "number",
direction => "asc",
}
);
while(my $row = $result->next) {
print "$row->{'number'}:$row->{'title'}\n"
}
from pithub.
It looks like the Github API is doing a terrible job on this. I get inconsistent results, the milestone string works for some repositories, for most it doesn't. Sometimes it works for milestones with no open issues, sometimes it doesn't.
Pithub is a thin wrapper around the Github API. Bugs in the API should be fixed by Github. I'd recommend you contact them about this and get back to us when you get a response.
from pithub.
I seem to be in the wrong about this. It's clear that v3 of the github API does not support searching for milestones by milestone title, and that one needs to synthesize a mapping between milestone number and title in order to accomplish a search by title. This is the response I received from github support:
Thanks for a detailed description.
First, you're right -- the milestone parameter should be a string *, a number (integer), or string none. May I ask why you're passing in a string value that is not * or none?
Just to clarify -- both of those API calls you mentioned are succeeding, you're getting back a 200 OK response. When you pass in "1.3.6" as the milestone, that's interpreted as number 1, and when you pass in "02 App & Plugin Templates", that's interpreted as number 2. So, your queries are interpreted as ?milestone=1 and ?milestone=2. In the first case, there are no issues associated with milestone 1 which have been closed, so you get an empty array. In the second case, there are some issues associated with milestone 2 which have been closed, so you get some items back.
Does this explain the behavior you observed? Again, my suggestion would be to use milestone numbers to filter issues by milestone, and not milestone titles. You can get the number of a milestone by listing milestones for the repository:
from pithub.
Re-reading the API documentation, it is quite clear. I could have sworn it wasn't and thought maybe they recently changed it, but I checked the Wayback Machine and it hasn't. Also the Pithub::Issues documentation already has it correct. Reading comprehension fail all around!
Interpreting "1.3.6" as "1" is heroic to an absurd and confusing level. I would suggest to them they make it a validation error instead. I would also suggest they allow milestone names since, unlike issues, their web site refers to milestones by name and there's no API call to look up a milestone by name.
I'm going to close this out. Feel free to reopen if you feel it's not done, or open another issue if you find a related problem.
from pithub.
Related Issues (20)
- Turn on coveralls.io HOT 2
- Allow passing attributes to Pithub instance helpers HOT 1
- Ability to delete repositories
- Add the ability to get a branch
- New release? HOT 5
- Pithub-0.01027 unchecked dependency on Moo-1.006001 HOT 1
- #186 breaks compatibility HOT 9
- Need more examples in the SYNOPSIS of main module HOT 1
- Test Failures / Modification of non-creatable hash value attempted, subscript "bio" HOT 3
- ->issues HOT 4
- ->commits HOT 5
- ->pull_requests HOT 2
- Feature Request: Markdown HOT 7
- Feature: method to query rate_limit HOT 1
- Problem with POD generation HOT 2
- Failures due to JSON deps HOT 2
- Fix Pod errors in Pithub::Base HOT 1
- Drop dependency on Array::Iterator HOT 2
- Github requires boolean values for true/false values not 0/1 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pithub.