
A simple web-based Todo List application designed as a practical target for **End-to-End Testing** and **AI-Driven CI/CD Pipeline Troubleshooting** using **GitLab Duo**.
- 🤖 Playwright Todo App: A Target for CI/CD Troubleshooting
Welcome to the documentation for the Playwright Todo App.
This repository is utilized as the application under test (AUT) for demonstrating advanced CI/CD Pipeline Optimization and Troubleshooting. It features a modern, refactored codebase built with clean architecture principles, making it an ideal subject for robust End-to-End (E2E) testing and subsequent AI analysis of failures.
The primary focus of this project's CI pipeline is the integration of the GitLab Duo AI tool, which analyzes complex test failures and security reports to provide actionable recommendations.
This repository is designed to simulate the challenges addressed in the "AI-Driven Pipeline Optimization & Troubleshooting with GitLab Duo" presentation, specifically:
The CI/CD configuration includes a dedicated stage, typically named duo_troubleshoot
, which executes when a prior stage (like e2e_tests
or security_scan
) fails.
When Playwright E2E tests fail, this stage uses GitLab Duo CLI to analyze the lengthy, complex job logs.
- AI Output: Provides a concise, human-readable summary of the failure, identifies the likely root cause, and suggests code remediation steps, significantly reducing Mean Time To Resolution (MTTR).
When dependency or SAST scans (like npm audit
) produce dense technical reports, this stage simplifies the output.
- AI Output: Explains the vulnerability's impact, assigns a clear severity level, and outlines the precise steps needed to patch the issue.
The TO-DOIT App is a standard web-based task manager featuring:
- CRUD Operations: Easily add, edit, and delete tasks.
- Status Management: Mark tasks as pending or completed.
- Filtering: Filter tasks by status (All, Pending, Completed).
- Theme Switching: A persistent theme switcher.
Follow these steps to set up and run the application locally:
- Node.js (LTS recommended)
- A modern web browser
- Git
-
Clone the Repository:
git clone git@github.com:abdellatif-laghjaj/todo-list.git
-
Navigate and Install Dependencies:
cd todo-list npm install # Assuming npm is the package manager after refactoring
-
Run the Application (for local testing): Open the
index.html
file directly in your preferred web browser.
This project utilizes modern web technologies:
- Core Language: Vanilla JavaScript
- Styling: Tailwind CSS and Daisy UI (via CDN).
- Testing (External): Designed to be run with Playwright (though not contained in this repository, this is the environment for the Duo demo).
- CI/CD Tooling: GitLab CI/CD and GitLab Duo CLI.
The underlying codebase was heavily refactored to serve as a robust, maintainable target for testing. Key architectural highlights include:
- Single Responsibility Principle (SRP): Logic is strictly separated into dedicated classes:
TodoManager
: Handles all business logic and state management.UIManager
: Handles all DOM manipulation and event listening.ThemeSwitcher
: Manages theme state (using the Singleton Pattern).
- Design Patterns:
- Singleton Pattern (
ThemeSwitcher
): Ensures centralized control over the application's theme. - Strategy Pattern (
TodoItemFormatter
): Ensures consistent, interchangeable formatting logic for tasks.
- Singleton Pattern (
This project is licensed under the MIT License.