Skip to content

Features

Brian Alger edited this page Oct 4, 2018 · 1 revision

Description of features

This describe some Civet features in a little more detail. These will be configured through the civet/settings.py

Auto merge

GitLab has a nice feature where you can just press a button that will merge the current Merge Request when testing passes. Unfortunately GitHub does not currently have a similar feature.

This can be done with Civet by adding an "Auto Merge" label to a Pull Request. When Civet testing is complete it will check to see if it can do the merge itself via the GitHub API.

It checks the following:

  • It successfully passes all tests. "Failed but Allowed" jobs are not allowed on auto merge.
  • If auto_merge_require_review is set to True then an approved review must be on the Pull Request

These are configured in the repository_settings in civet/settings.py

Auto cancel on devel

On MOOSE, we do a large amount of testing on the devel branch to make sure it is good before it gets merged into the master branch. These can take quite a while (~3 hours).

If there are multiple PRs merged then we didn't to have all those tests running so we automatically cancel some of these events.

The main idea is that there is a "current event" that will try to get merged. The first PR merged will create an event that will definitely run all the jobs.

The next merged PR will run when all the jobs on the first one has started running. We do this to better utilize the build machines. Note that all these jobs have a lower priority than PR jobs.

If yet another PR gets merged then the second event gets automatically gets cancelled. The first one continues to run, as always.

If there is a job failure on one of these events then it looks back and uncancels previous events that got cancelled. This is to try to merge the last working event.

An example, with the vertical representing time:

PR #1 PR #2 PR #3 PR #4
Merged
EV #1 starts
Merged
EV #2 starts
Merged
EV #2 cancelled EV #3 starts
EV #3 has failed job
EV #2 uncancelled, starts running again EV #3 continues
Merged
EV #2 cancelled EV #3 cancelled EV #4 starts
EV #1 finishes, merges to master
EV #4 has failed job
EV #2 uncancelled, starts running again (EV #3 stays cancelled because it already has failed job)

Configuration for this behavior is in the branch_settings inside the repository_settings in civet/settings.py

Badges

We wanted a way to have additional displays of information on the repository in addition to the branch status.

The original motivation was to have a "deprecated" status for MOOSE and applications. This would allow people to quickly see what applications were using deprecated APIs in their code.

It works by associating a Civet recipe with the status. Whenever a job using that recipe is run, it will update the status for the badge.