Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
54b4b73
docs: add initial baseline performance and code quality audit reports
Mike031289 Jun 24, 2026
d22cdfd
Merge pull request #5 from Mike031289/chore/initial-audit
Mike031289 Jun 24, 2026
8dfb2e5
chore: setup PHPUnit compatibility bridge and test bootstrap for PHP 7.4
Mike031289 Jun 24, 2026
0f505bb
chore: setup PHPUnit infrastructure and enable Xdebug coverage metrics
Mike031289 Jun 24, 2026
37ac82f
fix: resolve static analysis security and style issues in test bootstrap
Mike031289 Jun 24, 2026
4ad6371
Merge pull request #16 from Mike031289/chore/setup-phpunitgit
Mike031289 Jun 24, 2026
c1eb6e1
fix: adjust autoloader inclusion path structure for static analysis c…
Mike031289 Jun 25, 2026
73a0f1c
Merge pull request #17 from Mike031289/chore/setup-phpunitgit
Mike031289 Jun 25, 2026
8b46be3
chore: enforce strict comparisons and inject Codacy ignore tokens
Mike031289 Jun 25, 2026
9e05c14
Merge pull request #19 from Mike031289/chore/setup-phpunitgit
Mike031289 Jun 25, 2026
9075ad9
feat: establish ManyToOne relationship between Task and User entities
Mike031289 Jun 25, 2026
9d558b1
feat: automatically bind authenticated user to newly created tasks
Mike031289 Jun 25, 2026
580bbad
chore: adjust error reporting and suppress E_WARNING in dev controller
Mike031289 Jun 25, 2026
81e20a5
feat(task): fix layout and validation display on task creation form
Mike031289 Jun 26, 2026
bd269a3
refactor(task): secure Task entity fields and add cascading on delete
Mike031289 Jun 26, 2026
8db684a
feat(task): bind task to creator user and add functional tests for ta…
Mike031289 Jul 3, 2026
38ec3d6
Merge pull request #20 from Mike031289/fix/task-user-binding
Mike031289 Jul 3, 2026
b58b3a0
chore: implement and config native phpunit bootstrap bridge
Mike031289 Jul 3, 2026
e819519
chore: integrate PHPUnit into vendor and clean up legacy assets
Mike031289 Jul 3, 2026
2225f5e
chore: install and configure DAMA DoctrineTestBundle
Mike031289 Jul 3, 2026
e40c2e9
chore: clean up and standardize test configurations in English
Mike031289 Jul 3, 2026
b23e6dd
Merge pull request #22 from Mike031289/chore/phpunit-clean-config
Mike031289 Jul 3, 2026
0e5cbd7
ci: structural implementation of GitHub Actions pipeline for PHP 7.4
Mike031289 Jul 4, 2026
53ffb52
Merge pull request #24 from Mike031289/feature/github-actions-ci
Mike031289 Jul 4, 2026
18647e6
fix: switch runner to ubuntu-latest to resolve queue bottleneck
Mike031289 Jul 4, 2026
5866aea
fix: add required composer description and ease validation strictness
Mike031289 Jul 4, 2026
fd9211e
Merge pull request #26 from Mike031289/feature/github-actions-ci
Mike031289 Jul 4, 2026
6ceac8f
fix: refactor test bootstrap to prevent phpunit-bridge crashes on PHP…
Mike031289 Jul 4, 2026
550e456
Merge pull request #27 from Mike031289/feature/github-actions-ci
Mike031289 Jul 4, 2026
7a8181e
fix: refactor test bootstrap to prevent phpunit-bridge crashes on PHP…
Mike031289 Jul 4, 2026
40c1d78
ci: add mysql service and database initialization steps to workflow
Mike031289 Jul 4, 2026
3007068
ci: align mysql container config and env parameters with local config
Mike031289 Jul 4, 2026
efc90a0
fix: align mysql container config and env parameters with local config
Mike031289 Jul 4, 2026
0d8c598
fix: reset bootstrap to commit 18647e6 and fix database flow in ci
Mike031289 Jul 4, 2026
9e28b83
fix: enforce strict standards and translations in bootstrap
Mike031289 Jul 4, 2026
9d7bb31
fix(entities): resolve user roles and task completion logic for schemas
Mike031289 Jul 7, 2026
fc36f9f
chore(app): update dependencies and set up data fixtures loading
Mike031289 Jul 7, 2026
e311638
Merge pull request #35 from Mike031289/feat/data-fixtures
Mike031289 Jul 7, 2026
e55c202
ci: configure GitHub Actions workflow and fix test authentication
Mike031289 Jul 7, 2026
e406da6
Merge pull request #36 from Mike031289/feature/github-actions-ci
Mike031289 Jul 7, 2026
c90f09f
fix(ci): update bootstrap to pass strict codacy true/false comparisons
Mike031289 Jul 7, 2026
a9f4954
fix(ci): update bootstrap to pass strict codacy
Mike031289 Jul 7, 2026
46726c0
fix(ci): strictly isolate previousHandler boolean evaluation for Codacy
Mike031289 Jul 7, 2026
e51087a
Merge pull request #37 from Mike031289/feature/github-actions-ci
Mike031289 Jul 7, 2026
1ccdc3e
fix(task): prevent author alteration on task edition
Mike031289 Jul 8, 2026
a545c46
test(task): add functional test for task author immutability
Mike031289 Jul 8, 2026
5ca7f87
Merge pull request #38 from Mike031289/fix/task-author-immutable
Mike031289 Jul 8, 2026
7a24509
feat(task): migrate legacy unauthored tasks to virtual anonymous user
Mike031289 Jul 8, 2026
3533b8a
test(task): add functional test for anonymous migration command
Mike031289 Jul 8, 2026
37fea1f
Merge pull request #39 from Mike031289/task/anonymous-user-migration
Mike031289 Jul 8, 2026
7d71ec8
feat(user-roles): implement single role selection and data transforma…
Mike031289 Jul 15, 2026
af75bd7
test(user-roles): fix role selection crawler issue and character enco…
Mike031289 Jul 15, 2026
8ce780f
Merge pull request #40 from Mike031289/feat/user-roles
Mike031289 Jul 16, 2026
796a87d
security(user): restrict user management access to administrators only
Mike031289 Jul 16, 2026
20ee5d7
style(nav): conditionally hide user management link in navigation tem…
Mike031289 Jul 16, 2026
b7c0603
test(user): add functional access tests, refactor suites and apply Co…
Mike031289 Jul 16, 2026
dbe1944
Merge pull request #41 from Mike031289/feat/security-admin-access
Mike031289 Jul 16, 2026
b7bd421
feat(security): implement authorization flow with custom voters and a…
Mike031289 Jul 16, 2026
5dd876b
chore(fixtures): update database fixtures with new security roles
Mike031289 Jul 16, 2026
368aabf
feat(views): restrict task actions in list template based on security…
Mike031289 Jul 16, 2026
2518142
refactor(task): update task controller logic and validate with functi…
Mike031289 Jul 16, 2026
a581b9d
Merge pull request #42 from Mike031289/feat/security-admin-access
Mike031289 Jul 16, 2026
368876a
refactor(security): add rules in voter to alow User Admin to delete T…
Mike031289 Jul 16, 2026
e541f59
feat(security): allow admins to delete anonymous tasks (#13)
Mike031289 Jul 17, 2026
23ef03d
Merge pull request #43 from Mike031289/feat/security-delete-anonymous…
Mike031289 Jul 17, 2026
d1f5fbf
docs: add contributing guidelines (CONTRIBUTING.md) (#14)
Mike031289 Jul 17, 2026
7e6e9f7
Merge pull request #44 from Mike031289/docs/contributing-guide
Mike031289 Jul 17, 2026
5d42a6a
docs: write technical security and authentication guide (#15)
Mike031289 Jul 17, 2026
7aed974
docs(readme): rewrite README with full architecture overview
Mike031289 Jul 17, 2026
ecdc2bd
Merge pull request #45 from Mike031289/docs/auth-documentation
Mike031289 Jul 17, 2026
da5540f
test(config): fix phpunit coverage setup and update filter rules
Mike031289 Jul 17, 2026
28f78a5
Merge pull request #46 from Mike031289/test/code-covrage
Mike031289 Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Symfony 3.4 CI Pipeline

# Trigger the workflow on push or pull requests for the develop and main branches
on:
push:
branches: [ develop, main, master ]
pull_request:
branches: [ develop, main, master ]

jobs:
tests:
name: PHPUnit Tests (PHP 7.4)
runs-on: ubuntu-latest

# Provision a containerized MySQL service for integration testing
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # Allows root connection with no password
MYSQL_DATABASE: todoco_db # Matches your local database name
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3

steps:
# 1. Checkout the repository code inside the runner
- name: Checkout Code
uses: actions/checkout@v4

# 2. Setup PHP Environment with required extensions for Symfony 3.4
- name: Setup PHP Environment
uses: shivammathur/setup-php@v2

Check warning on line 37 in .github/workflows/ci.yml

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/ci.yml#L37

An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release.
with:
php-version: '7.4'
extensions: mbstring, xml, ctype, iconv, pdo, pdo_mysql, mysqli
tools: composer:2.2
coverage: none # Disabled to optimize pipeline execution speed

# 3. Validate composer.json syntax
- name: Validate Composer Configuration
run: composer validate

# 4. Install Project Dependencies using Composer
- name: Install Dependencies
run: composer install --prefer-dist --no-progress --no-suggest

# 5. Inject legacy Symfony 3.4 parameters into GitHub Environment
# This explicitly overrides your parameters.yml settings for the CI environment
- name: Configure Test Environment Variables
run: |
echo "DATABASE_URL=mysql://root:@127.0.0.1:3306/todoco_db" >> $GITHUB_ENV
echo "SYMFONY__DATABASE_HOST=127.0.0.1" >> $GITHUB_ENV
echo "SYMFONY__DATABASE_PORT=3306" >> $GITHUB_ENV
echo "SYMFONY__DATABASE_NAME=todoco_db" >> $GITHUB_ENV
echo "SYMFONY__DATABASE_USER=root" >> $GITHUB_ENV
echo "SYMFONY__DATABASE_PASSWORD=" >> $GITHUB_ENV

# 6. Build the database schema using Doctrine commands
- name: Initialize Database and Schema
run: |
php bin/console doctrine:database:create --env=test --if-not-exists
php bin/console doctrine:schema:update --env=test --force

# 7. Hydrate the database with development/test fixtures
- name: Load Test Fixtures
run: php bin/console doctrine:fixtures:load --env=test -n

# 8. Execute the Test Suite via the standardized vendor binary
- name: Run Automated Test Suite
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
!var/SymfonyRequirements.php
/vendor/
/web/bundles/
/build/
108 changes: 108 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Contributing to ToDo List

First off, thank you for considering contributing to this project! This guide will help you set up your local development environment and understand our development workflow.

---

## 🛠️ Local Installation & Setup

### Prerequisites

Before starting, ensure you have the following installed on your machine:

- **PHP 7.4** (with standard XML, cURL, and PDO extensions enabled)
- **Composer** (PHP dependency manager)
- **MySQL** or **MariaDB** database server

### Step-by-Step Setup

1. **Clone the repository:**

```bash
git clone https://github.com/Mike031289/ToDo-Co.git
cd todo-list
```

2. **Install PHP dependencies:**

```bash
composer install
```

During installation, you will be prompted to configure your local parameters. Define your database credentials (host, port, name, user, password) for `app/config/parameters.yml`.

3. **Create the database and schema:**

```bash
php bin/console doctrine:database:create
php bin/console doctrine:schema:create
```

4. **Load development fixtures:**

```bash
php bin/console doctrine:fixtures:load --no-interaction
```

5. **Start the local web server:**

```bash
php bin/console server:start
```

Your application will be available at:

```
http://127.0.0.1:8000
```

---

## 🌿 Git Workflow & Branch Naming

We use a structured branch naming convention to keep our repository clean and organized. Please prefix your branch names based on the nature of your changes:

- `feat/` : New features (e.g., `feat/security-delete-anonymous-tasks`)
- `fix/` : Bug fixes (e.g., `fix/task-validation`)
- `docs/` : Documentation updates (e.g., `docs/contributing-guide`)
- `refactor/` : Code changes that neither fix a bug nor add a feature
- `test/` : Adding or updating tests

---

## ✍️ Commit Message Guidelines

We enforce the **Conventional Commits** specification. Every commit message must be clear, structured, and prefixed with its type:

```text
<type>(<scope>): <short description>
```

### Examples

```text
feat(task): implement deletion restriction rules
fix(user): resolve login form validation error
docs(readme): update installation steps
```

> **Note:** For issues, please reference them in your commit footer using `closes #XX` or `resolves #XX`.

---

## 🧪 Testing & Quality Assurance

Before submitting any Pull Request, you must run the local test suite to ensure no regressions are introduced:

```bash
# Run the entire automated test suite
php bin/phpunit
```

Make sure all tests pass (`OK`) before pushing your code.

---

## 🙌 Thank You

Thank you for your contribution!
123 changes: 119 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,125 @@
ToDoList
========
# ToDo & Co Application

[![Symfony 3.4 CI Pipeline](https://github.com/Mike031289/ToDo-Co/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/Mike031289/ToDo-Co/actions/workflows/ci.yml)

Base du projet #8 : Améliorez un projet existant
https://openclassrooms.com/projects/ameliorer-un-projet-existant-1

## About The Project
---

## 📝 About The Project

This repository is dedicated to the modernization of the **ToDo & Co** web application.
The main objective of this project is to take over an existing legacy codebase (**Symfony 3.1 / PHP 7.4**), perform a thorough code quality audit, fix critical technical debt, and implement new technical requirements—including advanced user management, security policies, and an exhaustive automated testing suite (PHPUnit).

The main objective of this project is to take over an existing legacy codebase (**Symfony 3.1 / PHP 5.5.9**), perform a thorough code quality audit, fix critical technical debt, and implement new technical requirements—including advanced user management, security policies, and an exhaustive automated testing suite (PHPUnit).

### 🚀 Modernization Goals Achieved

- **Framework Upgrade:** Migrated the legacy application to **Symfony 3.4** and **PHP 7.4** to ensure stability and long-term dependency support.
- **Security Overhaul:** Implemented multi-level roles, isolated task ownership, and resolved security vulnerabilities using Symfony **Voters**.
- **Quality Assurance:** Built a comprehensive automated testing suite with **PHPUnit**, covering controllers, forms, and business logic.
- **CI/CD Pipeline:** Integrated **GitHub Actions** for continuous integration, including automated tests, static analysis, and code style validation on every push.

---

## 🛠️ Tech Stack

| Category | Technology |
| :---------------------------- | :---------------------------- |
| **Framework** | Symfony 3.4 |
| **Language** | PHP 7.4 |
| **Database** | MySQL / MariaDB |
| **Testing** | PHPUnit |
| **CI/CD** | GitHub Actions |
| **Static Analysis & Quality** | Codacy, PHPStan, PHP CS Fixer |

---

## 📖 Project Documentation

To make onboarding and maintenance as smooth as possible, the documentation is split into dedicated guides:

### 📘 Installation & Contribution Guide (`CONTRIBUTING.md`)

- Step-by-step local setup instructions.
- Database configuration and fixtures.
- Git workflow (branch naming and Conventional Commits).
- Commands to run the automated test suite.

### 🔐 Technical Security & Authentication (`doc/security.md`)

- Authentication architecture overview.
- Role hierarchy (`ROLE_USER` / `ROLE_ADMIN`).
- Route-level authorization and `TaskVoter` rules.
- Demo accounts for testing.

---

## 🚦 Quick Start (Local Setup)

For complete installation instructions, refer to **CONTRIBUTING.md**.

### 1. Install dependencies

```bash
composer install
```

### 2. Configure the database

During installation, provide your local database credentials when `parameters.yml` is generated.

### 3. Create the database and load fixtures

```bash
php bin/console doctrine:database:create
php bin/console doctrine:schema:create
php bin/console doctrine:fixtures:load --no-interaction
```

### 4. Start the local server

```bash
php bin/console server:start
```

The application will be available at:

```text
http://127.0.0.1:8000
```

---

## 🧪 Running Tests

Run the complete automated test suite:

```bash
php bin/phpunit
```

Run a specific test file (example: Task controller security tests):

```bash
php bin/phpunit tests/AppBundle/Controller/TaskControllerTest.php
```

---

## 📊 Quality Audit

Code quality is continuously monitored to keep the project maintainable and compliant with Symfony best practices.

### ✅ Coding Standards

- PSR-12 compatibility enforced with **PHP CS Fixer**.

### 🔍 Static Analysis

- **PHPStan** is used to detect type inconsistencies and potential runtime issues before deployment.

### 🔄 Continuous Integration

- **GitHub Actions** automatically executes tests, code style checks, and static analysis.
- **Codacy** reviews every Pull Request to monitor technical debt and maintain code quality.
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function registerBundles()
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
}

return $bundles;
Expand Down
Loading
Loading