databrickslabs / databrickslabs/ontos

[Feature]: Auto-commit background task

Open
#259 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope/settings type/feature
Dominant language
Python
Stars
212
Forks
71
Avg merge
4d 10h
Merged PRs (30d)
43

Description

Parent PRD

#254

What to build

A configurable auto-commit mode that batches uncommitted YAML changes and pushes them periodically.

Backend:

  • New settings: GIT_AUTO_COMMIT: bool = False and GIT_AUTO_COMMIT_INTERVAL: int = 60 (seconds), persisted in DB and loadable from env vars.
  • Background asyncio task that runs on a timer: checks for uncommitted changes via GitService, commits with a summary message, pushes.
  • Commit message format: "Ontos auto-sync: {N} files changed ({summary}) at {timestamp}", where summary lists entity types (e.g., "2 contracts, 1 product").
  • Task is started/stopped when the setting changes at runtime.
  • Auto-commit is paused during sync_all() to avoid partial commits.

Frontend:

  • Auto-commit toggle and interval input on the Delivery settings page (visible when indirect mode is expanded).
  • Settings saved alongside other delivery mode settings.

Unit test: Mock GitService and timer. Assert commit is called after interval when changes exist. Assert no commit when no changes.

Acceptance criteria

  • GIT_AUTO_COMMIT and GIT_AUTO_COMMIT_INTERVAL settings in config, persisted in DB
  • Background task commits+pushes on the configured interval when changes exist
  • No commit when there are no changes
  • Task starts/stops when setting is toggled at runtime
  • Auto-commit paused during sync_all()
  • Commit messages summarize what changed
  • Auto-commit toggle + interval input on delivery settings page
  • Unit test for timer/batching logic

Blocked by

  • Blocked by #257 (pull-before-push — auto-commit uses commit_and_push which must pull first)

User stories addressed

  • User story 5 (toggle between manual and auto-commit)
  • User story 6 (configurable auto-commit interval)
  • User story 16 (auto-commit messages summarize changes)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the configuration and database settings flow, the GitService entry points, sync_all(), and the Delivery settings page. Check the dependency on #257 before implementing the timer and runtime lifecycle. Done means persisted settings, correct commit and push behavior only when changes exist, pause behavior during sync_all(), summarized messages, UI controls, and the requested unit test.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
backend, database, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.