projects: single conf.json per id, workspace in smart_ide block; example/ template; remove .code-workspace files
This commit is contained in:
parent
b21ac2cf64
commit
524d38b9ff
5
.gitignore
vendored
5
.gitignore
vendored
@ -12,11 +12,12 @@ cron/config.local.env
|
||||
# logs/ : le répertoire reste versionné (README.md, logs/.gitignore) ; aucun fichier journal versionné
|
||||
logs/**/*.log
|
||||
|
||||
# projects/ : ignorer tout répertoire d'id sous projects/ sauf les squelettes versionnés (conf, workspace, etc.)
|
||||
# projects/ : ignorer tout répertoire d'id sous projects/ sauf les squelettes versionnés (conf.json par id, gabarit example/)
|
||||
projects/*
|
||||
!projects/README.md
|
||||
!projects/example/
|
||||
!projects/example/**
|
||||
!projects/active-project.json.example
|
||||
!projects/ssh-config.example
|
||||
!projects/enso/
|
||||
!projects/enso/**
|
||||
!projects/smart_ide/
|
||||
|
||||
@ -8,7 +8,7 @@ alwaysApply: false
|
||||
|
||||
Quand le périmètre touche ce dépôt et le module **`ia_dev/`** :
|
||||
|
||||
- **Projet courant (IDE / smart_ide) :** lire dans l’ordre : fichier local **`projects/active-project.json`** (champ **`id`**, non versionné — copier depuis `projects/active-project.json.example`) ; sinon variable **`SMART_IDE_PROJECT_ID`** ; sinon paramètre workspace **`smartIde.activeProjectId`** dans le fichier **`.code-workspace`** ou **`.vscode/settings.json`** ; sinon défaut **`smart_ide`**. La conf versionnée du projet est **`projects/<id>/conf.json`** ([docs/repo/projects-directory.md](../../docs/repo/projects-directory.md)). Données déployées et SSH : [docs/features/remote-deployed-data-ssh.md](../../docs/features/remote-deployed-data-ssh.md).
|
||||
- **Projet courant (IDE / smart_ide) :** lire dans l’ordre : fichier local **`projects/active-project.json`** (champ **`id`**, non versionné — copier depuis `projects/active-project.json.example`) ; sinon variable **`SMART_IDE_PROJECT_ID`** ; sinon **`smartIde.activeProjectId`** dans **`smart_ide.workspace.settings`** de **`projects/<id>/conf.json`** (id déduit du dossier ouvert ou du workspace) ; sinon le même paramètre dans un **`.code-workspace`** local ou **`.vscode/settings.json`** ; sinon défaut **`smart_ide`**. La conf versionnée du projet est **`projects/<id>/conf.json`** ([docs/repo/projects-directory.md](../../docs/repo/projects-directory.md)). Données déployées et SSH : [docs/features/remote-deployed-data-ssh.md](../../docs/features/remote-deployed-data-ssh.md).
|
||||
- **Lien ia_dev :** pour l’id choisi, `ia_dev/projects/<id>` doit être un **lien** vers `../../projects/<id>` lorsque les scripts ia_dev résolvent ce chemin (script `scripts/ensure-ia-dev-smart-ide-project-link.sh` pour `smart_ide`).
|
||||
- **Environnement :** `test` | `pprod` | `prod`. Le reprendre depuis le message utilisateur ou depuis **`default_env`** dans `projects/active-project.json` ; **demander** s’il manque avant des actions dépendantes du env.
|
||||
- **Exécution des scripts ia_dev :** répertoire courant = racine **`ia_dev/`** (dans le workspace smart_ide). Pas de mélange avec la racine smart_ide pour `deploy/`, `git-issues/`, etc.
|
||||
|
||||
@ -70,13 +70,12 @@ Objectif : indiquer **quel** `projects/<id>/` est actif pour l’éditeur et les
|
||||
- Ce fichier est **ignoré par Git** (voir racine `.gitignore`).
|
||||
- Champs : **`id`** (obligatoire, ex. `enso`), **`default_env`** (optionnel : `test` | `pprod` | `prod`). L’exemple versionné peut contenir d’autres clés purement documentaires (ex. **`notes`**) ignorées par les automatisations.
|
||||
|
||||
2. **Paramètres du fichier workspace VS Code / Cursor**
|
||||
- Dans le **`.code-workspace`** que vous ouvrez (ex. [`projects/enso/smart_ide.code-workspace`](../enso/smart_ide.code-workspace)), renseigner :
|
||||
`"smartIde.activeProjectId": "<id>"`
|
||||
- Même clé possible dans **`.vscode/settings.json`** à la racine du dossier smart_ide pour un dossier unique.
|
||||
2. **Paramètres multi-dossiers VS Code / Cursor**
|
||||
- La conf versionnée par projet est **`projects/<id>/conf.json`** : sous **`smart_ide.workspace.settings`**, renseigner **`smartIde.activeProjectId`** (même sémantique qu’un fichier `.code-workspace`). Les **`folders`** du même bloc décrivent les racines du workspace.
|
||||
- Pour ouvrir l’éditeur : copier ce bloc dans un **fichier local `.code-workspace`** (non versionné) si besoin, ou aligner **`.vscode/settings.json`** sur ces valeurs pour un dossier unique.
|
||||
- Ces clés ne sont **pas** des clés natives VS Code : elles servent de **convention** lue par scripts, extensions maison ou règles Cursor (voir [`.smartIde/rules/smart-ide-ia-dev-bridge.mdc`](../../.smartIde/rules/smart-ide-ia-dev-bridge.mdc)).
|
||||
|
||||
Ordre de priorité suggéré pour les automatisations : **`projects/active-project.json`** → variable d’environnement **`SMART_IDE_PROJECT_ID`** si défini au lancement → **`smartIde.activeProjectId`** dans les settings du workspace → demande explicite à l’utilisateur.
|
||||
Ordre de priorité suggéré pour les automatisations : **`projects/active-project.json`** → variable d’environnement **`SMART_IDE_PROJECT_ID`** si défini au lancement → **`smartIde.activeProjectId`** dans **`smart_ide.workspace.settings`** du `conf.json` du projet concerné, ou dans les settings du workspace ouvert, ou **`.vscode/settings.json`** → demande explicite à l’utilisateur.
|
||||
|
||||
## Liens
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ Les agents ne modifient pas `projects/<id>/conf.json` sans validation humaine ex
|
||||
| `deploy.host_stays_on_test` | no | Comportement `deploy-by-script-to.sh` (branche test vs pprod/prod). |
|
||||
| `tickets` | no | URL issues, `authorized_emails` ; le **to** sert à résoudre le projet. |
|
||||
| `cron` | no | Extension **smart_ide** : `{ "git_pull": false }` pour désactiver le pull planifié. |
|
||||
| `smart_ide` | no | Extension **smart_ide** : `remote_data_access`, `anythingllm_workspace_slug`, etc. |
|
||||
| `smart_ide` | no | Extension **smart_ide** : `remote_data_access`, `anythingllm_workspace_slug`, `workspace` (`folders` + `settings`, équivalent `.code-workspace` ; y placer `smartIde.activeProjectId`), etc. |
|
||||
|
||||
Détail ticketing : `ia_dev/projects/ia_dev/docs/TICKETS_SPOOL_FORMAT.md`.
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ Les **sous-répertoires** `projects/<id>/` non listés dans le **`.gitignore`**
|
||||
|
||||
Les dépôts sources des produits (ex. backend **docv** sous un chemin du type `…/enso/docv`, autres apps) doivent vivre **ailleurs**, selon la convention du poste — typiquement un répertoire **frère** du monorepo, par ex. **`../projects/<nom>/`** (relatif à la racine `smart_ide`), **distinct** de `./projects/` ici.
|
||||
|
||||
- **`./projects/`** → uniquement `conf.json` (+ métadonnées légères) pour que `ia_dev` résolve `projects/<id>/conf.json` via le lien symbolique décrit dans [ia_dev-module.md](../ia_dev-module.md).
|
||||
- **`./projects/`** → **un seul fichier de configuration par id** : `projects/<id>/conf.json` (y compris le gabarit [`projects/example/conf.json`](../../projects/example/conf.json)). Pas de fichier `.code-workspace` versionné à côté : l’équivalent multi-root IDE est **`smart_ide.workspace`** dans ce même `conf.json`. `ia_dev` résout via le lien symbolique décrit dans [ia_dev-module.md](../ia_dev-module.md).
|
||||
- **`../projects/`** (ou autre racine configurée) → arborescences Git complètes, builds, etc. ; dans chaque `conf.json`, **`project_path`** et les chemins **`deploy.*`** utiles sont **relatifs à la racine du monorepo smart_ide** (ex. `../enso`, `.`) ou **absolus** ; le script `cron/git-pull-project-clones.sh` et ia_dev les résolvent depuis cette racine (`ia_dev/lib/conf_path_resolve.sh`).
|
||||
|
||||
## `smart_ide`
|
||||
@ -27,7 +27,7 @@ Les dépôts sources des produits (ex. backend **docv** sous un chemin du type `
|
||||
|
||||
- Fichier : `projects/builazoo/conf.json` — dépôt **sous la racine monorepo** (`project_path` : `builazoo`, soit `smart_ide/builazoo/`), forge **4nk/builazoo** (wiki / issues à ajuster si le dépôt diffère), mails ticketing `AI.BUILAZOO.*@4nkweb.com`.
|
||||
- **`smart_ide.remote_data_access`** : alias SSH `builazoo-test` / `builazoo-pprod` / `builazoo-prod` (à déclarer dans `~/.ssh/config` comme pour les autres ids).
|
||||
- Workspace : `projects/builazoo/smart_ide.code-workspace`
|
||||
- Multi-root IDE : **`smart_ide.workspace`** dans `conf.json` (dossiers + `smartIde.activeProjectId`).
|
||||
- Cron fragment : `cron/fragments/builazoo.cron`
|
||||
- Pour **`ia_dev`** : `./scripts/ensure-ia-dev-project-link.sh builazoo`
|
||||
- Le répertoire **`builazoo/`** à la racine du monorepo est partiellement ignoré par Git (sauf `builazoo/README.md`) : y placer le clone ou les sources.
|
||||
@ -48,12 +48,14 @@ Spécification : [features/remote-deployed-data-ssh.md](../features/remote-deplo
|
||||
|
||||
### Bloc optionnel `smart_ide` dans `conf.json`
|
||||
|
||||
Clé **`smart_ide`** avec notamment **`remote_data_access`**, **`anythingllm_workspace_slug`**. Exemple : `projects/enso/conf.json`.
|
||||
Clé **`smart_ide`** avec notamment **`remote_data_access`**, **`anythingllm_workspace_slug`**, **`workspace`** (équivalent `.code-workspace` : `folders` + `settings.smartIde.activeProjectId`). Exemple : `projects/enso/conf.json`.
|
||||
|
||||
### Projet actif pour l’éditeur / Cursor
|
||||
|
||||
1. Copier `projects/active-project.json.example` vers **`projects/active-project.json`** (non versionné) ; renseigner **`id`**, optionnellement **`default_env`**, **`notes`** (informative).
|
||||
2. Dans un **`.code-workspace`** : **`smartIde.activeProjectId`** dans **`settings`** (ex. `projects/enso/smart_ide.code-workspace`).
|
||||
1. Copier [`projects/active-project.json.example`](../../projects/active-project.json.example) vers **`projects/active-project.json`** (non versionné) ; renseigner **`id`**, optionnellement **`default_env`**, **`notes`**.
|
||||
2. Pour ouvrir un workspace multi-dossiers dans VS Code / Cursor : lire **`smart_ide.workspace`** dans **`projects/<id>/conf.json`** (même schéma qu’un fichier `.code-workspace`) — copier ce bloc dans un fichier local `.code-workspace` si l’éditeur l’exige, ou configurer les dossiers à la main.
|
||||
|
||||
Nouveau projet : partir de [`projects/example/conf.json`](../../projects/example/conf.json) → `projects/<nouvel_id>/conf.json`.
|
||||
|
||||
Convention agents : `.smartIde/rules/smart-ide-ia-dev-bridge.mdc`.
|
||||
|
||||
|
||||
@ -1,52 +1,5 @@
|
||||
{
|
||||
"id": "<name>",
|
||||
"<name>": "<name>",
|
||||
"cron": {
|
||||
"git_pull": true
|
||||
},
|
||||
"project_path": ".",
|
||||
"build_dirs": [],
|
||||
"deploy": {},
|
||||
"version": {
|
||||
"package_json_paths": [],
|
||||
"splash_app_<name>": "<name>"
|
||||
},
|
||||
"mail": {
|
||||
"imap_bridge_env": ".secrets/git-issues/imap-bridge.env"
|
||||
},
|
||||
"git": {
|
||||
"wiki_url": "https://git.<domain>/4nk/<name>/wiki",
|
||||
"token_file": ".secrets/git-issues/token"
|
||||
},
|
||||
"tickets": {
|
||||
"ticketing_url": "https://git.<domain>/4nk/<name>/issues",
|
||||
"authorized_emails": {
|
||||
"to": [
|
||||
{
|
||||
"test": "AI.<name>.TEST@<domain>",
|
||||
"pprod": "AI.<name>.PPROD@<domain>",
|
||||
"prod": "AI.<name>.PROD@<domain>"
|
||||
}
|
||||
],
|
||||
"from": ["<name>@<domain>"]
|
||||
}
|
||||
},
|
||||
"smart_ide": {
|
||||
"remote_data_access": {
|
||||
"environments": {
|
||||
"test": {
|
||||
"ssh_host_alias": "<name>-test",
|
||||
"remote_data_directories": []
|
||||
},
|
||||
"pprod": {
|
||||
"ssh_host_alias": "<name>-pprod",
|
||||
"remote_data_directories": []
|
||||
},
|
||||
"prod": {
|
||||
"ssh_host_alias": "<name>-prod",
|
||||
"remote_data_directories": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"id": "smart_ide",
|
||||
"default_env": "test",
|
||||
"notes": "Copier vers projects/active-project.json (non versionné). Définition complète d’un projet : projects/<id>/conf.json (seul fichier par id, inclut smart_ide.workspace pour VS Code / Cursor)."
|
||||
}
|
||||
|
||||
@ -47,6 +47,15 @@
|
||||
"remote_data_directories": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
"folders": [
|
||||
{ "path": "../.." },
|
||||
{ "path": "../../builazoo" }
|
||||
],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "builazoo"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../.."
|
||||
},
|
||||
{
|
||||
"path": "../../builazoo"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "builazoo"
|
||||
}
|
||||
}
|
||||
@ -94,6 +94,16 @@
|
||||
"test": "enso-test",
|
||||
"pprod": "enso-pprod",
|
||||
"prod": "enso-prod"
|
||||
},
|
||||
"workspace": {
|
||||
"folders": [
|
||||
{ "path": "../.." },
|
||||
{ "path": "../../enso" },
|
||||
{ "path": "../../builazoo" }
|
||||
],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "enso"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../.."
|
||||
},
|
||||
{
|
||||
"path": "../../enso"
|
||||
},
|
||||
{
|
||||
"path": "../../builazoo"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "enso"
|
||||
}
|
||||
}
|
||||
61
projects/example/conf.json
Normal file
61
projects/example/conf.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"id": "<name>",
|
||||
"<name>": "<name>",
|
||||
"cron": {
|
||||
"git_pull": true
|
||||
},
|
||||
"project_path": ".",
|
||||
"build_dirs": [],
|
||||
"deploy": {},
|
||||
"version": {
|
||||
"package_json_paths": [],
|
||||
"splash_app_<name>": "<name>"
|
||||
},
|
||||
"mail": {
|
||||
"imap_bridge_env": ".secrets/git-issues/imap-bridge.env"
|
||||
},
|
||||
"git": {
|
||||
"wiki_url": "https://git.<domain>/4nk/<name>/wiki",
|
||||
"token_file": ".secrets/git-issues/token"
|
||||
},
|
||||
"tickets": {
|
||||
"ticketing_url": "https://git.<domain>/4nk/<name>/issues",
|
||||
"authorized_emails": {
|
||||
"to": [
|
||||
{
|
||||
"test": "AI.<name>.TEST@<domain>",
|
||||
"pprod": "AI.<name>.PPROD@<domain>",
|
||||
"prod": "AI.<name>.PROD@<domain>"
|
||||
}
|
||||
],
|
||||
"from": ["<name>@<domain>"]
|
||||
}
|
||||
},
|
||||
"smart_ide": {
|
||||
"remote_data_access": {
|
||||
"environments": {
|
||||
"test": {
|
||||
"ssh_host_alias": "<name>-test",
|
||||
"remote_data_directories": []
|
||||
},
|
||||
"pprod": {
|
||||
"ssh_host_alias": "<name>-pprod",
|
||||
"remote_data_directories": []
|
||||
},
|
||||
"prod": {
|
||||
"ssh_host_alias": "<name>-prod",
|
||||
"remote_data_directories": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
"folders": [
|
||||
{ "path": "../.." },
|
||||
{ "path": "../../<name>" }
|
||||
],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "<name>"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
# Exemple de configuration client OpenSSH (~/.ssh/config).
|
||||
# Copier vers ~/.ssh/config ou inclure avec : Include /chemin/vers/smart_ide/projects/ssh-config.local
|
||||
# Copier vers ~/.ssh/config ou inclure avec : Include /chemin/vers/smart_ide/projects/example/ssh-config.local
|
||||
# (ne pas versionner de fichier contenant des données personnelles non nécessaires).
|
||||
#
|
||||
# Alignement avec le dépôt :
|
||||
# - projects/<id>/conf.json → smart_ide.remote_data_access.environments.*.ssh_host_alias
|
||||
# - projects/active-project.json.example → alias <name>-test | <name>-pprod | <name>-prod
|
||||
# - projects/active-project.json (gabarit : active-project.json.example) → id projet actif pour l’IDE uniquement
|
||||
#
|
||||
# Remplacer <SSH_USER>, <LAN_IP_*>, <forge_host>, <key_file> selon le poste.
|
||||
# Bastion optionnel par Host : ProxyJump <SSH_USER>@<bastion_host>
|
||||
@ -47,6 +47,12 @@
|
||||
"remote_data_directories": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
"folders": [{ "path": "../.." }],
|
||||
"settings": {
|
||||
"smartIde.activeProjectId": "smart_ide"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user