Validating Looker LookML & content with CircleCI

  • 8 March 2018
  • 4 replies

We’re working to have the smoothest development workflow with Looker and Github. As such, I’ve been trying to find a way to implement CircleCI checks on our repo’s pull requests. Ideally, we should be able to validate two scenarios:

  • LookML errors

  • Content errors (broken looks, dashboards due to a dimension name change for example).

However, I could not find any endpoint in the Looker API relating to the Content Validator. Am I missing something? This would be really nice to have!

4 replies

Hey there Gustavo, there’s currently no endpoint for the content validator, but the lookml validator can be run using the /api/3.0/projects/{project_id}/validate endpoint outlined here, which will return a list of the lookml errors in the project specified.

I can bring up the idea of a content validator with the product team, for integration validation purposes.

I see Will, thanks for the suggestion! However is it possible to pass a specific branch to this endpoint? Or will it only validate master?

I know people need to validade their code before committing, but we’d like to have that check in GitHub just to be sure!

It would also be really handy if the content validator was available via command line, validating against a specific development branch. That way, breaking pull requests (code that breaks any look) wouldn’t be allowed to merge (via github checks).

Yeah, you can switch to dev mode using the update_session call, giving it “dev” as the workspace id. This will switch all calls to run against the dev branch of the user whose creds are being use to log in. Then you can just run that same validate_project call to get the LookML errors.

For now, the content validator can only be run from the front-end, but I’ll pass along the interest in an API endpoint for it, I’m sure you’re not the only one who would find it useful.

Is there a way to validate a specific branch? We don’t use dev branches so session won’t work. The use case would be wanting CircleCI checks to run for pull requests for feature branches, master and production