webcompat.com icon indicating copy to clipboard operation
webcompat.com copied to clipboard

Exclude non-moderated issues from the lists by default

Open magsout opened this issue 6 years ago • 14 comments

Maybe we should exclude non-moderated issues by default from lists, and maybe add new filter ? just to avoid lot of noises?

  • homepage: https://webcompat.com/
  • list: https://webcompat.com/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc

magsout avatar Jan 13 '20 15:01 magsout

See #3145 - we'll keep unmoderated issues in needstriage, but there will be a label we can exclude them with.

miketaylr avatar Jan 13 '20 20:01 miketaylr

@magsout in #3145 I added the keyword action-needsmoderation

karlcow avatar Jan 15 '20 06:01 karlcow

@magsout in #3145 I added the keyword action-needsmoderation

This is landed in master now.

miketaylr avatar Jan 16 '20 03:01 miketaylr

@miketaylr o cool, thanks. I'll take a look.

magsout avatar Feb 03 '20 11:02 magsout

https://webcompat.com/issues we need to filter these out.

karlcow avatar Jun 10 '20 03:06 karlcow

@karlcow what's the best case:

  • added a select?
  • excluded by default without no element?

magsout avatar Jun 10 '20 17:06 magsout

exclude by default. It's useless for the people who checks the website. Later on we could open an issue on how many bugs are in the moderation queue, if we feel so.

karlcow avatar Jun 11 '20 00:06 karlcow

@karlcow how does it work. How i can use the keywords action-needsmoderation in the request to avoid issues in moderation? I have to use the param q ?

magsout avatar Jun 11 '20 08:06 magsout

@karlcow how does it work. How i can use the keywords action-needsmoderation in the request to avoid issues in moderation? I have to use the param q ?

Looking at the code, it's slightly confusing: https://github.com/webcompat/webcompat.com/blob/ed96b3d8169babd0d1260a638283b7f4bbee3bb8/webcompat/static/js/lib/models/issue.js#L153

So that's saying the URL is constructed here:

https://github.com/webcompat/webcompat.com/blob/ed96b3d8169babd0d1260a638283b7f4bbee3bb8/webcompat/static/js/lib/issue-list.js#L347-L351

It's maybe enough to add a q param there with something like "-label:action-needsmoderation"?

But I think we also need to check we're not overwriting the q param used during search in https://github.com/webcompat/webcompat.com/blob/ed96b3d8169babd0d1260a638283b7f4bbee3bb8/webcompat/static/js/lib/issue-list.js#L342

https://github.com/webcompat/webcompat.com/blob/ed96b3d8169babd0d1260a638283b7f4bbee3bb8/webcompat/static/js/lib/models/issue.js#L281

(this code is such a mess at this point 😓)

miketaylr avatar Jun 11 '20 20:06 miketaylr

@miketaylr -label:action-needsmoderation it is what i'm looking for. thanks.

magsout avatar Jun 12 '20 10:06 magsout

Im' a bit confused about the code (because of me, not the code), but if I understand. Right now, there are conditions:

this first condition https://github.com/webcompat/webcompat.com/blob/6e220dd777539877ecb10a8715b77445a112d445/webcompat/static/js/lib/issue-list.js#L311

So, I writed something like that in doGitHubSearch():

    params.q = params.q
      ? `${params.q} -label:action-needsmoderation`
      : "-label:action-needsmoderation";

It's working only when the user added query param. But it's a good start (I guess?).

So after that I thought it was better to remove the queryMatch in the test if (!this._isLoggedIn && queryMatch) { because of the condition in the endpoint https://github.com/webcompat/webcompat.com/blob/6e220dd777539877ecb10a8715b77445a112d445/webcompat/api/endpoints.py#L84 But I don't know if it's a good thing using the API of github every times a user is not logged, maybe there is a limite rate?

It seems there is a bug, because sometimes the local api is fetch http://127.0.0.1:5000/api/issues?page=1&per_page=50&state=open&stage=all&sort=created&direction=desc I need to figure out why.

Second case, if the user is logged, I can't test right now, I get again an error when I tried to log in.

magsout avatar Jun 13 '20 06:06 magsout

Or we could modify this

https://github.com/webcompat/webcompat.com/blob/745537d9d62acd2939eaeeb0fbee2d3cedbf9289/webcompat/api/endpoints.py#L120-L135

so that we only return the results for a modified needstriage list (without the action moderation) when we are requesting /issues/category/needstriage.

Note that this is the list we want to address:

https://github.com/webcompat/web-bugs/issues?q=is%3Aopen+is%3Aissue+milestone%3Aneedstriage+-label%3Aaction-needsmoderation+

not the stage=all but only the milestone%3Aneedstriage

karlcow avatar Jun 15 '20 05:06 karlcow

So I tried to test the API with

https://api.github.com/repos/webcompat/webcompat-tests/issues?milestone=1&-labels=action-needsmoderation

and the API doesn't understand the -.

One way to pull this out would be to create a new milestone for moderation.

We can't also say everything but webcompat-bot…

and I also tried with GraphQL without success too. Because GraphQL has similar limitations.

Capture d’écran 2021-01-25 à 14 14 54

(on the other hand GraphQL would be super practical to get only what we want when we have a positive query).

I didn't try the search API yet. And we could try where we do the filtering ourselves. All the issues we receive we remove the ones with the label action-needsmoderation.

karlcow avatar Jan 25 '21 05:01 karlcow

I didn't try the search API yet.

I think it's only possible via the Search API.

miketaylr avatar Jan 25 '21 14:01 miketaylr