As an intern on the Cesium team, my work this summer was divided between two projects: packaging our ESLint configuration into a shareable format and creating a GitHub bot to automate common tasks.
Style & Syntax Checking with ESLint
' quotes and never double-tick
JSHint solved this problem for a while, but it is not as flexible, configurable, and powerful as other options. So we recently moved to ESLint, a popular tool which gives us the power to standardize our code the way we want it. Each of the hundreds of rules can be full enabled, disabled, or configured with a level of granularity in order to control behavior at edge-cases.
After we moved to ESLint at the start of the summer, it became clear that these rules should apply to each of the repositories under the Cesium umbrella. I ported our configuration to an ESLint shareable config, giving us the ability to distribute and update our configuration through
npm, Node.js’ package manager. Now, each new contributor automatically downloads the latest ESLint configuration and verifies that their code adheres to our standards.
Meet the Cesium Concierge!
Every massive open-source project struggles with common challenges on GitHub. For Cesium, we usually have to do a lot of reminding. For example, we remind:
- New users to sign a Contributor License Agreement (CLA) when they submit a pull request for the first time
- Maintainers to look at pull requests that have not been updated in a certain number of days
- Contributors to update
CHANGES.mdwhen the API changes
While all of this information is in the Contributors Guide, not all new users read or know to read it.
My project was to solve these problems with a GitHub bot: Cesium Concierge. It detects when pull requests and issues are opened or closed, and then posts comments based on their properties. It can currently:
- Suggest editing
CHANGES.mdif it hasn’t been already
- Suggest editing
LICENSE.mdif files in Third-party folders are changed
- “Bump” pull requests which have not been updated in
- Ask new users to fill out the CLA by checking their GitHub name with a JSON file
- Remind users to update the forum if there are links in the issue/PR
Concierge is an open-source project built on Node.js. It uses GitHub WebHooks to efficiently respond to “events” like opened/closed pull requests, issues, etc. Using GitHub’s REST API, it chains
POST calls with request-promise to handle potential failures robustly without crashing.
Concierge is built with expandability in mind, and will gain more abilities as the Cesium team adds functionality. We hope to soon see it auto-label pull requests and issues, for example. Contributions are welcome on GitHub!