Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .githooks/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Install git hooks

echo "📦 Installing git hooks..."

# Make hooks executable
chmod +x .githooks/pre-push

# Configure git to use our hooks directory
git config core.hooksPath .githooks

echo "✅ Git hooks installed successfully!"
26 changes: 26 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Pre-push hook: Lint GitHub Actions workflows before pushing

set -e

# Get the list of changed workflow files
changed_workflows=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.github/workflows/.*\.ya?ml$' || true)

if [ -n "$changed_workflows" ]; then
echo "🔍 Linting GitHub Actions workflows..."

if ! command -v actionlint &> /dev/null; then
echo "⚠️ actionlint not found. Installing via mise..."
mise install actionlint
fi

# Lint the changed workflows
if actionlint -oneline $changed_workflows; then
echo "✅ Workflows lint passed!"
else
echo "❌ Workflow lint failed. Fix the errors above and try again."
exit 1
fi
else
echo "✅ No workflow changes detected."
fi
79 changes: 79 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: "IntegratedDynamic Infrastructure - Configuration"
description: "Conventions de projet et préférences de codage pour l'infrastructure"
---

# Instructions pour GitHub Copilot

## Onboarding

### Gestion des dépendances

Les dépendances du projet sont gérées via **mise**.

**Installation** :
```bash
mise install
```

ℹ️ **Automatique** : Une fois `mise.toml` modifié, `mise install` se lance automatiquement via un hook.

## Conventions de code

### Branches

Je dois TOUJOURS utiliser [Conventional Branch](https://conventional-branch.github.io/).

Format strict:
```
<type>/<description>
```

Types: `feature/`, `bugfix/`, `hotfix/`, `ci/`, `chore/`

Exemples:
- `feature/add-authentication-middleware`
- `bugfix/fix-memory-leak`
- `ci/add-github-actions-workflow`

Règles obligatoires:
- Minuscules, chiffres, hyphens et dots uniquement
- Pas de hyphens/dots consécutifs ou aux extrémités
- Inclure ticket number si applicable: `feature/issue-456-add-auth`

### Commits

Utiliser [Conventional Commits](https://www.conventionalcommits.org/) :
```
<type>[scope]: <description>
```

Types : `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`

### Pull Requests

**Titre** : Doit être descriptif et clair. Format recommandé avec type et description.
```
<type>: Clear description of what the PR does
```

**Body** : Contexte, changements, issues liées (via `Closes #123`), et instructions de test.

**Comportement automatique** : Après chaque `commit` + `push` sur une branche, créer automatiquement une PR en **draft** (si elle n'existe pas déjà) avec titre et body appropriés.

Utiliser [Conventional Comments](https://conventionalcomments.org/) pour les reviews :
```
<label> [decorations]: <subject>
```

Labels : `praise`, `nitpick`, `suggestion`, `issue`, `todo`, `question`, `thought`

Voir [CONTRIBUTING.md](../CONTRIBUTING.md) pour plus de détails.

## Structure du projet

## Technologies et frameworks

## Pratiques de développement

## Points importants à retenir
10 changes: 10 additions & 0 deletions .github/hooks/check-mise-changes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Lire le JSON du hook sur stdin
input=$(cat)

# Vérifier si mise.toml a été modifié via create_file ou replace_string_in_file
if echo "$input" | grep -q "mise.toml"; then
# Auto-run mise install
mise install
fi
11 changes: 11 additions & 0 deletions .github/hooks/mise-watcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hooks": {
"PostToolUse": [
{
"type": "command",
"command": "./.github/hooks/check-mise-changes.sh",
"timeout": 30
}
]
}
}
18 changes: 18 additions & 0 deletions .github/workflows/lint-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint GitHub Actions Workflows

on:
push:
paths:
- '.github/workflows/**'
pull_request:
paths:
- '.github/workflows/**'

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run actionlint
uses: raven-actions/actionlint@v2
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"chat.tools.terminal.autoApprove": {
"git add": true,
"git commit": true,
"gh": true,
"git push": true
}
}
114 changes: 114 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# Contribuer

## Branches : Conventional Branch

Nous recommandons [Conventional Branch](https://conventional-branch.github.io/) pour les noms de branches.

Format:
```
<type>/<description>
```

### Types de branches
- `feature/` ou `feat/` : Nouvelle fonctionnalité (ex: `feature/add-login-page`)
- `bugfix/` ou `fix/` : Correction de bug (ex: `bugfix/fix-header-layout`)
- `hotfix/` : Correction urgente (ex: `hotfix/security-patch`)
- `ci/` : Changements CI/CD uniquement (ex: `ci/add-github-actions-workflow`)
- `chore/` : Tâches sans rapport au code (ex: `chore/update-dependencies`)

### Règles
- Utiliser uniquement des minuscules, chiffres, hyphens et dots
- Pas de hyphens/dots consécutifs, au début ou à la fin
- Clair et concis
- Optionnel : inclure le numéro de ticket (ex: `feature/issue-123-add-login`)

**Note** : Les humains ne sont pas strictement limités à cette convention, mais c'est fortement recommandé.

## Commits : Conventional Commits

Nous utilisons [Conventional Commits](https://www.conventionalcommits.org/) pour nos messages de commit.

Format:
```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

### Types
- `feat` : Une nouvelle fonctionnalité
- `fix` : Un correctif de bug
- `docs` : Changements de documentation
- `style` : Changements de style (formatage, points-virgules, etc.)
- `refactor` : Refactoring du code sans ajouter de feature ni corriger de bug
- `perf` : Amélioration des performances
- `test` : Ajout ou modification de tests
- `chore` : Changements de la build, dépendances, outils
- `ci` : Un changement sur la CI/CD

### Exemples
```
feat(api): add new endpoint for user authentication
fix: resolve memory leak in connection pool
docs: update README with installation instructions
```

## Pull Requests

### Titre de la PR

Le titre doit être descriptif et clair. Il peut être basé sur le nom de la branche, mais doit inclure un contexte:

Format recommandé:
```
[Type] Feature/Fix name (branch-name)
```

Ou simplement:
```
<type>: Clear description of what the PR does
```

Exemples valides:
```
feat: Add authentication middleware to API routes
fix: Resolve memory leak in connection pool
docs: Update deployment guide with new variables
```

### Body de la PR

Le body doit contenir:
- **Contexte** : Pourquoi cette PR est nécessaire
- **Changements** : Quoi a changé
- **Issues liées** : Référencer les issues fermées avec `Closes #123`
- **Tests** : Comment tester les changements

Exemple:
```
## Contexte
We needed to add rate limiting to prevent abuse of the API.

## Changements
- Added rate limiter middleware
- Configured limits per endpoint
- Added metrics tracking

## Issues liées
Closes #456

## Tests
- Run `npm run test:api` to verify endpoints
- Manual testing with more than 100 requests per minute should return 429
```

### Reviews et Conventional Comments

Utiliser [Conventional Comments](https://conventionalcomments.org/) pour les reviews :
```
<label> [decorations]: <subject>
```

Labels : `praise`, `nitpick`, `suggestion`, `issue`, `todo`, `question`, `thought`
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# infrastructure
# Infrastructure

## Onboarding

### Installation des dépendances

```bash
mise install
```

Cette commande installe toutes les dépendances du projet définies dans `mise.toml`.

### Installation des Git Hooks

```bash
.githooks/install.sh
```

Cela configure les git hooks locaux pour automatiser les vérifications avant les commits/pushes.
21 changes: 21 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tools]
kubectl = "1.35"
minikube = "1.38"
terraform = "1.14"
actionlint = "1.7"

[tasks.minikube]
run = """
minikube start --driver=docker
kubectl wait --for=condition=Ready nodes --all --timeout=120s
"""

[tasks.terraform-init]
run = "echo terraform init"

[tasks.terraform-apply]
run = "echo terraform apply -auto-approve"

[tasks.dev]
description = "Full dev environment"
depends = ["minikube", "terraform-init", "terraform-apply"]
Loading