Skip to content

Commit b507cb0

Browse files
djmitcheimbstack
authored andcommitted
Keep an RFC table of contents in the README (#151)
Plus: - rename 131 to not include spaces - check TOC on each PR
1 parent 9324037 commit b507cb0

5 files changed

+171
-0
lines changed

.taskcluster.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 1
2+
policy:
3+
pullRequests: public
4+
tasks:
5+
- $if: '(tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])'
6+
then:
7+
taskId: {$eval: as_slugid("toc-test")}
8+
created: {$fromNow: ''}
9+
deadline: {$fromNow: '2 hours'}
10+
provisionerId: aws-provisioner-v1
11+
workerType: github-worker
12+
payload:
13+
maxRunTime: 600
14+
image: python:3-alpine
15+
command:
16+
- /bin/bash
17+
- '-c'
18+
- >-
19+
git clone ${event.pull_request.head.repo.git_url} taskcluster-worker-runner &&
20+
cd taskcluster-worker-runner &&
21+
git config advice.detachedHead false &&
22+
git checkout ${event.pull_request.head.sha} &&
23+
python maketoc.py &&
24+
if ! output=$(git status --porcelain) || [ -n "$output" ]; then
25+
echo "*** 'python maketoc.py' produced changes to the repository; these changes should be checked in ***";
26+
git --no-pager diff;
27+
exit 1;
28+
fi
29+
metadata:
30+
name: taskcluster-rfcs-toc-test
31+
description: checks that RFCS table of contents is updated
32+
33+
source: ${event.repository.url}

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,47 @@ See [our roadmap](roadmap.md) for a more general idea of where we are headed.
1313
**Why**: This repo serves as a place to coordinate design and architecture, so that everyone can participate and past discussions are accessible to everyone.
1414

1515
**How**: Each idea gets an [issue](https://github.com/taskcluster/taskcluster-rfcs/issues) and discussion takes place there to turn the idea into a proposal and eventually implement it -- or to agree not to act on the idea. See [mechanics](mechanics.md) for more detail.
16+
17+
## RFCs
18+
19+
<!-- GENERATED -->
20+
| RFC | Title |
21+
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22+
| RFC#7 | [New Artifact API](rfcs/0007-New-Artifact-API.md) |
23+
| RFC#8 | [JSON-e](rfcs/0008-JSON-e.md) |
24+
| RFC#9 | [Switch to Auth0 for authentication, stop providing authentication to other services](rfcs/0009-Switch-to-Auth0-for-authentication-stop-providing-authentication-to-other-services.md) |
25+
| RFC#11 | [Support QEMU in taskcluster-worker](rfcs/0011-Support-QEMU-in-taskcluster-worker.md) |
26+
| RFC#20 | [Manage pulse credentials centrally](rfcs/0020-Manage-pulse-credentials-centrally.md) |
27+
| RFC#21 | [taskcluster-livelog-proxy in production](rfcs/0021-taskcluster-livelog-proxy-in-production.md) |
28+
| RFC#24 | [Decouple components from routing mechanisms](rfcs/0024-Decouple-components-from-routing-mechanisms.md) |
29+
| RFC#27 | [Migrate unified-logviewer to a standalone React component](rfcs/0027-Migrate-unified-logviewer-to-a-standalone-React-component.md) |
30+
| RFC#34 | [Audit logging](rfcs/0034-Audit-logging.md) |
31+
| RFC#35 | [Structured Logging](rfcs/0035-structured-logging.md) |
32+
| RFC#43 | [Get rid of tc-vcs completely](rfcs/0043-Get-rid-of-tc-vcs-completely.md) |
33+
| RFC#44 | [Get rid of gaia-taskcluster](rfcs/0044-Get-rid-of-gaia-taskcluster.md) |
34+
| RFC#48 | [Parameterized Roles](rfcs/0048-Parameterized-Roles.md) |
35+
| RFC#53 | [Use a git repository for retrospectives](rfcs/0053-Use-a-git-repository-for-retrospectives.md) |
36+
| RFC#57 | [Refresh the manual as a readable .. well, manual for taskcluster](rfcs/0057-Refresh-the-manual-as-a-readable-well-manual-for-taskcluster.md) |
37+
| RFC#58 | [Add more `task.priority` levels](rfcs/0058-Add-more-task-priority-levels.md) |
38+
| RFC#65 | [Migrate queue to postgres](rfcs/0065-Migrate-queue-to-postgres.md) |
39+
| RFC#66 | [Allow hooks to be triggered by pulse messages](rfcs/0066-Allow-hooks-to-be-triggered-by-pulse-messages.md) |
40+
| RFC#74 | [Worker, workerType, and provisioner explorer UI](rfcs/0074-Worker-workerType-and-provisioner-explorer-UI.md) |
41+
| RFC#75 | [Miscellaneous Workers](rfcs/0075-Miscellaneous-Workers.md) |
42+
| RFC#76 | [Turn off the scheduler service](rfcs/0076-Turn-off-the-scheduler-service.md) |
43+
| RFC#80 | [store RFCs in files in the repository, discuss RFC through a PR](rfcs/0080-store-RFCs-in-files-in-the-repository-discuss-RFC-through-a-PR.md) |
44+
| RFC#82 | [Users should be able to administer workers across provisioner boundaries](rfcs/0082-Users-should-be-able-to-administer-workers-across-provisioner-boundaries.md) |
45+
| RFC#86 | [Stage 2: provisioner, workerType, and worker metadata endpoints](rfcs/0086-Stage-2-provisioner-workerType-and-worker-metadata-endpoints.md) |
46+
| RFC#87 | [Actively manage AWS resources](rfcs/0087-Actively-manage-AWS-resources.md) |
47+
| RFC#90 | [Disabling/enabling a worker](rfcs/0090-Disabling-enabling-a-worker.md) |
48+
| RFC#91 | [Store infra configuration in a distinct repo that does not ride trains](rfcs/0091-Store-infra-configuration-in-a-distinct-repo-that-does-not-ride-trains.md) |
49+
| RFC#97 | [Provisioner, worker-type & worker actions](rfcs/0097-Provisioner-worker-type-worker-actions.md) |
50+
| RFC#110 | [Best Practices for testing and Credentials](rfcs/0110-Best-practices-for-testing-and-credentials.md) |
51+
| RFC#120 | [object Service](rfcs/0120-artifact-service.md) |
52+
| RFC#124 | [Worker Manager](rfcs/0124-worker-manager.md) |
53+
| RFC#128 | [Service metadata in redeployable taskcluster](rfcs/0128-redeployable-clients.md) |
54+
| RFC#131 | [Implementing Checks API](rfcs/0131-Implementing-Checks-API-in-tc-github-while-preserving-Statuses-API.md) |
55+
| RFC#135 | [Clients and Environment Variables](rfcs/0135-client-env-vars.md) |
56+
| RFC#136 | [Scope Expression Registration](rfcs/0136-scope-expression-registration.md) |
57+
| RFC#139 | [Increase identifier length from 20 to 38](rfcs/0139-longer-identifiers.md) |
58+
| RFC#145 | [Worker Pools and Task Queues](rfcs/0145-workerpoolid-taskqueueid.md) |
59+
| RFC#147 | [Third-Party Login](rfcs/0147-third-party-login.md) |

maketoc.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import os
2+
import re
3+
4+
LINE_RE = re.compile(r'^# RFC 0*([0-9]+) *-? *(.*)$')
5+
6+
def main():
7+
rfcs = {}
8+
with os.scandir('rfcs') as it:
9+
for dentry in it:
10+
if dentry.name.endswith('.md') and dentry.is_file() and dentry.name != 'README.md':
11+
with open(dentry.path, "r") as f:
12+
line = f.readlines()[0]
13+
mo = LINE_RE.match(line)
14+
try:
15+
rfcs[int(mo.group(1))] = (dentry.name, mo.group(2))
16+
except:
17+
print(line)
18+
raise
19+
20+
update(rfcs, "README.md", "rfcs/")
21+
update(rfcs, "rfcs/README.md", "")
22+
23+
def update(rfcs, filename, prefix):
24+
table = [['RFC', 'Title']] + [
25+
['RFC#%d' % num, '[%s](%s%s)' % (title, prefix, file)]
26+
for num, (file, title) in sorted(rfcs.items())
27+
]
28+
lens = [0, 0]
29+
for row in table:
30+
for i, v in enumerate(row):
31+
l = len(v)
32+
if l > lens[i]:
33+
lens[i] = l
34+
35+
tpl = "| %-{}s | %-{}s |".format(*lens)
36+
37+
rv = [tpl % tuple(row) for row in table]
38+
rv.insert(1, tpl % tuple(('-' * l for l in lens)))
39+
table = "\n".join(rv)
40+
41+
with open(filename, "r") as f:
42+
content = f.read()
43+
content = re.sub(
44+
'<!-- GENERATED -->.*',
45+
'<!-- GENERATED -->\n' + table + '\n',
46+
content,
47+
flags=re.S)
48+
with open(filename, "w") as f:
49+
f.write(content)
50+
51+
main()

rfcs/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## RFCs
2+
3+
<!-- GENERATED -->
4+
| RFC | Title |
5+
| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
6+
| RFC#7 | [New Artifact API](0007-New-Artifact-API.md) |
7+
| RFC#8 | [JSON-e](0008-JSON-e.md) |
8+
| RFC#9 | [Switch to Auth0 for authentication, stop providing authentication to other services](0009-Switch-to-Auth0-for-authentication-stop-providing-authentication-to-other-services.md) |
9+
| RFC#11 | [Support QEMU in taskcluster-worker](0011-Support-QEMU-in-taskcluster-worker.md) |
10+
| RFC#20 | [Manage pulse credentials centrally](0020-Manage-pulse-credentials-centrally.md) |
11+
| RFC#21 | [taskcluster-livelog-proxy in production](0021-taskcluster-livelog-proxy-in-production.md) |
12+
| RFC#24 | [Decouple components from routing mechanisms](0024-Decouple-components-from-routing-mechanisms.md) |
13+
| RFC#27 | [Migrate unified-logviewer to a standalone React component](0027-Migrate-unified-logviewer-to-a-standalone-React-component.md) |
14+
| RFC#34 | [Audit logging](0034-Audit-logging.md) |
15+
| RFC#35 | [Structured Logging](0035-structured-logging.md) |
16+
| RFC#43 | [Get rid of tc-vcs completely](0043-Get-rid-of-tc-vcs-completely.md) |
17+
| RFC#44 | [Get rid of gaia-taskcluster](0044-Get-rid-of-gaia-taskcluster.md) |
18+
| RFC#48 | [Parameterized Roles](0048-Parameterized-Roles.md) |
19+
| RFC#53 | [Use a git repository for retrospectives](0053-Use-a-git-repository-for-retrospectives.md) |
20+
| RFC#57 | [Refresh the manual as a readable .. well, manual for taskcluster](0057-Refresh-the-manual-as-a-readable-well-manual-for-taskcluster.md) |
21+
| RFC#58 | [Add more `task.priority` levels](0058-Add-more-task-priority-levels.md) |
22+
| RFC#65 | [Migrate queue to postgres](0065-Migrate-queue-to-postgres.md) |
23+
| RFC#66 | [Allow hooks to be triggered by pulse messages](0066-Allow-hooks-to-be-triggered-by-pulse-messages.md) |
24+
| RFC#74 | [Worker, workerType, and provisioner explorer UI](0074-Worker-workerType-and-provisioner-explorer-UI.md) |
25+
| RFC#75 | [Miscellaneous Workers](0075-Miscellaneous-Workers.md) |
26+
| RFC#76 | [Turn off the scheduler service](0076-Turn-off-the-scheduler-service.md) |
27+
| RFC#80 | [store RFCs in files in the repository, discuss RFC through a PR](0080-store-RFCs-in-files-in-the-repository-discuss-RFC-through-a-PR.md) |
28+
| RFC#82 | [Users should be able to administer workers across provisioner boundaries](0082-Users-should-be-able-to-administer-workers-across-provisioner-boundaries.md) |
29+
| RFC#86 | [Stage 2: provisioner, workerType, and worker metadata endpoints](0086-Stage-2-provisioner-workerType-and-worker-metadata-endpoints.md) |
30+
| RFC#87 | [Actively manage AWS resources](0087-Actively-manage-AWS-resources.md) |
31+
| RFC#90 | [Disabling/enabling a worker](0090-Disabling-enabling-a-worker.md) |
32+
| RFC#91 | [Store infra configuration in a distinct repo that does not ride trains](0091-Store-infra-configuration-in-a-distinct-repo-that-does-not-ride-trains.md) |
33+
| RFC#97 | [Provisioner, worker-type & worker actions](0097-Provisioner-worker-type-worker-actions.md) |
34+
| RFC#110 | [Best Practices for testing and Credentials](0110-Best-practices-for-testing-and-credentials.md) |
35+
| RFC#120 | [object Service](0120-artifact-service.md) |
36+
| RFC#124 | [Worker Manager](0124-worker-manager.md) |
37+
| RFC#128 | [Service metadata in redeployable taskcluster](0128-redeployable-clients.md) |
38+
| RFC#131 | [Implementing Checks API](0131-Implementing-Checks-API-in-tc-github-while-preserving-Statuses-API.md) |
39+
| RFC#135 | [Clients and Environment Variables](0135-client-env-vars.md) |
40+
| RFC#136 | [Scope Expression Registration](0136-scope-expression-registration.md) |
41+
| RFC#139 | [Increase identifier length from 20 to 38](0139-longer-identifiers.md) |
42+
| RFC#145 | [Worker Pools and Task Queues](0145-workerpoolid-taskqueueid.md) |
43+
| RFC#147 | [Third-Party Login](0147-third-party-login.md) |

0 commit comments

Comments
 (0)