summaryrefslogtreecommitdiff
path: root/yarns/400-build.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@exolobe1>2018-05-13 15:30:23 +0300
committerLars Wirzenius <liw@liw.fi>2018-05-17 21:44:59 +0300
commitb11d31ef23c5dfee6bfa54afbec47fc8b8bab7b1 (patch)
tree2e6b085f8fb023d53c8ac20a97aef2c7d1c11d4b /yarns/400-build.yarn
parent531dd2c50bfdfcf50bb37f57cf9fc2b69787adcf (diff)
downloadick2-b11d31ef23c5dfee6bfa54afbec47fc8b8bab7b1.tar.gz
Change: how controller stores persistent data
Replace old State class with new FilePersistentState and TransactionalState classes. Use new Resource class instead of raw dicts. Use context managers for creating, updating resources, to avoid mistakes from accidentally not saving changes. Overall persistence should now be rather simpler. This should open up a possibility for changing the controller to insert more actions into the build graph, to trigger notifcations via the workers.
Diffstat (limited to 'yarns/400-build.yarn')
-rw-r--r--yarns/400-build.yarn49
1 files changed, 11 insertions, 38 deletions
diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn
index c167ac2..4b3c085 100644
--- a/yarns/400-build.yarn
+++ b/yarns/400-build.yarn
@@ -74,11 +74,7 @@ Add a second project so we know each project gets its own work steps.
... }
THEN result has status code 201
-There are no builds for the project yet, and is idle.
-
- WHEN user makes request GET /projects/rome/status
- THEN result has status code 200
- AND body matches { "status": "idle" }
+There are no builds yet.
WHEN user makes request GET /builds
THEN result has status code 200
@@ -95,14 +91,9 @@ Register a worker.
... }
THEN result has status code 201
-Trigger build. First with an invalid status, then a real one.
-
- WHEN user makes request PUT /projects/rome/status
- ... with a valid token and body { "status": "VANDALS!" }
- THEN result has status code 400
+Trigger build.
- WHEN user makes request PUT /projects/rome/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/rome/+trigger
THEN result has status code 200
Worker wants work and gets the first step to run. If the worker asks
@@ -150,13 +141,6 @@ the worker to construct a new workspace for the build.
User can now see pipeline is running and which worker is building it.
- WHEN user makes request GET /projects/rome/status
- THEN result has status code 200
- AND body matches
- ... {
- ... "status": "building"
- ... }
-
WHEN user makes request GET /workers/obelix
THEN result has status code 200
AND body matches
@@ -396,14 +380,8 @@ Now there's no more work to do.
THEN result has status code 200
AND body matches {}
-The pipeline status indicates success.
-
- WHEN user makes request GET /projects/rome/status
- THEN result has status code 200
- AND body matches { "status": "idle" }
-
-Also, there's a build with a log. Also, the build status shows there's
-no current action.
+There's a build with a log. Also, the build status shows there's no
+current action.
WHEN user makes request GET /builds
THEN result has status code 200
@@ -458,8 +436,7 @@ no current action.
Start build again. This should become build number 2.
- WHEN user makes request PUT /projects/rome/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/rome/+trigger
THEN result has status code 200
WHEN obelix makes request GET /work
@@ -684,8 +661,7 @@ Register a worker.
Build the first project.
- WHEN user makes request PUT /projects/first/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/first/+trigger
THEN result has status code 200
WHEN obelix makes request GET /work
@@ -733,8 +709,7 @@ Build the first project.
Build second project.
- WHEN user makes request PUT /projects/second/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/second/+trigger
THEN result has status code 200
WHEN obelix makes request GET /work
@@ -854,12 +829,11 @@ Register a couple of workers.
Trigger both projects.
- WHEN user makes request PUT /projects/first/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/first/+trigger
THEN result has status code 200
WHEN user requests list of builds
- THEN the list of builds is []
+ THEN the list of builds is ["first/1"]
WHEN asterix makes request GET /work
THEN result is step
@@ -871,8 +845,7 @@ Trigger both projects.
WHEN user requests list of builds
THEN the list of builds is ["first/1"]
- WHEN user makes request PUT /projects/second/status
- ... with a valid token and body { "status": "triggered" }
+ WHEN user makes request GET /projects/second/+trigger
THEN result has status code 200
WHEN obelix makes request GET /work