Skip to main content

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​

  1. Branch from main. Branch names in use are short and name the issue: k246-reconcile-run-id, close-d2fu, v16-image.
  2. 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.
  3. Open a pull request against main; CI must be green; it is reviewed before merge.
  4. 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.sql macros 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.py pins this).
  • No frappe.db.commit() inside document hooks; work that must follow a commit goes in after_commit or 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, reqd only when always required, track_changes on.
  • Submit is the approval; Reject returns to Draft.

close-ui (Vue)​

  • Pure modules (nav.js, periodGrid.js, ...) with a *.test.mjs beside each; screens render what the server computed and never decide status from a label.

Tests​

RepositoryCommand
konsolidat, unitpython -m unittest -v tests.<module> (CI runs each)
konsolidat, warehousepython 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-uicd close-ui && yarn test
konsol, livecopy 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-clipytest 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 parse passes; 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_DDL matches init-db.sql if a table changed
  • konsol: a doctype change ships its patch and an upgrade note in HANDOFF.md
  • Docs updated in sites/docs when 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.