Hello devs,

since there was a discussion on foreman-dev IRC channel recently about merging 
PRs in Foreman core even if there's some build failed, I talked to few people 
and decided to describe here what I think is current way of how it works. I'm 
also attaching one suggestion at the end that came up after the discussion.

Please, add questions, comments or simple +1 so we all know whether we're on 
the same page.

Core PR runs 7 checks - foreman, katello, codeclimate, hound, prprocessor, 
upgrade, continuous-integration/travis-ci/pr. In ideal case they are all green 
and after review, the PR is merged. There are several cases where we can merge 
even if the PR is red.

1) codeclimate is red

This can be ignored, we never agreed on using this as a hard metric for the 
PR. The motivation to introduce it was mainly to save some time to reviewer. 
We don't have to run it manually to get indications whether there's something 
introducing a big complexity [1]. From my experience it sometimes leads to 
worse code, since author splits the logic into more methods to lower e.g. 
cyclomatic complexity but it should be judged separately in every case.

2) foreman is red

This can happen because of intermittent tests failures. If the PR is clearly 
not causing new ones and commiter is aware of this error, the PR is merged 
with message like "test unrelated" comments. If we are not sure, we retrigger 
the run,

If Foreman develop branch is broken, we need to merge the PR to fix it so this 
is another exception. Usually we trigger the jenkins job manually first to see 
that the PR fixes the issue.

3) katello is red

If katello becomes red only for this PR, we analyze what causes it. Usually it 
means that we change some internal things that have impact on Katello. In such 
case, we're doing our best to send a fixing PR to Katello or we ping someone 
with better knowledge in this area. We don't merge the PR until it's resolved, 
then usually we merge both parts at the same time.

If it turns out there are more PRs that are failing with same errors, we merge 
PRs if we're sure they don't introduce new Katello failures. At this time, 
we're not blocking merges until Katello is green again. (*) here the 
suggestion applies

4) upgrade is red

this is very similar to katello job, if there's some issue in upgrade, we 
should not merge the PR. I remember though, there was a time when we knew the 
job is broken which fall under "known to be broken" category.

5) There's no 5, all the rest must be green. Sometimes hound service does not 
respond and remains in "running" state, then it's retriggered by the reviewer. 
prprocessor and travis must always be happy.

Now the promised suggestion. When we see katello/upgrade job is broken on 
multiple PRs, the first reviewer who spots it should notify the rest of 
developers about "from now on, we ignore tests XY". The ideal channel seems to 
be this list. This helps Katello devs to find out when it started, what were 
the commits that first induced it.

[1] https://groups.google.com/forum/#!topic/foreman-dev/p7ESagXwNwk

Thanks for comments

--
Marek

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to