Testing rake tasks with rspec

This blog post is a continuation of this thread. On trying to write a spec for one of the rake tasks, when trying to invoke the same rake tasks within the same @rspec contexts, for different flows, weirdly the tests failed if I ran the whole suite, but would pass if I ran them separately. — Tasdik Rahman (@tasdikrahman) August 12, 2020 So for example # ./lib/tasks/foo_task.rake desc 'Foo task' namespace :task do task :my_task, [:foo, :bar] => [:baz] do |task, args| ... # does my_task ... end end Now if we try writing a spec a for it ...

October 20, 2020 · 3 min · Tasdik Rahman

A few things about database migrations

This blog post is a continuation of these two threads. A few things about database schema changes. (1/n) — Tasdik Rahman (@tasdikrahman) October 17, 2020 This is where @rails active record migrations really shine. I find it's UX super clean. (1/n)https://t.co/vA6Jb345yc — Tasdik Rahman (@tasdikrahman) October 18, 2020 The schema of your relational database, will change over time for your application. Trying to introduce these changes from dev setup -> integration/UAT -> production env, in a clear, consistent and repeatable manner, would definitely add value in trying to maintain repeatability across different environments. ...

October 18, 2020 · 6 min · Tasdik Rahman

The making of bhola - your cert expiration overseer - Part 1

You might have already seen me writing a bit about bhola already on twitter, I wrote a little bit about why I have been building bhola. This post is more of a continuation to this tweet and what I envision it to be moving forward. Do you sometimes wake up, with a call by someone from your team, telling you some SSL cert has expired? Do you keep track of SSL cert expirations on your to do notes or excel sheets? Would you like to be on top of such x509 cert renewals? https://t.co/MVFRZCUlZN is for you (1/n) pic.twitter.com/pj8JHJEkje ...

October 8, 2020 · 7 min · Tasdik Rahman

Structured logging in Rails

This post was originally published in Gojeks engineering blog, here, this post is a cross post of the same If you are on rails, you would have noticed that the rails logs which you get by default are quite verbose and spread across multiple lines, even if the context is of processing just one simple controller action. What I will discuss in this post is how can one sanitize the logs, without losing out on information along with how you can add additional information for your log lines to make full use of the querying features of your logging platform. ...

July 7, 2020 · 6 min · Tasdik Rahman

Introducing Kingsly — The Cert Manager

This was originally published under Gojek’s engineering blog by me, this post is a repost. There’s one thing all devices connected to the Internet have in common — they rely on protocols called SSL/TLS to protect information in transit. SSL/TLS are cryptographic protocols designed to provide secure communication over insecure infrastructure. Any communication over the public internet should be encrypted, for which we need SSL certificates. There are many cases for public communication in GOJEK as well. Some of them are listed below: ...

April 22, 2020 · 7 min · Tasdik Rahman