This small app checks the schema of these gems:
https://github.com/ContinuityControl/fdic https://github.com/ContinuityControl/ncua
It uses Redis and runs rake tasks daily with heroku scheduler
Here are the current statuses of the gems:
- install redis - use your favorite package manager or this link.
- run
redis-server
- run
bundle
- run
REDIS_URL=redis://127.0.0.1:<your-redis-port> rake validate:fdic_schema validate:ncua_schema
- run
ruby ./app.rb
- ??
- Profit!
The app checks the schema of the fdic and ncua gems using their .validate_schema!
methods.
It's running on heroku, but the root page doesn't do anything. Instead, the app exposes the following endpoints:
/{fdic,ncua}/status
-> returns the JSON status of the fdic and ncua APIs in the following format:
{
"schema_good" : true
}
// OR
{
"schema_good" : false
}
/{fdic,ncua}/badge
returns an svg status badge of the current state of the APIs. You saw these at the top of this README.
The app is scheduled to run daily at 4:00 UTC. It runs a series of rake tasks to hit the FDIC and NCUA APIs, test their status, and email our engineering team if either the APIs have changed or the app's versions of the gems in question are out of date.
feel free to play around with these rake tasks. Note that you need sendgrid credentials and some to and from email addresses passed in as arguments to the rake tasks.
$ rake -T
rake mail:if_gem_version_stale[to_email_address] # test the current cached status, and email if it's bad
rake mail:if_schema_invalid[to_email_address] # test the current cached status, and email if it's bad
rake validate:fdic_schema # test the FDIC's api
rake validate:ncua_schema # test the NCUA's api
Bug reports and pull requests are welcome on GitHub at https://github.com/ContinuityControl/api_schema_validator.
The code is available as open source under the terms of the MIT License.