Looker Continuous Integration: Pro tips for efficiency
By Google Cloud Tech
Key Concepts
- Looker Continuous Integration (CI): An automated testing framework for LookML projects.
- Incremental Validation: A strategy to isolate and report only errors introduced in the current development branch.
- Production Baseline: The state of the project in the production environment used as a reference point for comparison.
- Explores to Query/Exclude: Configuration parameters used to define the scope of validation.
- SQL Validator: A tool that executes queries against the database dialect to verify SQL integrity.
- Fail Fast: A configuration setting that terminates the validation process immediately upon the first detected error.
Optimizing Looker CI Performance
When implementing Looker CI, developers often face long execution times due to full model validation. In legacy projects, this is exacerbated by "inherited errors"—pre-existing issues in production that are unrelated to the current pull request. To maintain CI velocity and reduce technical debt, two primary optimization strategies are recommended:
1. Error Isolation via Incremental Validation
Incremental validation is the process of comparing the current development branch against the production baseline.
- Mechanism: The system identifies and reports only the errors unique to the branch.
- Benefit: It ignores pre-existing technical debt, allowing developers to focus exclusively on the code they are currently modifying. This significantly reduces the time spent triaging unrelated issues.
2. Scope Control through Targeted Configuration
Developers can manually define which parts of the model are validated to avoid unnecessary resource consumption. This is managed via two specific parameters:
explores_to_query: Limits validation to specific explores. The syntax requires the formatmodel_name/explore_name.explores_to_exclude: Explicitly bypasses computationally heavy explores or those currently under maintenance by other teams.- Outcome: Terminal outputs will reflect a "skipped" status for any explores not included in the targeted string, drastically reducing execution time.
SQL Validation and the "Fail Fast" Methodology
The SQL validator is resource-intensive because it requires Looker to execute queries against the underlying database dialect. To optimize this:
- Fail Fast Configuration: By setting the
fail_fastparameter totrue, the validator terminates execution the moment it encounters the first error. - Feedback Loop: Instead of waiting for a full report of all broken queries, the developer receives immediate notification of the first failure. This enables an iterative "fix and rerun" workflow, which is critical for maintaining high CI velocity in large-scale projects.
Practical Application and Best Practices
- Targeted Execution: Use
explores_to_excludeto prevent the validator from running on known problematic or heavy explores, ensuring the CI process remains a helpful tool rather than a bottleneck. - Iterative Development: Combine incremental validation with the fail-fast approach to ensure that the CI pipeline provides the fastest possible feedback loop.
- Customization: Configure validation suites based on the specific needs of the team and the complexity of the project.
Conclusion
The primary takeaway is that Looker CI should be tailored to the project's scale. By moving away from default full-model validation and adopting incremental validation, targeted scope control, and fail-fast configurations, teams can eliminate friction, reduce technical debt, and maintain a high-velocity development environment. Developers are encouraged to consult official documentation for further configuration tips to align CI processes with their specific architectural requirements.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "Looker Continuous Integration: Pro tips for efficiency". What would you like to know?