Contributing
The repositories are grynn-in/konsolidat, grynn-in/konsol and grynn-in/konsol-cli on GitHub. Issues are the record of decisions: a change that settles a question names the issue and the option rejected.
Git workflow
- Branch from
main. Branch names in use are short and name the issue:k246-reconcile-run-id,close-d2fu,v16-image. - Commit with a subject that says what changed and why, in plain words, citing the issue:
#246: LAGGING means missing from the latest reconcile run,Remove cost allocation (konsol#264). Conventional-commit prefixes are not used. - Open a pull request against
main; CI must be green; it is reviewed before merge. - A change that spans dbt and konsol says in both descriptions which half must merge first (usually the one that writes the column the other reads).
Code style
SQL (dbt)
- Lowercase keywords,
snake_case,dim_prefix for dimensions, CTEs over subqueries. - Dimension and measure macros instead of named columns;
db_adapter.sqlmacros instead of raw ClickHouse functions. - Read reference data from
source('epm_staging', ...). Never add a seed; never read an ERP rate for translation. - A header comment that names the issue the model implements.
- Gold models: a
domain:tag and a Build Model row (scripts/check_gold_domains.py).
Python (konsol)
- Writes are
@frappe.whitelist(methods=["POST"]); reads may be GET. Close methods: one verb each, a role gate first (frappe.only_for), entity scope on reads (tests/test_close_api_contract.pypins this). - No
frappe.db.commit()inside document hooks; work that must follow a commit goes inafter_commitor an enqueued job. - ClickHouse SQL is sent in the POST body with parameters, never built into a URL.
- Refuse what makes a number wrong; report what makes it unexplained; never let data create configuration (konsol#247).
- Error messages are sentences a controller can act on; they name the entity, period or account.
Doctypes
- Repeating rows are a child table of a parent doctype.
- Tab, Section and Column Breaks, Title Case labels with help text,
reqdonly when always required,track_changeson. - Submit is the approval; Reject returns to Draft.
close-ui (Vue)
- Pure modules (
nav.js,periodGrid.js, ...) with a*.test.mjsbeside each; screens render what the server computed and never decide status from a label.
Tests
| Repository | Command |
|---|---|
| konsolidat, unit | python -m unittest -v tests.<module> (CI runs each) |
| konsolidat, warehouse | python scripts/ci_full_build.py --with-integration builds the whole project on a throwaway ClickHouse; scripts/fixture_gate.py --all runs every must-flag fixture; scripts/tb_only_first_build.py proves a TB-only first build |
| konsol, host | .venv/bin/python scripts/run-host-tests.py |
| konsol, close-ui | cd close-ui && yarn test |
| konsol, live | copy changed files into konsolidat_backend and konsolidat_worker, restart the worker, run a plain script with frappe.init(site=...); prove a fix with an A/B |
| konsol-cli | pytest tests/ -q |
Rules: every gold model has at least one singular test; a test that cannot fail is a defect (konsolidat#249 fixed seven); financial comparisons use the currency's minor unit or the declared tolerance, not a literal; a new assertion gets a plain-language description (konsolidat#248).
Pull-request checklist
- Based on the latest
main; CI green - The description names the issue, the decision taken and the alternative rejected
- dbt: models use the dimension, measure and adapter macros;
dbt parsepasses; the full build passes on the throwaway ClickHouse - dbt: new gold model tagged, registered in Build Model, documented in
_*__models.yml, tested - konsol: writes are POST; role gate and entity scope present;
_REFERENCE_TABLE_DDLmatchesinit-db.sqlif a table changed - konsol: a doctype change ships its patch and an upgrade note in
HANDOFF.md - Docs updated in
sites/docswhen user-facing behaviour changed; no retired name or legacy formula syntax (see the glossary's Retired terms)
Getting help
- Open an issue on grynn-in/konsolidat (warehouse, deploy) or grynn-in/konsol (app, API, close, add-in).
- Include the commit, the container (
docker compose ps), and the dbt or ClickHouse message.