Page MenuHomePhabricator

CI setup blocked by commit import bug?
Closed, ResolvedPublic

Description

Since the staging commit is not imported (see T10799), I believe this is currently preventing me from setting up CI with Herald/Harbormaster/Jenkins.

I set up a Herald rule on the staging repo but it never gets triggered (I believe) because the commit is not imported.

Am I setting this up wrong or is this setup not possible until this bug is fixed? Thanks!

Event Timeline

I am not sure exactly what you are trying to achieve, but if you want to do CI with differentials, just set up a herald rule to trigger a build plan when a diff is created / updated. This will trigger whether the staging commits are imported by phabricator or not.

If you want to build also the commits that are imported, you can do that too, but if you want to build diffs pre-integration, that's what herald should be triggering on, not commits.

I don't think this is a bug.

Thanks for the reply. I may be confused then. Based on the Harbormaster documentation I understood that staging was required to setup CI. Please correct me if I'm wrong. This is my first time setting this up.

I'm trying to use Herald/Harbormaster/Jenkins to run builds on the revisions before they are integrated.

Staging is required (well, not strictly required, but strongly recommended) to setup CI.

However, if you want to build revisions, you should be using Herald to trigger on Differential Revisions, not on commits to the staging area. Even if you built staging area commits, the build status won't be reported on the corresponding revisions (since they were never involved in the build), so it won't be useful to you.

Here's the Herald rule we use on this install to build revisions, if it's helpful:

Screen Shot 2016-04-14 at 8.07.02 AM.png (541×1 px, 74 KB)

Commits do not need to import to be built. They do need to import to trigger Herald rules, but you should not be triggering Herald rules based on staging area commits directly, so the only thing you're missing is viewing them in the web UI, which is normally not useful (you'd typically view the revision in Differential instead).

(Per T10799, T6878 is the underlying issue with why they don't import, but it's currently never materially useful to import them so this hasn't been a priority to fix. Empirically, they do not import on this install but builds work fine -- except see also T10667 for a weird special case mostly unique to this install.)

I see. The rule you showed was actually exactly how I set this up before adding a staging repo.

I guess after doing this with and without a staging repo, I don't get what the staging directory adds to the process since the trigger and build seem to work regardless if there is a staging repo.

The staging repository allows you to git fetch the change to the build server (which is easier and more reliable), instead of using arc patch.

Got it, thanks!

Just as constructive criticism, it might help to make that more explicit in the Harbormaster doc. git fetch wasn't mentioned on that page.

Thanks for all you guys' hard work!

Here's the section that's intended to explain it. This applies to Mercurial, too (in theory) which is why we don't explicitly mention git fetch.

Screen Shot 2016-04-14 at 2.06.52 PM.png (156×850 px, 39 KB)

How could we rewrite this to be more clear?

I see, it makes sense now that I know what's going on. Not sure if there's a better way to write it honestly.

As a side note, I noticed the phabricator/jenkins plugin from uber uses arc patch by default. I'll have to ask them if they have a simple way to configure it for staging and git fetch instead.

Thanks again.

epriestley claimed this task.

You don't need any plugins with staging. Just set up a parameterised build, use a parameter for the commit and call directly from harbormaster. That's reason for staging repos, regular git tooling can work with them.