Page MenuHomePhabricator

Run CircleCI tests as the diff owner, not the Build Plan owner
Closed, ResolvedPublic

Description

Firstly, thank you so very much for adding CircleCI integration to Phabricator.

My team has noticed that the CircleCI tests from Phabricator are run as the user who created the build plan, rather than the owner of the diff. Would it be costly to adjust that behavior to run the tests as the Diff owner instead?

Event Timeline

We don't currently tell CircleCI which user to run as explicitly -- I'd guess the user the build runs as is determined by the token we use.

To run as the revision owner, every user would need to set up an API token for CircleCI, and we would be unable to run builds for users who had not provided a token (or have to fall back to the default token). This isn't impossible, but is probably a bit of a logistical nightmare for large teams since every engineer will need to be coaxed through retrieving a token from CircleCI's interfaces.

What specific problems is this causing? Is it just clogging up some UI for the plan owner? Can you, say, create a builder sort of user, generate a token for them, and then let all the builds run as that user?

If the problem is that the wrong user is being notified by CircleCI and CircleCI normally runs builds as the commit author, we'd be happy to pass some kind of runAsCommitAuthorNotTheCurrentAPIUser=true flag, but I don't believe any such flag exists in the API so you'd have to convince them to add it.

It's not causing enough pain for me to jump up and down about this. Thank you for clarifying @epriestley!

Macro daftpunk:

epriestley claimed this task.

Sounds good -- yell at us (or maybe CircleCI?) if you change your mind.