-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Something like this:
tasks
├── 00_setup
├── 01_cases
├── 02_allegations
├── 03_pages
├── 04_participants
└── 05_docket
Ideally, each task can be run by cd tasks/<task_dir>; make. We can iron out specific endpoints as we need them, but here's the Makefile I sketched out for allegations:
SHELL := /bin/bash
all: setup pre task post teardown
clean:
# Undo everything related to the task. Called manually.
python3 ./clean.py
setup:
# Anything that needs to be set up for this specific task
which python3
python3 ./setup.py
teardown:
# Anything that needs to be unset every time
echo Teardown
pre:
# Tests post-setup and pre-main
echo Testing parser
python3 ./test_parser.py
echo Testing database state
python3 ./test_db.py
task:
python3 ./task.py
post:
# Tests post-main and pre-teardown
python3 ./post.py
So:
- Running
makebuilds the task until it hits a failed stage. make cleanwill revert any potential changes made by the task.- Other steps that part of the
alltarget are meant to do what their comment in theMakefiledescribes.
Then we can set up a top-level task runner that runs tasks in order until a success. It would also be cool to be able to roll back to a specific number.
For example:
make tasks # Runs tasks 00, 01, 02, 03, 04, but fails on 04. Does not continue to 05.
# (Do some debugging)
make rollback 02 # Roll back to step 02: run `make clean` for 04, then for 03.
# (Do more debugging)
make clean # Undo everything else: run `make clean` for 02, then 01, then 00Ideally, we:
- Document what
maketargets a task should provide, and what constraints they should satisfy. - Document how to set up a task (e.g. how to access the
Commonpackage)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels