Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
114 changes: 57 additions & 57 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
# Local .terraform directories
.terraform/
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Ignore transient lock info files created by terraform apply
.terraform.tfstate.lock.info
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc
# Optional: ignore graph output files generated by `terraform graph`
# *.dot
# Optional: ignore plan files saved before destroying Terraform configuration
# Uncomment the line below if you want to ignore planout files.
# planout
.DS_Store
# Ignorer les .venv
.venv
# Ignorer le dossier node_modules
node_modules
logs
email-template.md
# Local .terraform directories
.terraform/

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log
crash.*.log

# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json

# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json

# Ignore transient lock info files created by terraform apply
.terraform.tfstate.lock.info

# Include override files you do wish to add to version control using negated pattern
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

# Ignore CLI configuration files
.terraformrc
terraform.rc

# Optional: ignore graph output files generated by `terraform graph`
# *.dot

# Optional: ignore plan files saved before destroying Terraform configuration
# Uncomment the line below if you want to ignore planout files.
# planout

.DS_Store

# Ignorer les .venv
.venv

# Ignorer le dossier node_modules
node_modules

logs

email-template.md

venv
85 changes: 85 additions & 0 deletions email-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

**À :** responsable.technique@azuretech.fr
**De :** aicha.elouadi@azuretech.fr
**Objet :** Rapport de correction — scripts d'analyse de logs Azure
**Date :** 21/05/2026

---

Bonjour Aldéric,

**1. Contexte**

Le projet Python présentait plusieurs bugs empêchant la communication entre l'API Python Flask et le client Node.js
Tu trouveras ci-dessous le listing de l'ensemble des bugs détéctés.
---

**2. Bugs identifiés**

*Projet App.py — `app.py/` :*

| # | Fichier | Ligne | Type d'erreur | Description du problème |
|---|---------|-------|---------------|--------------------------|
| 1 | app.py | 18 | Syntaxe/variable non définie| |log_file absent dans get_logs()|
| 2 | app.py | 31 | Mauvais nom de la variable|errors/erreurs : incoherent|
| 3 | app.py | 50 | variable non définie| log_file absent dans get_logs()|
| 4 | app.py | 50 | Fichier introuvable| serveur.log non trouvé|
| 5 | app.py | 57 | Port incorrect|Port Flask different du client Node|

*Projet Node.js — `node-client/` :*

| # | Fichier | Ligne | Type d'erreur | Description du problème |
|---|---------|-------|---------------|--------------------------|
| 1 |app.js |12 |dépendance incorrecte |mauvaise version axios |
| 2 |app.js |12 |module introuvable | axios non installé|
| 3 |app.js |21 |erreur nom fichier | .body au lieu de .data|

---

**3. Corrections apportées**

- Bug 1 : correction de la syntaxe
- Bug 2 : correction du nom de la variable
- Bug 3 : ajout de la variable log_files
- Bug 4 : correction du chemin/fichier serveur.log
- Bug 5 : correction du port Flask dans app.py
- Bug 6 : correction de la dépendance axios
- Bug 7 : installation de la dépendance Node.js avec nom install
- Bug 8 : remplacement de response.body par reponse.data

---

**4. Tests de validation**

- Commande testée :
python app.py
curl http://127.0.0.1:5000/api/logs
node app.js
- Résultat obtenu : le serveur Flask demarre correctement, le client node affiche le rapport d'analyse des logs azure et des erreurs
- Résultat attendu : communication entre Node-client et python-api , et afficher le rapport des logs
- Validation : ✅

---

**5. Lien vers la Pull Request**

https://github.com/DevSecOps-Simplon-Training/tp-collaboratif-git-dev-starter/pull/10

---

**6. Recommandations**

Vérifier la cohérence des ports entre services
Ajouter des tests automatisés
Vérifier les versions des dépendances npm
Utiliser des variables clairement nommées
Ajouter une validation de présence des fichiers nécessaires

---


Cordialement,

Aicha ELOUADI
Développeur DevSecOps — Promotion Azure, Simplon
aicha.elouadi@azuretech.fr
4 changes: 4 additions & 0 deletions node-client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ const path = require('path');
const config = require(path.join(__dirname, '..', 'config.json'));
const API_URL = `http://${config.api.host}:${config.api.port}${config.api.route}`;

// BUG 6 — Le nom du module importé ici est incorrect
const axios = require('axios');

async function getLogs() {
try {
const response = await axios.get(API_URL);

// BUG 7 — La propriété pour accéder au corps de la réponse avec axios
// ne s'appelle pas .body — cherchez dans la doc axios comment
// accéder aux données de la réponse
const data = response.data;

console.log('\n========================================');
Expand Down
Loading
Loading