My name is Ismael Chang Ghalimi. I fight against software illiteracy. I am a stoic, and this blog is my agora.

LESS validation

Our code server now offers validation for LESS stylesheets. Here is its updated list of features:

  • Code serving (powered by Node.js)
  • Code versioning (powered by GitHub)
  • LESS code validation (powered by LESS)
  • JavaScript code validation (powered by JSHint)
  • JavaScript code minification (powered by UglifyJS)
  • JavaScript code obfuscation (powered by UglifyJS)
  • Email notification (powered by SendGrid)
  • API documentation (powered by JsDoc)

Error reporting

Error reporting might not be the most exciting feature, but it has to be one of the most useful. Therefore, we decided to make it right. The first version deployed on our code server  displayed errors in plain text on a web page. The second that was released just a minute ago turns it into a clean JSON file with hyperlinks highlighting faulty code lines directly on GitHub.

Superb!

632 fixes later…

After a busy afternoon, we fixed all 632 errors that were caught by JSHint. Our code server is turning into a super powerful tool, with the addition of automatic email notification when new code is pushed to GitHub with any error in it. What’s even better is that the email is only sent to the developer responsible for the faulty commit, so that other developers aren’t distracted.

To summarize, here is what we get at every commit, automatically:

  • Code serving (powered by Node.js)
  • Code versioning (powered by GitHub)
  • Code validation (powered by JSHint)
  • Code minification (powered by UglifyJS)
  • Code obfuscation (powered by UglifyJS)
  • Email notification (powered by SendGrid)
  • API documentation (powered by JsDoc)

Once we add some kind of mirroring, we should be good for Version 1.0.

Code server

Our code server is slowly but surely becoming a critical piece of our architecture. We started with simple redirection from GitHub, then added minification, and finally implemented documentation. Moving forward, we expect the following functions to be fulfilled by this component:

  • Code fetching (from GitHub)
  • Code serving (with authentication)
  • Code mirror synchronization
  • Code validation
  • Code minification
  • Code obfuscation
  • API documentation

Fault tolerance

This morning, our code server hosted by Heroku is unavailable. The problem seems to come from Heroku, since devcenter.heroku.com is down as well. This is yet another reminder of Murphy’s Law of Cloud, and that we must design our architecture accordingly.

As far as code serving is concerned, we could adopt one of these strategies:

  1. Download code from GitHub
  2. Setup mirrors for our code server
  3. Revert to cached code when real-time code updates are unavailable

Option #1 could create some security issues.

Option #2 is most likely the easiest to implement.

Option #3 would be an excellent addition to Option #2.

Consequently, we will most likely go for Option #2 first, then add Option #3 to make it bulletproof. Obviously, all this is adding quite a bit of complexity, but that’s the price to pay for fault-tolerant applications in the cloud.