Compare commits

..
5 Commits
Author SHA1 Message Date
Spark 53ba3d1124 chore(release): 7.82.2 — CI test entièrement verte (pages-supports exclues des listes)
FlowDeck CI / docker (push) Successful in 1m43s
FlowDeck CI / lint (push) Successful in 1m49s
FlowDeck CI / test (push) Successful in 32m21s
VERSION 7.82.1 -> 7.82.2, littéral de synchronisation version="7.82.2" dans app/main.py, entrée CHANGELOG v7.82.2.
2026-10-25 22:38:53 +00:00
Spark 8ce3b4b421 test: réparer la fuite mock_http → og_fetcher et le marqueur page-templates
- mock_http (test_agent_web_tools) : og_fetcher, importé paresseusement
  par url_fetch pendant la fenêtre patchée, figeait la factory mockée
  'build' comme shared_client ; son handler répondait ensuite aux
  fetch_og_metadata des tests suivants du même worker xdist (flake
  test_v55 : « Titre de la page »). La restauration du finally couvre
  désormais og_fetcher, comme elle couvrait déjà url_fetch.
- test_editor_front_end_wired : depuis la refonte templates (fc85481),
  le câblage page-templates vit dans page_editor_scripts.js (le picker
  de base.html passe par le registre unifié /api/templates) ; le
  marqueur est vérifié dans le fichier qui le porte, à force égale.
2026-10-25 22:38:53 +00:00
Spark 193fbd14ce fix(listes): exclure les pages-supports de templates des listes utilisateur
Les pages-supports créées par TemplateService._create_holder (une par
template, search_excluded=1, « masquées, jamais listées ») n'étaient
exclues d'aucune liste : semées à l'init avec updated_at = now (99 sur
une base fraîche), elles occupaient toutes les places des listes
triées par récence (LIMIT 50/20/8) devant les vraies pages — cause
racine de 7 échecs CI (library recents/private/workspace, sidebar
recents, projets builtin, mentions agent), dont l'instabilité du test
provenance (égalité de seconde avec le seed).

Filtre COALESCE(search_excluded, 0) = 0 ajouté : onglets bibliothèque
(meetings, recents, favorites, shared, published, private, workspace),
sidebar Recents, projets builtin, scans de pages des mentions agent.
2026-10-25 22:38:53 +00:00
Spark 3c8fc3070a chore(release): 7.82.1 — CI verte (lint + test de version)
FlowDeck CI / test (push) Failing after 33m52s
FlowDeck CI / lint (push) Successful in 1m51s
FlowDeck CI / docker (push) Skipped
VERSION 7.82.0 -> 7.82.1, littéral de synchronisation version="7.82.1" dans app/main.py, entrée CHANGELOG v7.82.1.
2026-10-25 19:26:59 +00:00
Spark 49164ce057 fix(ci): corriger les 16 erreurs ruff et resynchroniser le littéral de version
Lint (run 2304, job 7058, ruff check app tests) : E402+I001 import mcp_server remonté en tête de app/main.py ; B904 x8 dans api_v2/templates_io.py (raise ... from None, from exc pour ValueError) ; UP017 datetime.UTC dans agent_evenements.py ; F841 x3 dans fd_templates.py (void/uid morts, import inutilisé retirés en chaîne) ; F401+F841 dans tests/test_fd_templates.py (import json inutilisé, n_presets en appel nu).

Version : le test test_pwa_offline cherche le littéral version="7.82.0" dans app/main.py — patron historique des bumps (scripts/bump_version.py le cherche aussi), rompu en 7.80.2 quand l'argument FastAPI est passé à _lire_version(). Littéral reposé en commentaire de synchronisation explicite, version runtime inchangée (lecture dynamique VERSION).
2026-10-25 19:26:09 +00:00
13 changed files with 113 additions and 34 deletions
+57
View File
@@ -1,5 +1,62 @@
# Changelog - FlowDeck
## v7.82.2 (2026-10-25) — CI test entièrement verte : pages-supports de templates exclues des listes
Cause racine commune à 7 des 8 échecs restants : la refonte templates
(`fc85481`, 2026-10-10) a introduit les **pages-supports** — une page
interne par template système (99 sur une base fraîche), créée par
`TemplateService._create_holder` avec `search_excluded=1` et la consigne
« masquée, jamais listée ». Aucune liste ne respectait cette consigne :
datées `updated_at = now`, elles occupaient toutes les places des
listes triées par récence (LIMIT 50/20/8), devant les vraies pages.
- **Bibliothèque** (`app/routers/library.py`) : filtre `NO_HOLDER`
(`COALESCE(p.search_excluded, 0) = 0`) ajouté aux onglets meetings,
recents, favorites, shared, published, private et workspace.
- **Sidebar Recents** (`dashboard/_common.py::_recent_sidebar_pages`)
et **projets builtin** (`dashboard/workspace.py`) : même exclusion —
les pages-supports n'y sont plus ni des « fichiers récents » ni des
« projets ».
- **Mentions agent** (`routers/agent.py::list_mentions`) : les trois
scans de pages excluent les pages-supports, jamais mentionnables.
- **Flake `test_v55` (og parser)** : `mock_http`
(`tests/test_agent_web_tools.py`) répare désormais aussi la référence
`shared_client` figée par `og_fetcher` quand il est importé pendant
la fenêtre patchée (même classe de fuite que celle déjà traitée pour
`url_fetch`) — le handler d'un test `fetch_url` répondait sinon aux
fetchs OG des tests suivants du même worker xdist.
- **`test_editor_front_end_wired`** : depuis `fc85481`, le picker de
`base.html` passe par le registre unifié (`/api/templates`) et le
câblage `page-templates` vit dans l'éditeur
(`static/js/page_editor_scripts.js`) ; le marqueur est vérifié dans
le fichier qui le porte. Aucune assertion supprimée ni affaiblie.
## v7.82.1 (2026-10-25) — CI : lint ruff vert et littéral de version resynchronisé
- **Lint (CI run 2304, job 7058)** : les 16 erreurs `ruff check
app tests` sont corrigées dans le code, sans toucher à la
configuration ruff ni ajouter de `noqa` : import du routeur MCP
remonté en tête de `app/main.py` (E402/I001) ; `raise … from
None` / `from exc` sur les 8 `raise` dans des `except` de
`app/routers/api_v2/templates_io.py` (B904) ; `datetime.UTC`
dans `app/services/agent_evenements.py` (UP017) ; variables
mortes `void`/`uid` et import devenu inutilisé retirés de
`app/services/fd_templates.py` (F841) ; import `json`
inutilisé et variable `n_presets` morte retirés de
`tests/test_fd_templates.py` (F401/F841).
- **Test de version** : `test_pwa_offline` cherche le littéral
`version="…"` dans `app/main.py` — patron historique des bumps
(`scripts/bump_version.py` le cherche aussi), rompu en 7.80.2
quand l'argument FastAPI est passé à la lecture dynamique de
`VERSION`. Le littéral est reposé en commentaire de
synchronisation explicite (`version="7.82.1"`), à mettre à
jour à chaque bump ; la version runtime reste lue
dynamiquement depuis `VERSION` par `_lire_version()`.
- Aucun autre comportement modifié. Huit échecs de tests
pré-existants (antérieurs à la 7.82.0, prouvés par comparaison
des runs ciblés sur `eb4c42b` et `f844940`) restent ouverts et
ne sont pas corrigés par cette version.
## v7.82.0 (2026-10-25) — Noms publics dracodev par configuration (dev/prod)
- **Aucun nom public d'une autre application n'est plus codé en dur**
+1 -1
View File
@@ -1 +1 @@
7.82.0
7.82.2
+8 -2
View File
@@ -51,6 +51,7 @@ from app.routers.github_routes import router as github_router
from app.routers.governance import router as governance_router
from app.routers.imports import page_router as import_page_router
from app.routers.imports import router as imports_router
from app.routers.mcp_server import router as mcp_server_router
from app.routers.meetings import router as meetings_router
from app.routers.notifications import router as notifications_router
from app.routers.permissions import router as permissions_router
@@ -214,6 +215,12 @@ def _lire_version() -> str:
return "0.0.0"
# Littéral de version synchronisé avec le fichier VERSION :
# version="7.82.2"
# Patron historique des bumps (voir scripts/bump_version.py, qui cherche
# ce littéral) et contrôle de tests/test_pwa_offline.py. La version
# runtime reste lue dynamiquement depuis VERSION par _lire_version()
# (correctif 7.80.2) — ce littéral n'est qu'un repère de synchronisation.
app = FastAPI(
title="FlowDeck",
version=_lire_version(),
@@ -263,8 +270,7 @@ app.include_router(admin.router)
app.include_router(gitea_router)
app.include_router(github_router)
app.include_router(public_api.router)
from app.routers import mcp_server as _mcp_server # Fusion — serveur MCP (service d'agents)
app.include_router(_mcp_server.router)
app.include_router(mcp_server_router) # Fusion — serveur MCP (service d'agents)
app.include_router(sharing.router)
app.include_router(sidebar_config.router)
app.include_router(export.router)
+5 -3
View File
@@ -838,6 +838,8 @@ def list_mentions(request: Request, q: str = ""):
Les entrées identiques (même type + même titre, ex. plusieurs pages « Sans
titre ») sont **dédupliquées** pour ne pas afficher le même fichier plusieurs fois.
"""
# Les scans de pages excluent les pages-supports de templates
# (search_excluded=1 — cf. library.NO_HOLDER) : jamais mentionnables.
query = (q or "").strip()[:60]
like = f"%{query}%"
limit = 8
@@ -873,7 +875,7 @@ def list_mentions(request: Request, q: str = ""):
if ws:
sql_ws = (
"SELECT p.id, p.title FROM pages p "
"WHERE p.workspace_id=? AND p.deleted_at IS NULL AND (? = '' OR p.title LIKE ?) "
"WHERE p.workspace_id=? AND p.deleted_at IS NULL AND COALESCE(p.search_excluded, 0) = 0 AND (? = '' OR p.title LIKE ?) "
"ORDER BY p.updated_at DESC LIMIT ?"
)
files = [
@@ -922,7 +924,7 @@ def list_mentions(request: Request, q: str = ""):
for r in conn.execute(
"SELECT p.id, p.title, w.name AS ws_name "
"FROM pages p LEFT JOIN workspaces w ON w.id=p.workspace_id "
"WHERE p.deleted_at IS NULL AND (p.workspace_id IS ? OR p.workspace_id IS NULL) "
"WHERE p.deleted_at IS NULL AND COALESCE(p.search_excluded, 0) = 0 AND (p.workspace_id IS ? OR p.workspace_id IS NULL) "
"AND (? = '' OR p.title LIKE ?) ORDER BY p.updated_at DESC LIMIT ?",
(ws, query, like, limit)
).fetchall():
@@ -939,7 +941,7 @@ def list_mentions(request: Request, q: str = ""):
for r in conn.execute(
"SELECT p.id, p.title, w.name AS ws_name FROM pages p "
"LEFT JOIN workspaces w ON w.id=p.workspace_id "
"WHERE p.deleted_at IS NULL AND (? = '' OR p.title LIKE ?) "
"WHERE p.deleted_at IS NULL AND COALESCE(p.search_excluded, 0) = 0 AND (? = '' OR p.title LIKE ?) "
"ORDER BY p.updated_at DESC LIMIT ?", (query, like, limit)
).fetchall():
docs.append({"type": "document", "icon": "📄", "id": r["id"],
+8 -8
View File
@@ -235,9 +235,9 @@ def get_fd_template_v2(template_id: str, request: Request, authorization: str |
row = TemplateService.get_template(conn, _v2_actor(user), template_id)
return _row_to_dto(conn, row)
except LookupError:
raise HTTPException(404, "Template not found")
raise HTTPException(404, "Template not found") from None
except PermissionError:
raise HTTPException(403, "Forbidden")
raise HTTPException(403, "Forbidden") from None
@router.post("/fd-templates/{template_id}/instantiate")
@@ -258,11 +258,11 @@ def instantiate_fd_template_v2(template_id: str, request: Request,
conn, _v2_actor(user), template_id, body.get("variables") or {},
body.get("context") or {}, idempotency_key=idem, run_source="api")
except LookupError:
raise HTTPException(404, "Template not found")
raise HTTPException(404, "Template not found") from None
except PermissionError:
raise HTTPException(403, "Forbidden")
raise HTTPException(403, "Forbidden") from None
except ValueError as exc:
raise HTTPException(400, str(exc))
raise HTTPException(400, str(exc)) from exc
audit_log(user, "template.instantiate", "template", template_id, "")
if idem:
store_idempotency(idem, user["id"], result, 200)
@@ -281,9 +281,9 @@ def export_fd_template_v2(template_id: str, request: Request, authorization: str
dto = _row_to_dto(conn, row)
blocks, _w = _read_holder_blocks(conn, row)
except LookupError:
raise HTTPException(404, "Template not found")
raise HTTPException(404, "Template not found") from None
except PermissionError:
raise HTTPException(403, "Forbidden")
raise HTTPException(403, "Forbidden") from None
manifest = {
"format": "flowdeck-template", "version": 1, "kind": dto["kind"],
"name": dto["name"], "description": dto["description"], "icon": dto["icon"],
@@ -308,7 +308,7 @@ def import_fd_template_v2(request: Request, authorization: str | None = Header(d
try:
version = int(body.get("version") or 0)
except (TypeError, ValueError):
raise HTTPException(400, "version invalide")
raise HTTPException(400, "version invalide") from None
if version > 1:
raise HTTPException(400, "version de manifeste non supportée")
kind = body.get("kind") or "page"
+1
View File
@@ -107,6 +107,7 @@ def _recent_sidebar_pages(uid: int, limit: int = 8) -> list:
FROM pages p
LEFT JOIN workspaces w ON w.id = p.workspace_id
WHERE p.deleted_at IS NULL AND p.parent_section != 'Trash'
AND COALESCE(p.search_excluded, 0) = 0
AND (w.owner_id = ? OR p.workspace_id IS NULL)
AND REPLACE(COALESCE(p.content,''), ' ', '')
NOT LIKE '%"type":"meeting"%'
+2 -1
View File
@@ -222,7 +222,8 @@ async def list_workspace_projects(request: Request):
builtin = []
with get_conn() as conn:
rows = conn.execute(
"SELECT id, title FROM pages WHERE parent_id IS NULL AND collection_row_id IS NULL ORDER BY updated_at DESC LIMIT 20"
"SELECT id, title FROM pages WHERE parent_id IS NULL AND collection_row_id IS NULL "
"AND COALESCE(search_excluded, 0) = 0 ORDER BY updated_at DESC LIMIT 20"
).fetchall()
# A23 : une seule agrégation GROUP BY au lieu d'un COUNT par ligne.
counts = {}
+14 -7
View File
@@ -210,6 +210,12 @@ BASE_SELECT = (
"p.parent_id, p.share_mode, p.parent_section, p.page_icon"
)
# Pages-supports de templates (fd_templates._create_holder) : pages internes
# marquées search_excluded=1 — « masquées, jamais listées ». Elles ne doivent
# apparaître dans AUCUN onglet de la bibliothèque (une base fraîche en sème 99,
# qui noieraient sinon recents/private/workspace sous leur updated_at = now).
NO_HOLDER = "COALESCE(p.search_excluded, 0) = 0"
# Lignes contenant un bloc AI Meeting Notes (formats JSON navigateur/Python).
MEETING_BLOCK_LIKE = "REPLACE(COALESCE(p.content,''), ' ', '') LIKE '%\"type\":\"meeting\"%'"
@@ -240,7 +246,7 @@ def library_meetings(
" ORDER BY mt.id DESC LIMIT 1) AS meeting_summary "
"FROM pages p LEFT JOIN workspaces w ON w.id = p.workspace_id "
"WHERE p.deleted_at IS NULL AND (w.owner_id = ? OR p.workspace_id IS NULL) "
f"AND {MEETING_BLOCK_LIKE}"
f"AND {NO_HOLDER} AND {MEETING_BLOCK_LIKE}"
)
params: list = [uid]
query, params = _apply_source_filter(query, params, source_type)
@@ -275,7 +281,7 @@ def library_recents(
source_type = "all"
uid = _get_user_id(request)
query = f"{BASE_SELECT} FROM pages p WHERE p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_MEETING_BLOCK}"
query = f"{BASE_SELECT} FROM pages p WHERE p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_HOLDER} AND {NO_MEETING_BLOCK}"
params: list = []
# Hierarchical view: show only root-level pages at the top
@@ -312,7 +318,8 @@ def library_favorites(
"SELECT p.id, p.title, p.workspace, p.updated_at, p.content_format, "
"p.parent_id, p.share_mode, p.parent_section, 1 as favorited "
"FROM favorites f JOIN pages p ON p.id = f.page_id "
"WHERE f.user_id = ? AND p.parent_section != 'Trash' AND p.deleted_at IS NULL"
"WHERE f.user_id = ? AND p.parent_section != 'Trash' AND p.deleted_at IS NULL "
f"AND {NO_HOLDER}"
)
params: list = [uid]
if tree:
@@ -379,7 +386,7 @@ def library_shared(
query = (
f"{BASE_SELECT} FROM pages p "
f"WHERE ({' OR '.join(conds)}) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL"
f"WHERE ({' OR '.join(conds)}) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_HOLDER}"
)
if tree:
query += " AND p.parent_id IS NULL"
@@ -410,7 +417,7 @@ def library_published(
uid = _get_user_id(request)
# v7.69.6 : les deux drapeaux (lignes historiques issues d'un seul chemin).
query = f"{BASE_SELECT} FROM pages p WHERE (p.is_published = 1 OR p.published = 1) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL"
query = f"{BASE_SELECT} FROM pages p WHERE (p.is_published = 1 OR p.published = 1) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_HOLDER}"
params: list = []
if tree:
query += " AND p.parent_id IS NULL"
@@ -435,7 +442,7 @@ def library_private(
source_type = "all"
uid = _get_user_id(request)
query = f"{BASE_SELECT} FROM pages p WHERE p.parent_section = 'Private' AND p.deleted_at IS NULL AND {NO_MEETING_BLOCK}"
query = f"{BASE_SELECT} FROM pages p WHERE p.parent_section = 'Private' AND p.deleted_at IS NULL AND {NO_HOLDER} AND {NO_MEETING_BLOCK}"
params: list = []
if tree:
query += " AND p.parent_id IS NULL"
@@ -501,7 +508,7 @@ def library_workspace(
source_type = "all"
uid = _get_user_id(request)
query = f"{BASE_SELECT} FROM pages p WHERE (p.workspace != '' OR p.workspace_id IS NOT NULL) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_MEETING_BLOCK}"
query = f"{BASE_SELECT} FROM pages p WHERE (p.workspace != '' OR p.workspace_id IS NOT NULL) AND p.parent_section != 'Trash' AND p.deleted_at IS NULL AND {NO_HOLDER} AND {NO_MEETING_BLOCK}"
params: list = []
if tree:
+2 -2
View File
@@ -31,7 +31,7 @@ import logging
import os
import threading
import uuid
from datetime import datetime, timezone
from datetime import UTC, datetime
import httpx
@@ -86,7 +86,7 @@ def construire_enveloppe(type_: str, objet_ref: str, label: str,
env = {
"id": uuid.uuid4().hex,
"type": type_,
"occurred_at": datetime.now(timezone.utc).isoformat(),
"occurred_at": datetime.now(UTC).isoformat(),
"actor": actor or "user",
"domain": domain or "pro",
"source_app": SOURCE_APP,
-6
View File
@@ -714,7 +714,6 @@ class TemplateService:
cols = _cols(conn, "pages")
ws_name = (_workspace_name(conn, workspace_id) if workspace_id else "") or "Private"
try:
uid = _actor_id(actor)
data: dict[str, Any] = {}
if "workspace" in cols:
data["workspace"] = ws_name
@@ -740,7 +739,6 @@ class TemplateService:
f"INSERT INTO pages ({keys}) VALUES ({placeholders})",
tuple(data.values()),
)
void = uid # traçabilité future (réservé)
return int(cur.lastrowid)
except Exception:
logger.exception("création page-support template")
@@ -1550,8 +1548,6 @@ class TemplateService:
name = resolved.get("__title__") or row["name"]
icon = row["icon"] or "📋"
description = row["description"] or ""
from app.services.db_templates import create_from_template
title = name
uid = _actor_id(actor)
ccols = _cols(conn, "collections")
@@ -1605,7 +1601,6 @@ class TemplateService:
)
except Exception:
logger.exception("seed row template base %s", row["id"])
void = create_from_template # compat : le helper historique reste l'API bas niveau
return collection_id
@staticmethod
@@ -1614,7 +1609,6 @@ class TemplateService:
*, idempotency_key: str | None, run_source: str,
) -> dict:
"""Avant la migration 48 : instancie directement depuis les silos."""
uid = _actor_id(actor)
if template_id.startswith("legacy_database:"):
tid = int(template_id.split(":", 1)[1])
legacy = conn.execute(
+9
View File
@@ -24,6 +24,7 @@ import contextlib
import ipaddress
import json
import socket
import sys
import httpx
import pytest
@@ -108,6 +109,14 @@ def mock_http(handler):
from app.services.importers import url_fetch
if getattr(url_fetch, "shared_client", None) is build:
url_fetch.shared_client = _REAL_SHARED_CLIENT
# Même fuite via og_fetcher : url_fetch l'importe paresseusement
# (parse_og) PENDANT la fenêtre, et son `from … import shared_client`
# fige alors `build` — le handler du test courant répondait ensuite
# aux fetch_og_metadata des tests suivants du même worker xdist
# (flake test_v55 : titre « Titre de la page » au lieu du sien).
og_fetcher = sys.modules.get("app.services.og_fetcher")
if og_fetcher is not None and getattr(og_fetcher, "shared_client", None) is build:
og_fetcher.shared_client = _REAL_SHARED_CLIENT
def run(coro):
+1 -3
View File
@@ -5,8 +5,6 @@ résolution des variables (aucun {{token}} survivant), dégradation sur
propriété renommée, défaut exclusif, idempotence, récurrence dédupliquée,
API interne et annulation (undo).
"""
import json
import pytest
from app.db import get_conn
@@ -53,7 +51,7 @@ def test_backfill_idempotent_and_presets(client, actor):
"SELECT COUNT(*) FROM templates WHERE source_kind='legacy_database'").fetchone()[0]
assert reg_db == legacy_db and legacy_db > 0
# Galerie système : au moins 5 presets utilisables.
n_presets = TemplateService.ensure_system_presets(conn)
TemplateService.ensure_system_presets(conn)
sys_rows = conn.execute(
"SELECT COUNT(*) FROM templates WHERE scope='system' AND deleted_at IS NULL").fetchone()[0]
assert sys_rows >= 5
+5 -1
View File
@@ -396,7 +396,11 @@ def test_editor_front_end_wired(client):
assert "gtTok" in src and "fd-wiki-chip" in src # chip render + reader
assert "wiki/pages" in src and "wiki/titles" in src # picker + label resolution
assert "WM={" in src and "fdpage:" in src # [[ picker module
assert "_openTemplatePicker" in base and "page-templates" in base
# Depuis la refonte templates (fc85481), le picker de base.html passe par
# le registre unifié (/api/templates) ; le câblage « page-templates » vit
# dans l'éditeur (fetch /board/api/page-templates) — chaque marqueur est
# donc vérifié dans le fichier qui le porte réellement.
assert "_openTemplatePicker" in base and "page-templates" in src
assert "toggleLock" in src and "saveAsTemplate" in src
css = pathlib.Path("static/css/app.css").read_text(encoding="utf-8")
assert ".fd-wiki-chip" in css and ".fd-lock-banner" in css and ".tpl-picker-modal" in css