unicef / magicbox

A platform that uses real-time data to inform life-saving humanitarian responses to emergency situations
https://www.unicef.org/innovation/Magicbox
BSD 3-Clause "New" or "Revised" License
86 stars 16 forks source link

Set up automatic CI testing for new pull requests #6

Closed jwflory closed 6 years ago

jwflory commented 6 years ago

Summary

Set up continuous integration (CI) to build new pull requests against MagicBox projects

Background

CI is important for a project because it prevents simple mistakes or oversights making it into a production code base. Effective test cases can be written to hook into any of the CI platforms available, such as TravisCI, CircleCI, and others.

CI is helpful for advanced contributors (especially in a small project) because of limited development time and the ease of making mistakes. It happens. It's a safeguard to help prevent mistakes from entering "production" code.

CI is helpful for new contributors because it provides instant feedback if a pull request breaks the project or not. A contributor can see feedback and a stacktrace of what went wrong so they can fix their issue or ask for specific help if needed (instead of waiting for a maintainer to review the PR and give that feedback).

Details

There are general test cases available for many programming languages. Those could be set up easily. More advanced CI would encourage contributors to write test cases into the code, and then CI platforms could execute those test cases.

Each MagicBox project will likely needs its own unique CI configuration. If developer bandwidth is low, some projects that are more "publicly visible" should be prioritized for CI coverage.

Outcome

Pull requests to a MagicBox project are tested and verified to build successfully before a maintainer reviews a new contribution; this helps prevent bad code making it into the code base and provides immediate feedback to new contributors to fix oversights or mistakes

jwflory commented 6 years ago

Update: TravisCI is set up and working with aggregate_airport_mobility. It's a work in progress for magicbox-open-api. Hopefully will be done tomorrow.

jwflory commented 6 years ago

Where we are now

Where we want to go

When it will be done

Hoping to close out the CodeClimate integrations by end of day Friday, but could go into next week depending when we get a chance to discuss. To close out this ticket, we need to review the coverage checks as a team and determine what pass/fail criteria are.

jwflory commented 6 years ago

Closing as complete

Initial CI coverage is now set up on most repos and all critical / core repos. The core repos also have CodeClimate health checking to help guide us to follow best practices. The initial work of setting these tools up is done.

We may need to make tweaks and changes, but I think it goes beyond the life of this issue. We will address them as the need arises.