build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

Continuous integration

Modified 2019-09-22 by Andrea Censi

These are the conventions for the Duckietown repositories.

Never break the build

Modified 2019-09-22 by Andrea Censi

The Software and the duckuments repository use “continuous integration”.

This means that there are well-defined tests that must pass at all times.

For the Software repository, the tests involve building the repository and running unit tests.

For the duckuments repository, the tests involve trying to build the documentation using make compile.

If the tests do not pass, then we say that we have “broken the build”.

We also say that a branch is “green” if the tests pass, or “red” otherwise.

If you use the Chrome extension Pointless, you will see a green dot in different places on Github to signify the status of the build (Figure 5.1).

green dot is good
The green dot is good.

How to stay in the green

Modified 2019-09-22 by Andrea Censi

The system enforces the constraint that the branch master is always green, by preventing changes to the branches that make the tests fail.

We use a service called CircleCI. This service continuously looks at our repositories. Whenever there is a change, it downloads the repositories and runs the tests.

(It was a lot of fun to set up all of this, but fortunately you do not need to know how it is done.)

At this page you can see the summary of the tests. (You need to be logged in with your Github account and click “authorize Github”).

dashboard
The CircleCi service dashboard, available at this page.

How to make changes to master: pull requests

Modified 2019-09-22 by Andrea Censi

It is not possible to push on to the master branch directly.

See the Github documentation about pull requests to learn about the general concept.

The workflow is as follows.

(1) You make a private branch, say your name-devel.

(2) You work on your branch.

(3) You push often to your branch. Every time you push, CircleCI will run the tests and let you know if the tests are passing.

(4) When the tests pass, you create a “pull request”. You can do this by going to the Github page for your branch and click on the button “compare and pull request” (Figure 5.3).

Compare and pull request button

(5) You now have an opportunity to summarize all the changes you did so far (Figure 5.4). Then click “create pull request”.

Preparing the pull request

(6) Now the pull request has been created. Other people can see and comment on it. However, it has not been merged yet.

At this point, it might be that it says “Some checks haven’t completed yet” (Figure 5.5). Click “details” to see what’s going on, or just wait.

Wait for the checks to finish

When it’s done, you will see either a success message (Figure 5.6) or a failure message (Figure 5.7).

The tests are done

The tests have failed

(7) At this point, you can click “squash and merge” to merge the changes into master (Figure 5.8).

The final step

Troubleshooting

Modified 2019-09-22 by Andrea Censi

If you see a message like “merge failed” (Figure 5.9), it probably means that somebody pushed into master; merge master into your branch and continue the process.

Merge failed