Perl Diver
Description
Five years ago, I was talking about proxy measures for code quality. Perl Diver is a project to make it easy to access those measures - using the power of GitHub Actions and GitHub Pages.
Presentations
- London Perl Workshop 2024 - 2024-10-26T09:30:00
This summary has been generated using AI
Summary of ‘Perl Diver’ Talk by Dave Cross
Overview
Dave Cross’s presentation at the London Perl Workshop introduces Perl Diver, a project designed to help developers measure and track the quality of their Perl code using modern tools. The talk explores the shift from older CI systems to using GitHub Actions and GitHub Pages to create automated and visual quality reporting systems.
Background and Context
- The project stemmed from Cross’s earlier talks in 2019 on measuring code quality through proxies like cyclomatic complexity and code coverage.
- Cross emphasized that while code quality cannot be measured directly, these proxies can reflect improvements over time.
Challenges and Solutions
- Legacy tools such as Travis CI (no longer free) and Criticize (shut down) posed challenges.
- Cross’s approach now uses GitHub Actions to automate testing and build reports that are deployed to GitHub Pages for easy viewing.
Technical Walkthrough
Continuous Integration (CI) and GitHub Actions
- GitHub Actions is an embedded CI tool in GitHub, triggered by commits, pull requests, or schedules.
- It can execute various analyses and build processes using standard VMs or Docker containers.
Perl Diver Architecture
- The project relies on a Docker container to execute test suites, Perl Critic for linting, and Devel::Cover for coverage.
- Results are stored in an SQLite database within the repository, enabling historical data tracking.
Build Radiator Concept
- Cross describes a “build radiator” as a display showing project health metrics that teams can monitor.
- Perl Diver updates these metrics and deploys a static site that displays changes over time, aiding teams and managers in oversight.
Output and Plugins
- Reports are published as static pages on GitHub Pages, making them easily accessible.
- Perl Diver uses a plugin-based system for customisation, allowing developers to implement various quality checks.
Implementation Details
- Developers must add a GitHub Actions workflow (YAML file) to their repo to use Perl Diver.
- The process involves running tests, updating the SQLite database, and deploying a report.
- The SQLite database is simple, ensuring ease of use without complex access requirements.
Future Directions and Considerations
- Cross plans for more customisation options and access controls for private projects.
- A potential cost model is being considered, with free options for open-source projects and paid plans for larger organisations.
Conclusion
Measuring code quality is essential, and Perl Diver provides a modern solution for teams to track and improve their code over time. Built on GitHub Actions and Pages, it offers automation, ease of use, and adaptability.
Q&A Highlights
- Documentation and Setup: Guides will be provided for easy integration.
- Access Control: Broader security measures are under consideration.
- Availability: The project is still in development but will be live soon.