databrickslabs / databrickslabs/ontos
[Feature]: Auto-commit background task
Nobody has claimed this yet.
- 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 = FalseandGIT_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_COMMITandGIT_AUTO_COMMIT_INTERVALsettings 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_pushwhich 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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