Guide
Connect a task tracker
This tutorial connects a private task tracker to a GAOS product in seven steps. The tracker implements the contract GAOS publishes; GAOS never learns anything about the tracker except an address, a certificate, a credential, the products it may serve and, optionally, its web base. The example tracker is an invented one, Acme Tasks, running on a private address. What a binding then does is described on Task tracker (D-118).
Before you start
You need: a tracker you can change, a GAOS instance you deploy, an auto-fix admin account on its back office
(GAOS_AUTOFIX_ADMINS), and the product listed in GAOS_PR_TEMPLATE_PRODUCTS. Acme Tasks
here listens on 10.20.0.5:9443, a private address; its product code is ACME.
1. Implement the contract
Download task-tracker-v1.proto and generate a server
stub with your language’s gRPC tools (for Go, protoc-gen-go and protoc-gen-go-grpc).
Implement the service gaos.tasktracker.v1.TaskTracker:
| Method | Your server must |
|---|---|
ListPeople | Return active people only, in a stable order (by id), one page at a time; honour any page_size up to 100; set total to the number of active people across all pages. Set github_verified only for a login you have checked belongs to the person, and whatsapp_active only when the person agreed to receive messages. |
GetTask | Answer NOT_FOUND for a missing task and for a task outside the credential’s products; never OK without a task. Map your states to ACTIVE (anything not archived or deleted), ARCHIVED or DELETED; set product_code and the QA’s person id. Since v0.89.0 also set url (the task’s page), title (one line) and assignee_ids (every assignee’s person id), or leave them empty. |
AddComment | Add the text (at most 1500 characters) to the task’s discussion. You may rate-limit it. |
RecordMerge | Since v0.89.0 (optional: without it GAOS only pauses its merge write-back). Set the task’s release status to merged and no further, for a task of product_code assigned to person_id; answer RECORDED, ALREADY, NEEDS_DEV_DONE with a nonce, or REFUSED with a reason. The rules are below and on Recording the merge. |
Answer UNAUTHENTICATED or PERMISSION_DENIED for a refused credential, and
RESOURCE_EXHAUSTED when GAOS should stop calling (a lock-out after failed logins, or a rate limit): GAOS
then pauses this connection for up to an hour. INVALID_ARGUMENT is for a malformed request; any other
code is read as “unavailable”. Keep each answer to one uncompressed message under 1 MiB. The contract is
v1: it may gain fields, methods and enum types, and a published enum never gains a value (D-132).
Implementing RecordMerge
GAOS calls RecordMerge once per task, after the last open pull request naming it has merged or closed.
First map your own states onto the contract’s four work states — in development (started, not yet
declared finished), development-done (declared finished, including any later review step), not
started and on hold — and name the first step of your release status, merged.
- Scope and person. A task outside the credential’s products, or of another product than
product_code, answersNOT_FOUND. Aperson_idthat is not an active assignee of the task answersREFUSED, on every call. - A plain call (
mark_dev_done=false): development-done and below merged → write merged,RECORDED; at merged or later →ALREADYwithrelease_label; in development → write nothing, answerNEEDS_DEV_DONEwith aconfirm_nonce; anything else →REFUSED. The same plain request twice writes at most once. If your tracker has no separate development-done step, treat “finished” as development-done and never answerNEEDS_DEV_DONE. - The nonce. Issue it for that task and that person, for one use within 24 hours, and keep it on your side. GAOS stores it only until its one-time link is finished, and never shows it.
- The void. A plain call that carries a
confirm_nonceis a Reject: void the nonce and write nothing else. - The accept (
mark_dev_done=truewith the nonce): use the nonce up atomically — of two concurrent calls, at most one writes — move the task from in development to development-done on the person’s behalf under every rule you apply to that person, then record merged, and answerRECORDED. A voided, expired or unknown nonce answersREFUSED. - The replay clause. A nonce already redeemed successfully, presented again for the same task and
person, answers
RECORDED(orALREADY) and writes nothing. GAOS retries an accept whose call timed out, and relies on this to show the person the truth. - History. Record every write as made “through the GAOS integration” with the
pr_url; for an accept, add that it was accepted through a one-time link sent to the person, whose holder was not authenticated. Never record it as the person’s own session. - Not granted. Answer
UNIMPLEMENTEDorPERMISSION_DENIED. GAOS pauses its merge write-back for an hour and showsnomerge; it never counts this against the breaker that guards the other three methods.
2. Issue a narrow credential
Create a client account for GAOS that authenticates with HTTP Basic (client-id:secret) and may call
only the methods above, on only the tracker products GAOS should see (here,
ACME). Give it an expiry. Never give it an administrator role: the credential lives in a file on the
GAOS host.
RecordMerge has two halves, and they are separate grants. The plain half lets GAOS set
the release status to merged and nothing else. The development-done half (mark_dev_done) lets GAOS mark an
in-development task development-done on an assignee’s behalf after that person accepted on GAOS’s one-time
link. Grant it only if you accept that whoever holds this credential could do the same for any in-development task of
the granted products (a nonce stops a caller without the credential, not its holder). Withheld, GAOS answers the
author “the task tracker does not accept confirmations from GAOS” and leaves the task as it is.
3. Serve TLS
GAOS pins the tracker’s certificate as its only root and checks the IP, so a self-signed certificate for the private address is enough. Make one on the tracker host and keep the key there:
openssl req -x509 -newkey rsa:3072 -sha256 -days 1095 -nodes \
-keyout acme-grpc.key -out acme-grpc.crt -subj "/CN=acme-tasks" \
-addext "subjectAltName=IP:10.20.0.5,IP:127.0.0.1"
# serve gRPC over TLS 1.3 with acme-grpc.crt and acme-grpc.key;
# copy only acme-grpc.crt (never the key) to the GAOS host
GAOS speaks plaintext only towards a loopback address (tests, or a local tunnel). Any other address needs the certificate.
4. Install a connection profile
On the GAOS host, a connection is one folder under the profiles folder
(deploy/stacks/prod.pr-trackers/, mounted read-only as GAOS_TRACKERS_DIR). Give it a neutral
name: it is shown on the Integrations view, logged and stored in events. Make one profile per tracker credential.
cd deploy/stacks install -d -m 700 prod.pr-trackers/acme echo "10.20.0.5:9443" > prod.pr-trackers/acme/endpoint install -m 600 /path/to/acme-grpc.crt prod.pr-trackers/acme/ca.pem printf 'p-1 ACME\n' > prod.pr-trackers/acme/products echo "https://tasks.acme.example/" > prod.pr-trackers/acme/web # optional: task links # the credential: type it into an editor, never on a command line you keep install -m 600 /dev/null prod.pr-trackers/acme/credentials "${EDITOR:-vi}" prod.pr-trackers/acme/credentials # one line: client-id:secret chmod 600 prod.pr-trackers/acme/*
| File | Content |
|---|---|
endpoint | ip:port, an IP literal. |
ca.pem | The tracker’s certificate. Required unless the IP is loopback. |
credentials | client-id:secret. Leave it empty to install the profile switched off. |
products | One line per GAOS product allowed to use the profile: <product-id> <tracker-code>, or <product-id> * for any code. # starts a comment. |
web | Optional: the tracker’s web base, https://host[:port]/[path/], ending in /. A task’s url is shown in a merge notice or on the confirmation page only when it lies under this base. Leave it out for no task links. |
The folder must be mode 700 and every file mode 600; links are refused. deploy/check-stacks.sh checks
this, and a prod deploy creates an empty prod.pr-trackers when it is missing. Then redeploy or restart
the dashboard: profiles are read at start-up. Do not point two profiles at the same tracker with the same
credential — that would let two GAOS products bind the same tracker product.
5. Bind the product
Sign in to the back office, open Integrations, find the Task tracker block. In the product’s
row choose the connection acme, type the tracker product code ACME, tick enabled and
save. The save answers 422 when the profile is not installed or its products line does not allow the
product with that code, and 409 when another product already holds the same connection and code.
6. Verify it
- The block’s chip reads Connected, the connection is
on, and the people counts match the tracker. - Open a test pull request in a followed repository with a task code that does not exist. After the 10-minute grace it gets one comment, the task code … is not an open task of this product in the task tracker, and one WhatsApp line.
- Optionally, call the tracker directly with
grpcurl. The header carries the credential: run it from a shell with history off, and know that it is visible in the process list while the call runs.
set +o history
grpcurl -cacert acme-grpc.crt -import-path . -proto task-tracker-v1.proto \
-H "authorization: Basic $(base64 -w0 < credentials)" \
-d '{"task_code":"ACME-FEATURE-00001"}' \
10.20.0.5:9443 gaos.tasktracker.v1.TaskTracker/GetTask
set -o history
7. Troubleshoot
An admin sees the reason after unusable: on the connection’s row; it names the file and the rule,
never the file’s content.
| You see | What to do |
|---|---|
endpoint is missing, endpoint must be ip:port, endpoint must be an IP literal, not a host name | Write one line ip:port into endpoint. |
a tracker is reached over TLS only: add ca.pem, ca.pem holds no PEM certificate | Copy the tracker’s certificate (PEM, not the key) into ca.pem. |
<file> must be mode 600, the profile folder must be mode 700 | chmod 600 the files, chmod 700 the folder. |
<file> is a symbolic link, <file> is not a regular file | Copy the file in; links are refused. |
products is missing, products line N is not <product-id> <code|*> | Fix the products file: one product id and one code (or *) per line. |
credentials holds no client-id:secret line | Write one line client-id:secret. |
off (credentials is empty) | Fill credentials, then restart. |
Chip Unusable, breaker auth | The tracker refused the credential, or locked GAOS out. Fix the account; rewriting credentials is enough to retry. |
| Chip Unusable, connection fine | The binding names a connection that is not installed, or whose products line no longer allows the product and code. |
| Chip Degraded: unavailable or stale | The tracker does not answer. Check the address, the port and the TLS listener. |
| Chip Degraded: unchecked 10 of 10 | The tracker answers GetTask without a state GAOS knows, or OK without a task. Fix the mapping (step 1). |
| Chip Degraded: not in the template list | Add the product to GAOS_PR_TEMPLATE_PRODUCTS and redeploy. |
| A notice still goes to the group | The author has a GAOS contact (it wins), the login is not verified in the tracker, or the number is not active. |
Connection row: merge write-back: nomerge | The tracker does not implement RecordMerge, or the credential is not granted it. Merges wait, are retried hourly and are given up after 24 hours, to the bell only. |
Connection row: merge write-back: confirmations not granted | The tracker refused mark_dev_done. Plain merges still record; for an hour no confirmation link is sent. Grant the development-done half (step 2) if you want it. |
the web file is not an https base ending in / | Fix web: https, a host, and a trailing /. Until then notices carry no task link. |
| A valid code is called unknown | The case differs (codes are matched exactly), the task belongs to another tracker product, or the credential cannot see that product. |