Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ProjectStateStore.write_project always fails: it calls DotProjectWriter.write(), which has never existed

Aperta
#574 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@i-am-paradox ci sta già lavorando.

Dal 11/10/2026.

  • #588 di @i-am-paradox — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with write_project and write_maintainers in packages/darnit/src/darnit/stores/defaults/project.py (lines 61-71 and 86), and confirm the AttributeError by running mypy on that file. The methods also appear in the ProjectStateStore Protocol in darnit/stores/protocols.py and in the in-memory store. Check tests/darnit/stores/test_us1_equivalence.py and tests/darnit/context_integrity/test_single_writer.py. Done when the methods are gone from the Protocol and both implementations, and those tests pass, but the removal-versus-routing choice still needs a maintainer decision.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

module-core needs triage

FilesystemProjectStateStore.write_project (packages/darnit/src/darnit/stores/defaults/project.py:61-71) calls DotProjectWriter(...).write(config). DotProjectWriter has never had a write() method, only update(dict); no commit in dot_project.py's history adds one. So write_project, and write_maintainers, which calls it at line 86, always raise StoreOperationError (wrapping an AttributeError).

It has been broken since the store was added in feature 033 (f24a554, 2026-08-26). Nobody noticed because:

  • No production code calls either method. The audit only reads from the project store (tools/audit.py:892), and real .project/ writes go through darnit.config.context_writes (feature 042, the single writer).
  • The only test that calls write_project (tests/darnit/stores/test_us1_equivalence.py) uses InMemoryProjectStateStore from darnit-testchecks. The filesystem implementation has never run.
  • CI's type check runs mypy on two files with || true. On project.py alone, mypy reports "DotProjectWriter" has no attribute "write" [attr-defined].

Users aren't affected today. But ProjectStateStore.write_project / write_maintainers are part of a plugin-facing Protocol (darnit/stores/protocols.py), so a third-party caller or backend author would build on a method that cannot work.

Proposal: remove write_project and write_maintainers from the ProjectStateStore Protocol and its implementations (filesystem and in-memory). Since feature 042, .project/project.yaml is never written with context values, and context_writes is the only writer (framework-design.md 7.4-7.11, tests/darnit/context_integrity/test_single_writer.py). A generic "write a whole ProjectConfig" method on the store conflicts with that rule.

The alternative is to route them through context_writes with the same restrictions. That keeps a write surface no caller needs.

Found while reviewing #504. A repo-wide audit for other declared-but-unwired interfaces like this one is under way.

Drafted with Claude Code; reviewed and posted by me.

Lingua principale
Python
Stelle
22
Fork
27
Merge medio
2g 1h
PR unite (30g)
35

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di darnitdevorg/darnit

Tutte le issue di darnitdevorg/darnit

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.