-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Github: Support PR/issues with labels, full count #1020
Conversation
2a990a1
to
6fdb4c7
Compare
nice! |
168c081
to
3823df9
Compare
can the issues by-label include the label though? without that it might quickly get confusing |
@StoneCypher In our use-case, the context is very clear, so there is no need for that. But if you're going to add multiple of these on a single page, I see your point. Let me know what you like here. We could add -label to in there somewhere ? |
@StoneCypher I now do this: So basically, if you provide |
ya 😄 |
@StoneCypher Enjoy ! PS Now I have to find out how to get this merged, because I would like to use it for real ! |
Well, if I tag @espadrine , then you weren't the obnoxious one 😀 |
@StoneCypher Not sure if you had any summoning powers before, but they are surely failing now ;-) |
they did indeed |
@Daniel15 - any chance of looking at this? This is rly valuable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for this. Could you add a service test which covers the new functionality?
@paulmelnikow Done. |
The original code has been simplified as well, but commented out. I don't think we need the original code using the issues API, as it has some limitations (no label support, only up to 30, or 100 issues).
As requested, we now add the GitHub label to the badge, only if not specifying `-raw` in the URL.
b29967c
to
22694e6
Compare
@paulmelnikow (thank you) |
Am I correct that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look great! Clarifies the API too, which I've made some comments on. Really excited about this functionality. Shields could use a count of beginner-friendly issues on the readme or contributing pages.
service-tests/github.js
Outdated
.expectJSONTypes(Joi.object().keys({ | ||
name: Joi.equal('issues'), | ||
value: Joi.string().regex(/^[0-9]+[kMGTPEZY]?$/) | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about calling this -minimalist
or -clean
, or better yet, /issues/minimalist
, rather than -raw
? It seems to clarify that it's affecting the formatting, rather than the underlying number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't introduce -raw
, it was called like this before. I don't think we an break the existing interface.
service-tests/github.js
Outdated
.expectJSONTypes(Joi.object().keys({ | ||
name: Joi.equal('closed issues'), | ||
value: Joi.string().regex(/^[0-9]+[kMGTPEZY]? closed$/) | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that closed is not needed here, since the left side already says it's counting closed issues. Then we could omit -closed-raw
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rights, I think this was done because it's closer to what we do for open. Otherwise there's no difference anymore between closed-raw
and closed
. It's not simple to omit something, except maybe from the listing, but people can still do it.
Up to you to decide. I'll do whatever makes it upstream ;-) My interest in displaying closed issues or PRs is non-existing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost my entire interest here is in closed issues (though i do not understand or care about the -raw
) distinction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha. Ok, I'll do what you suggested.
service-tests/github.js
Outdated
.expectJSONTypes(Joi.object().keys({ | ||
name: Joi.equal('pull requests'), | ||
value: Joi.string().regex(/^[0-9]+[kMGTPEZY]? open$/) | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just be /pull-requests
instead of /issues-pr
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, we need to support /issues-pr
for backward compatibility. What do you think about supporting both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, so I only simplified the implementation and made the numbers exact (rather than saying 30+ for everything larger than 30). And that's what we needed. The simplification was simple a result of the fact that it was needed for getting proper numbers.
That is exactly as it was before AFAIK. You either have issues or PRs (and I don't know what the name is for both). |
Done ! |
7c336ca
to
57f88f7
Compare
Ready to be merged ! (And then I can update our community wiki pages to get real numbers !) |
57f88f7
to
af4b1ad
Compare
This PR includes: - Getting rid of the option that includes 2x closed - Using -closed-raw is no longer useful
af4b1ad
to
62c470d
Compare
Merged and live. |
@espadrine Thanks ! I was making some more small changes to the examples, but I'll add them to another PR. Nothing important. |
@dagwieers It's really cool to see this in use! |
@espadrine what about a badge for merged PR's only too? |
@AraHaan - thank you for looking back through the history to find things relevant to your inquiry, but a pull request that was closed more than 3 years isn't the best place for a new feature request. Please open a new issue if you'd like a new badge/new variant of a badge to increase the odds of someone potentially implementing it! |
ok opened #6164 |
This PR includes the following:
30+
)This fixes #839
This fixes #420
This implements #862 partly