Shopify/maintenance_tasks
51.8
Adequate · 6 November 2026
2.6k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Added executable script for Maintenance Tasks CLI
A new executable file \exe/maintenance\_tasks\ has been added to the project. This script initializes the Rails environment and invokes the Maintenance Tasks CLI, enabling users to run maintenance tasks directly from the command line.
exe · high confidence
Introduce maintenance tasks UI with secure, state-managed run controls
The engine now provides a built-in UI for managing maintenance tasks, exposing two new controllers: \TasksController\ for listing and viewing tasks (with optional auto-refresh) and \RunsController\ for creating, pausing, cancelling, and resuming task runs. The base \ApplicationController\ enforces a strict Content Security Policy (allowing only specific Bulma CDN styles and inline script hashes) and renders a 404 page for unknown tasks instead of raising errors. Users can now interact with task runs directly from the browser, with validation and enqueuing errors displayed as flash alerts.
app/controllers · high confidence
New generators for installing MaintenanceTasks and creating tasks
The MaintenanceTasks engine now provides an InstallGenerator to automatically mount the engine at /maintenance\_tasks and install migrations in the host application. Additionally, a TaskGenerator allows users to scaffold new tasks with support for CSV tasks (--csv flag) and collection-less tasks (--no-collection flag), and it automatically generates the appropriate test file (RSpec spec or ActiveSupport test) based on the host application's configured test framework.
_lib/generators/maintenance\tasks · high confidence
Architecture
Extract job execution logic into TaskJobConcern
The core logic for running maintenance tasks has been moved from the TaskJob class into a new TaskJobConcern module. This change centralizes the job lifecycle callbacks (start, shutdown, complete), error handling, cursor serialization, and enumerator building, ensuring that any custom job class overriding the default behavior can simply include this concern to maintain consistent task execution and status management.
app/jobs/concerns · high confidence
Extract run behavior into a shared concern
The logic governing the lifecycle and state transitions of a maintenance task run has been moved from the Run model into a new RunConcern module. This change centralizes the definition of run statuses (such as enqueued, running, and errored), validation rules, and persistence methods for progress and errors, making these behaviors reusable across different run implementations.
app/models/concerns · high confidence
Behavioural changes
Add frozen\_string\_literal pragma to maintenance tasks rake file
The maintenance\_tasks\_tasks.rake file now includes the frozen\_string\_literal pragma, ensuring string literals in this file are immutable by default.
lib/tasks · high confidence
Custom 404 page for missing maintenance tasks
When a user attempts to access a maintenance task that does not exist or has been deleted, the application now displays a dedicated 'Task Not Found' page instead of raising a raw error. This new view provides a clear message and a link to return to the tasks list, improving the user experience for invalid task IDs.
_app/views/maintenance\tasks · high confidence
Detailed status information for maintenance task runs
The maintenance task run info view now displays specific status details for each lifecycle stage. Users can see how long a task has been running and when it ended for cancelled, errored, and succeeded runs. For running tasks, the estimated time to completion is shown if available. Paused runs display either the remaining time or the number of items processed. Interrupted and cancelling states show brief status messages, while enqueued runs indicate they are waiting to start. Error runs now display the error class, message, and backtrace (if present) in a structured card.
_app/views/maintenance\tasks/runs/info · high confidence
Enforce valid maintenance task run status transitions
A new RunStatusValidator has been introduced to strictly enforce allowed state changes for maintenance task runs. This prevents invalid status transitions (such as moving directly from 'paused' to 'cancelling' or 'interrupted' to 'succeeded') by validating the \status\_change\ attribute against a defined set of permitted transitions, ensuring data integrity for the task lifecycle.
app/validators · high confidence
Enhanced task parameter forms and improved time display
The maintenance tasks UI now renders specific input fields (number, datetime, date, time, checkbox, or text area) based on the attribute's data type, and automatically provides a dropdown selector for parameters with inclusion validators. Additionally, the time display now shows relative time with a UTC timestamp visible on hover, and helper text indicates the timezone for datetime-local fields.
app/helpers · high confidence
Extensive configuration options and deprecation of legacy error handling
The library now exposes a wide range of new configuration attributes via \MaintenanceTasks\, allowing users to customize task namespacing (\tasks\_module\), the background job class (\job\), progress ticker delay (\ticker\_delay\), Active Storage service for CSV uploads (\active\_storage\_service\), UI parent controller (\parent\_controller\), run metadata generation (\metadata\), stuck task detection threshold (\stuck\_task\_duration\), status reload frequency (\status\_reload\_frequency\), error reporting behavior (\report\_errors\_as\_handled\), cursor serialization format (\serialize\_cursors\_as\_json\), and task staleness detection (\task\_staleness\_threshold\). Additionally, the legacy \error\_handler\ configuration is now deprecated in favor of using the Rails error reporter, with a deprecation warning issued when the old setter or getter is accessed.
lib · high confidence
Generator templates updated to support collection-less tasks and CSV processing
The Maintenance Tasks generators now produce templates for collection-less tasks (using \no\_collection\ and a parameter-less \process\ method) and CSV-based tasks (using \csv\_collection\ and a \process(row)\ method). The standard task template has been updated to include an idempotency hint in the \process\ method comments, and the generated spec and test files now conditionally structure their examples based on whether the task is collection-less or not.
_lib/generators/maintenance\tasks/templates · high confidence
Maintenance Tasks CLI and engine initialization updates
The Maintenance Tasks engine now includes a new command-line interface (CLI) allowing users to list available tasks and run them directly via the \maintenance\_tasks\ executable, with support for passing CSV data (via file or stdin) and task parameters. Additionally, the engine enforces the use of the Zeitwerk autoloader by raising an error if classic autoloading is detected, and configures a default maximum job runtime of 5 minutes for \JobIteration\.
_lib/maintenance\tasks · high confidence
New maintenance tasks UI and API routes
The application now exposes a web interface for managing maintenance tasks. Users can view a list of available tasks and access individual task details via the new routes. The configuration adds RESTful routes for tasks and their associated runs, enabling users to enqueue runs, pause running tasks, cancel tasks, and resume paused tasks through specific POST endpoints. The root path now directs to the tasks index page.
config · high confidence
New production and setup scripts with streamlined bin/rails execution
This change introduces two new executable scripts: bin/production, which automates the production environment setup by generating a secret key, precompiling assets, setting up the database, and starting the server; and bin/setup, which simplifies initial project configuration by installing dependencies and setting up the database. Additionally, bin/rails has been updated to require only rails/engine/commands instead of the full rails/all, reducing startup overhead and ensuring consistent usage of the bin/rails wrapper across the application.
bin · high confidence
Redesigned UI with dark mode support and Bulma 1.0.4 integration
The maintenance tasks interface has been completely overhauled to use the Bulma 1.0.4 CSS framework (loaded via CDN with integrity checks) and includes native dark mode support that follows the system preference. The layout now features a dedicated navigation bar, structured sections for notifications, and custom styling for form elements and code syntax highlighting. Additionally, the page refresh mechanism has been updated to use JavaScript-based partial replacement instead of full page reloads, improving the user experience during task execution.
app/views/layouts · high confidence
Redesigned run detail view with anchor links, metadata, and masked arguments
The maintenance tasks run detail page has been restructured to improve usability and security. Each run is now wrapped in a collapsible section with a unique ID, enabling direct anchor links to specific runs. The view now displays run metadata and arguments, with sensitive arguments automatically masked for security. Additionally, a dedicated section allows users to download CSV files if available, and the UI provides clearer controls for resuming, pausing, or canceling runs based on their current status.
_app/views/maintenance\tasks/runs · high confidence
Refactor task listing and introduce batch CSV processing
The task index view now sorts tasks by the most recent run first, using a new \TaskDataIndex\ class to efficiently fetch and display task status and category without loading all task classes. Additionally, a new \BatchCsvCollectionBuilder\ strategy allows tasks to process CSV files in configurable batches, improving performance for large datasets.
_maintenance\tasks · high confidence
Refactored task execution and progress reporting with new strategy and runner classes
The maintenance task execution engine has been restructured to improve modularity and user experience. A new \Runner\ module centralizes task execution, supporting CSV file attachments via Active Storage and allowing custom arguments and metadata to be passed to runs. Task collection logic is now handled by pluggable strategies (\CsvCollectionBuilder\, \NoCollectionBuilder\, etc.), enabling tasks to process CSVs in batches or run as single iterations. Progress reporting is now managed by a dedicated \Progress\ class, providing more accurate row counts for CSV tasks and clearer text updates when the actual work exceeds the estimated total. Additionally, run history pagination has been optimized using a cursor-based \RunsPage\ model to reduce database query load.
_app/models/maintenance\tasks · high confidence
Removal of legacy asset pipeline stylesheets
The application no longer includes the legacy Maintenance Tasks stylesheets or the associated asset manifest. Users relying on the previous asset pipeline configuration for these styles will no longer have them automatically compiled or linked, indicating a shift away from the Sprockets-based asset management for this component.
app/assets · high confidence
Renamed base job class to TaskJob and included TaskJobConcern
The base job class in the MaintenanceTasks engine has been renamed from ApplicationJob to TaskJob to better reflect its role as the foundation for task execution. Additionally, the class now includes the TaskJobConcern, which centralizes shared behavior previously defined in the base class, ensuring that all task jobs inherit this common functionality.
_app/jobs/maintenance\tasks · high confidence
Revamped maintenance tasks UI with auto-refresh and staleness warnings
The maintenance tasks interface has been redesigned to improve usability and visibility. The index page now groups tasks into Active, New, and Completed sections and includes a toggle to enable or disable auto-refreshing of the task list. The task show page displays a staleness warning if a task has not run recently, based on the configured threshold, and provides a dedicated section to view source code. Additionally, the UI now supports custom run data via a new \\_custom.html.erb\ partial, allowing users to extend the display of run information.
_app/views/maintenance\tasks/tasks · high confidence
Schema evolution for maintenance task runs table
The \maintenance\_tasks\_runs\ database table has undergone several structural changes to support new capabilities and improve performance. A new \cursor\_is\_json\ boolean column was added to indicate when cursor data is stored as JSON, while a \metadata\ text column was introduced to store run context information. To support larger datasets, \tick\_count\ and \tick\_total\ columns were migrated from integers to bigints, and the \cursor\ column type was changed from bigint to string. Additionally, an \arguments\ text column was added to store task inputs, and a \lock\_version\ integer column was added to enable optimistic locking. Indexing was also refined: the single-column \task\_name\ index was removed, and the composite index on \task\_name\ and \created\_at\ was replaced with a new composite index on \task\_name\, \status\, and \created\_at\ (descending) to optimize queries filtering by task status.
db · high confidence
Stop spin from taking snapshots of the repo
The .spin configuration now includes a NOSNAPSHOTS file, which instructs the spin tool to skip creating snapshots of the repository. This change prevents unnecessary snapshot generation, likely to reduce storage usage or improve performance during local development workflows.
.spin · medium confidence
Updated Gemfile variants for Rails 7.2, 8.0, 8.1, and main
The project now includes specific Gemfile variants for testing against Rails 7.2, 8.0, 8.1, and the main development branch. The Rails 7.2 variant pins Minitest to version 5 (less than 6), while Rails 8.0, 8.1, and main do not impose this restriction, reflecting Minitest 6 support in newer Rails versions. The Rails main variant also explicitly sets a JSON gem requirement of version 0 or greater.
gemfiles · high confidence
Test coverage
Added comprehensive tests for TaskJob lifecycle and concurrency handling; Added integration tests for the RunsController; Added model tests for Maintenance Tasks core components; Added sample CSV and TSV fixtures for import tests; Added system tests for task runs, task listing, and UI interactions; Added tests for Install and Task generators; Added tests for Maintenance Tasks CLI behavior; Added tests for helper methods in maintenance tasks; Added tests for maintenance task run status transitions; Enhanced test infrastructure with stricter validation and system test migration; Expanded dummy application scaffolding for comprehensive task testing; Updated dummy Rails app environment configurations; Updated dummy app initializers for testing and security; Updated dummy app test fixtures for Rails 7 and Active Storage; Updated dummy application configuration for modern Rails and RuboCop standards; Updated test dummy database schema and seed data.
Dependencies
Migrate HTML linting from better\_html to herb
The project has replaced the better\_html gem with herb for HTML linting and validation. This is configured via a new .herb.yml file that enables security, nesting, and accessibility validators, while RuboCop configuration has been updated to inherit from rubocop-shopify and exclude specific generated files.
(repo-wide) · high confidence
Upgrade to Rails 7.2+ and Ruby 3.3+ with dependency modernization
Maintenance Tasks now requires Rails 7.2 or later and Ruby 3.3 or later, dropping support for older versions. The gem has migrated its HTML templating from \better\_html\ to \herb\ and replaced the \pry-byebug\ debugger with the \debug\ gem. Development dependencies have been updated to include \rubocop\, \rubocop-shopify\, \capybara\, \selenium-webdriver\, and \yard\, while the \json\ gem is pinned below version 3 to maintain compatibility with released Rails versions.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 49 → 52 (+3.1)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 67 → 67 (+0.0)
- Architecture 98 → 98 (+0.0)
- Maturity 42 → 60 (+17.8)
- Readiness 66 → 65 (-0.1)
- Security 39 → 36 (-2.9)
- Domain Modelling 100 → 100 (+0.0)
- Accessibility 68 → 68 (+0.0)
Resolved (5)
- Ambiguous relationship between csv_collection and collection. csv_collection takes arguments and seems to be a factory for a builder, while collection takes no arguments. It is unclear if collection is a simplified wrapper, a different implementation, or if one is deprecated. The naming suggests collection is the primary method, but csv_collection is more specific. If collection delegates to a builder, the builder pattern is hidden inconsistently.
- Inconsistent naming conventions for state checks. Some use ? suffix (e.g., stopping?, started?), while running does not (it is a method, not a predicate). This breaks the Ruby convention where state checks are predicates. Additionally, running() vs running? ambiguity if running is a method that returns something other than a boolean.
- Off-boarding risk: anonymized user #1
- Outdated: capybara-lockstep
- Redundant/Confusing naming of 'NoCollectionBuilder' and 'NullCollectionBuilder'. Both implement the same interface as CsvCollectionBuilder but represent empty states. 'NoCollectionBuilder' takes an underscore argument _task while others take task, implying a slight behavioral difference or inconsistency in usage, but semantically they are likely identical 'empty' implementations. Having two distinct classes for 'no data' scenarios is confusing.
New (5)
- Medium CVE: [GHSA redacted] (Gemfile.lock)
- Off-boarding risk: anonymized user #1
- Outdated: csv
- Outdated: rails
- Outdated: rubocop
Changes since last survey
- 3 commits — 3 feature/other, 0 fixes
By area
- (root) — 2 commits
- .github/workflows — 1 commit
Notable commits
- change: Bump capybara-lockstep from 2.3.2 to 2.4.0 (#1572)
- change: Bump ruby/setup-ruby from 1.329.0 to 1.331.0 (#1573)
- change: Bump sqlite3 from 2.9.6 to 2.10.0 (#1571)
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Shopify/maintenance_tasks was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e8b79daf6f4d58fa03017f56ea41a262423c180a — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.