conductor

CI task system
git clone git://git.finwo.net/app/conductor
Log | Files | Refs | README | LICENSE

contributing.md (2337B)


      1 Contributing
      2 ============
      3 
      4 Layout
      5 ------
      6 
      7 ```
      8 git push -> post-receive -> conductor -> task graph in the database
      9                                 |
     10                           worker polls
     11                                 |
     12              source tarball, container, log stream, artifacts
     13 ```
     14 
     15   - `src/conductor` triggers, scheduling, the API, the login provider
     16   - `src/worker`    the agent that runs tasks, with no npm dependencies
     17   - `src/lib`       configuration, database, storage, pipelines, git
     18   - `web`           the application, a mithril client of the API
     19 
     20 Queries are written once against all three databases using named `{key}`
     21 markers, which each driver compiles to its own placeholder syntax.
     22 Timestamps are epoch milliseconds everywhere.
     23 
     24 Testing
     25 -------
     26 
     27 ```sh
     28 npm test
     29 ```
     30 
     31 That is the whole setup. With docker available the suite starts what it
     32 needs and cleans up after itself:
     33 
     34 | Dependency          | Used for                                           |
     35 | ------------------- | -------------------------------------------------- |
     36 | `alpine`            | containers for the worker to actually run tasks in |
     37 | MinIO               | object storage, artifacts and archived logs        |
     38 | mock-oauth2-server  | a real OIDC provider to authenticate against       |
     39 
     40 Nothing is stubbed, because the failures worth catching live in the parts a
     41 stub would replace. Hand written SigV4 signing is only meaningfully tested
     42 by a server that rejects a bad signature, and the JWKS path was wrong
     43 against every provider except the one it was written for.
     44 
     45 Without docker those tests skip and the rest still run:
     46 
     47 ```sh
     48 CONDUCTOR_TEST_NO_DOCKER=1 npm test
     49 ```
     50 
     51 To test against a different object store, such as Garage or AWS, point the
     52 same tests at it instead of starting MinIO:
     53 
     54 ```sh
     55 docker run -d -p 9000:9000 -e MINIO_ROOT_USER=testkey \
     56   -e MINIO_ROOT_PASSWORD=testsecret123 quay.io/minio/minio server /data
     57 
     58 CONDUCTOR_TEST_S3_ENDPOINT=http://127.0.0.1:9000 \
     59 CONDUCTOR_TEST_S3_KEY=testkey \
     60 CONDUCTOR_TEST_S3_SECRET=testsecret123 npm test
     61 ```
     62 
     63 Building
     64 --------
     65 
     66 The application is built separately; the container image builds it in its
     67 own stage:
     68 
     69 ```sh
     70 npm run build
     71 ```
     72 
     73 The icon is geometry rather than an image, drawn at each size it ships in.
     74 Rerun after changing `util/icon.js`, then rebuild:
     75 
     76 ```sh
     77 npm run icon
     78 ```