-
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 7 replies
-
At the moment I don't think so. If I recall correctly the entire input is utilized as a single label within the graphql query so any attempts to specify multiple labels for the route parameter would just end up as a long/odd singular label. I think it'd be reasonable to try to support this, though figuring out a good way of handling the badge label would be tricky with an open ended set of input GH labels |
Beta Was this translation helpful? Give feedback.
-
I am not acquainted with GitHub API (could have a look at it, I guess) and I'll assume that the limitation could come from there. |
Beta Was this translation helpful? Give feedback.
-
It's a GraphQL query using the v4 API: shields/services/github/github-issues.service.js Lines 317 to 384 in 87d8028 I'm not sure how that could best be mapped to an AND type filter on the labels off hand either |
Beta Was this translation helpful? Give feedback.
-
I appreciate I'm scope-creeping this a bit, but here's a bigger idea.. In the github front-end, it is possible to construct fairly nuanced issue/PR queries. For example:
If we're going to go down the route of extending these badges to allow more advanced queries, I think the ideal solution would actually be if we supported that same query syntax in its entirity. Then users can build a query through the GH frontend and once they're happy with it, pass the query to a badge URL in a querystring. One of the nice things about the Github V4 API (which didn't exist when these badges were first designed) is we can actually use that syntax directly in a GraphQL query. So the queries above translate to: query {
search(query: "repo:badges/shields is:open is:issue label:core label:bug author:app/sentry-io", type: ISSUE) {
issueCount
}
} and query {
search(query: "repo:badges/shields is:pr is:closed label:npm-package review:approved author:chris48s", type: ISSUE) {
issueCount
}
} I think rather than gradually implement that syntax one feature request at a time, how about we implement one badge: Github Issue (with arbitrary query): ..and then we make our existing random mashup of github issue/PR variant badges redirects to preset queries on that general badge but we say "no more presets". Then any arbitrary query you can make through the GH builder can be a badge, we put this to bed once and for all and we can collapse this mess. Thoughts? |
Beta Was this translation helpful? Give feedback.
-
@JFQueralt The corresponding graphql query for would be query {
search(query: "repo:TheIOFoundation/ProjectLockdown is:open is:issue label:\"Need: Position\" label:\"Stage: Ready\"", type: ISSUE) {
issueCount
}
}
That is a good question. As far as I'm aware, yes but unfortunately the docs are not totally clear so we should test. I'd be surprised if there is any divergence though.
For the existing badges, we should retain the same labels. I think for the "arbitrary search query" badge I think we just have to give it a generic label like "query" or "search" and leave it to the user to pass a suitable
Yes. I'd envisage that adding a
As long as we only return the count, it is a single node query so one rate limit point regardless of the query. |
Beta Was this translation helpful? Give feedback.
-
📚 I cheated and read the docs 😆 I've made an issue for this based on the discussion: #5948 |
Beta Was this translation helpful? Give feedback.
-
We've now deployed the generic issue search badge so you can now make this badge (and many others) using a custom query: to customise the label: so I'm going to mark this as answered |
Beta Was this translation helpful? Give feedback.
-
Thanks for that! I am testing it and it works like a charm. For reference, it works even if the labels have UTF emojis on them (which was my current concern after we "beautified" them these past days. Sample: Truly appreciated, this is going to be of great help. |
Beta Was this translation helpful? Give feedback.
We've now deployed the generic issue search badge so you can now make this badge (and many others) using a custom query:
- https://img.shields.io/github/issues-search/TheIOFoundation/ProjectLockdown?query=is%3Aopen%20is%3Aissue%20label%3A%22Need%3A%20Position%22%20label%3A%22Stage%3A%20Ready%22
to customise the label:
- https://img.shields.io/github/issues-search/TheIOFoundation/ProjectLockdown?query=is%3Aopen%20is%3Aissue%20label%3A%22Need%3A%20Position%22%20label%3A%22Stage%3A%20Ready%22&label=custom%20label
so I'm going to mark this as answered