Herald has the wrong list of "Author's Projects"
Open, Needs TriagePublic

Description

I have a Herald rule that triggers when an author that belongs to a project creates a differential review.

I just had an author submit a review that belongs to a specific project, and the rule failed.

Here are the details:

The Herald Transcript:

Object Transcript	
Object Name
   [redacted]
Object Type
   differential
Object PHID
   PHID-DREV-cvw2r2ieqtglneyxbktf
Object Link
   [redacted]
Run At Epoch
   July 19th, 1:19:59 PM
Run On Host
   [redacted]
Run Duration
   35 ms
Field: Affected files
   [redacted]
Field: Repository
   PHID-REPO-3p2nkuxizgwvohnvyqhd
Field: Author's projects
   PHID-PROJ-rwnekrajar5m6diprobx PHID-PROJ-57zl354uoo6jmbrxdlk4 PHID-PROJ-mvufznfaunwayvajirkf
Field: Changed file content
Field: Added file content
Field: Affected packages
Field: Affected package owners
Field: Projects
NOTE: The list of projects that Herald sees...My list of projects for that author is different that herald's list:

Some debugging:
I want to confirm the author PHID from the differential request, so I call differential.query. Here are the relevant bits:

{
  "0": {
    "id": "1169",
    "phid": "PHID-DREV-cvw2r2ieqtglneyxbktf",
    "authorPHID": "PHID-USER-i3vrb63exn73dtqf5mdg",
    "status": "3",
    "auxiliary": {
      "phabricator:projects": [],
      "phabricator:depends-on": []
    },
  }
}

So, we have the author PHID (PHID-USER-i3vrb63exn73dtqf5mdg), now I want to see what projects they are a member of, so I call:

$ echo '{
  "members": [
    "PHID-USER-i3vrb63exn73dtqf5mdg"
  ]
}' | arc call-conduit --conduit-uri <url> --conduit-token <conduit-token> project.query

and I get the three projects (by PHID):

  • PHID-PROJ-mvufznfaunwayvajirkf
  • PHID-PROJ-57zl354uoo6jmbrxdlk4
  • PHID-PROJ-quo7cpreceuh6hnor3pw
What? That's not the same list of projects that Herald got? How is that possible?

here's the somewhat complete response:
(some bits redacted)

{
  "data": {
    "PHID-PROJ-mvufznfaunwayvajirkf": {
      "id": "40",
      "phid": "PHID-PROJ-mvufznfaunwayvajirkf",
      "members": [
        "PHID-USER-i3vrb63exn73dtqf5mdg",
        "PHID-USER-qtmkswx7uabusa24ttpr",
        "PHID-USER-xdhis3v6664sogsqk7sy",
        "PHID-USER-zzbzmxianeh37gp6poix"
      ],
    "PHID-PROJ-57zl354uoo6jmbrxdlk4": {
      "id": "41",
      "phid": "PHID-PROJ-57zl354uoo6jmbrxdlk4",
      "members": [
        "PHID-USER-xdhis3v6664sogsqk7sy",
        "PHID-USER-i3vrb63exn73dtqf5mdg",
        "PHID-USER-qtmkswx7uabusa24ttpr",
        "PHID-USER-zzbzmxianeh37gp6poix"
      ],
    "PHID-PROJ-quo7cpreceuh6hnor3pw": {
      "id": "22",
      "phid": "PHID-PROJ-quo7cpreceuh6hnor3pw",
      "members": [
        "PHID-USER-xdhis3v6664sogsqk7sy",
        "PHID-USER-i3vrb63exn73dtqf5mdg",
        "PHID-USER-qtmkswx7uabusa24ttpr",
        "PHID-USER-zzbzmxianeh37gp6poix"
      ],
  },
  "slugMap": [],
  "cursor": {
    "limit": 100,
    "after": null,
    "before": null
  }
}
avivey added a subscriber: avivey.Jul 19 2016, 10:17 PM

Is there anything special about the projects PHID-PROJ-rwnekrajar5m6diprobx and PHID-PROJ-quo7cpreceuh6hnor3pw? Is any of them secret?

avivey renamed this task from Herald has the wrong list of project authors to Herald has the wrong list of "Author's Projects".Jul 19 2016, 10:17 PM

yes... they're secret :)

If you're not allowed to see PHID-PROJ-rwnekrajar5m6diprobx, it will not be returned from project.query. Herald should be seeing all projects though, so PHID-PROJ-quo7cpreceuh6hnor3pw missing is strange.

Is it possible the user just joined PHID-PROJ-quo7cpreceuh6hnor3pw after the diff?

jsturgeon added a comment.EditedJul 20 2016, 12:21 AM

no.. they've been a part of that project since the beginning

One other odd note though is that the project that *does* show up in the Herald transcript and is *not* in the 'project' query is a sub-project of the project they belong to.

eadler added a project: Restricted Project.Sep 15 2016, 6:03 PM