Skip to content
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

Filed issue details not displayed (because logged-in non-collaborator users cannot set milestones) #1851

Closed
pavangudiwada opened this issue Oct 31, 2017 · 12 comments
Assignees

Comments

@pavangudiwada
Copy link

Went to webcompact and reported a bug the reported page is blank. I should have found the sharing option and other details.
screenshare

@miketaylr
Copy link
Member

@pavangudiwada thanks for the report! That seems bad.

webcompat/web-bugs#12961 is the bug you filed, but for some reason the milestone wasn't set?

@miketaylr
Copy link
Member

But I see there are issues reported after that that succeeded:

https://webcompat.com/issues/12969, for example. I wonder why this failed. I'll try to look in logs.

@miketaylr
Copy link
Member

webcompat/web-bugs#12970 is another instance where milestone wasn't set.

💣

@miketaylr
Copy link
Member

I don't see anything weird in logs.

I do see webcompat/web-bugs#12970 in webcompat.log:

2017-10-31 13:51:25,709 tracking XXX.XXX.XX.XXX http://www.dragonframe.com/

But that's just logging we got a bug report for that domain. Time to check webhooks logs.

@miketaylr
Copy link
Member

The webhook payload for 12970 creation worked: 954426c0-be42-11e7-8d18-0954797c7279

https://github.com/webcompat/web-bugs/settings/hooks/7890332

(it also had a browser-firefox label set correctly, so that seems normal)

@miketaylr
Copy link
Member

@karlcow any ideas? Maybe we should add some logging somewhere to see if setting the milestone ID fails during issue creation?

Or hard-code the "needstriage" ID as a fallback?

https://github.com/webcompat/webcompat.com/blob/master/webcompat/form.py#L248

@miketaylr
Copy link
Member

That seems to be the issue here.

When it works, and we get an issue creation webhook payload, milestones looks like this:

"milestone": {
      "url": "https://api.github.com/repos/webcompat/web-bugs/milestones/2",
      "html_url": "https://github.com/webcompat/web-bugs/milestone/2",
      "labels_url": "https://api.github.com/repos/webcompat/web-bugs/milestones/2/labels",
      "id": 2845621,
      "number": 2,
      "title": "needstriage",
      "description": "Issues in needs for triage. Next step is diagnosis.",
      "creator": {
        "login": "karlcow",
        "id": 505230,
        "avatar_url": "https://avatars0.githubusercontent.com/u/505230?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/karlcow",
        "html_url": "https://github.com/karlcow",
        "followers_url": "https://api.github.com/users/karlcow/followers",
        "following_url": "https://api.github.com/users/karlcow/following{/other_user}",
        "gists_url": "https://api.github.com/users/karlcow/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/karlcow/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/karlcow/subscriptions",
        "organizations_url": "https://api.github.com/users/karlcow/orgs",
        "repos_url": "https://api.github.com/users/karlcow/repos",
        "events_url": "https://api.github.com/users/karlcow/events{/privacy}",
        "received_events_url": "https://api.github.com/users/karlcow/received_events",
        "type": "User",
        "site_admin": false
      },
      "open_issues": 26,
      "closed_issues": 1,
      "state": "open",
      "created_at": "2017-10-18T01:25:36Z",
      "updated_at": "2017-10-31T14:41:05Z",
      "due_on": null,
      "closed_at": null
    },

When it fails (twice we know about so far), milestone is null (see payload 550f26b0-bdeb-11e7-80d1-5bb335ce0a33 )

    "milestone": null,

@miketaylr
Copy link
Member

webcompat/web-bugs#12975 is another one that just failed. :(

@miketaylr
Copy link
Member

Hm, crazy theory -- are these only failing for github authed users? A quick search of webhook payloads suggests that might be true.

@miketaylr
Copy link
Member

Hm, crazy theory -- are these only failing for github authed users? A quick search of webhook payloads suggests that might be true.

Oh wait. This should fail for any non-collaborator, because the milestone is being set as the logged in user. We missed this because we were testing as ourselves, and we're collaborators. 🙈

We have to set the milestone as webcompat-bot, in a webhook (labeler, or create a new one) for this to work.

@miketaylr miketaylr changed the title Filed issue details not displayed Filed issue details not displayed (because logged-in non-collaborator users cannot set milestones) Oct 31, 2017
@miketaylr miketaylr self-assigned this Oct 31, 2017
miketaylr added a commit that referenced this issue Oct 31, 2017
…estone in the payload.

This changes the API endpoint and the method used.
miketaylr added a commit that referenced this issue Oct 31, 2017
miketaylr added a commit that referenced this issue Oct 31, 2017
@karlcow
Copy link
Member

karlcow commented Oct 31, 2017

Ah excellent find. <3

@karlcow karlcow closed this as completed in 84a5587 Nov 1, 2017
@miketaylr
Copy link
Member

Thanks again for reporing @pavangudiwada!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants