gunk-dev/the-valley

webui.nix

source00ee76e8c9e1main's published tip history
6.1 KiB
1# The web UI (webui/): the export contract the publisher and the server
2# share, and the server. Their tests run here, in the packages' unit
3# builds (nix/packages.nix).
4{
5 packages,
6 ...
7}:
8{
9 # The projection over the shared fixture, which holds every disclosure
10 # rule: what reaches export.json, hidden projects' edges, a knot that
11 # waits on a hidden knot marked with waiting_on_hidden alone, the field
12 # gone once its one hidden blocker is done, the display mapping. The
13 # content digest; strict reading of export.json, with
14 # nothing after its document; each of VerifyManifest's steps, in order;
15 # the manifest's grammar and its agreement with export.json; the
16 # streaming body check; bundle acceptance against real git, refusing
17 # wrong tips, prerequisites, extra refs, corrupt objects and a header
18 # past its bound, writing a commit-graph git verifies, and serving no
19 # commit main does not reach, nor one named in the other object
20 # format's length, alone or among several; git's
21 # output read within its limit, with git stopped past it or when its
22 # reader stops early; and the receiver's state directory. For the state
23 # directory: uploads private to the receiver and generations readable
24 # by every user, whatever its umask; readers holding
25 # a generation through activations, every file of a generation synced
26 # before high-water names it, a repository a crash interrupted built
27 # again, recovery checking a generation before it activates it and
28 # keeping one whose check git did not finish, and injected sweep and
29 # swap failures, reported apart from the commit. go vet runs after them.
30 webui-unit = packages.webui.unit;
31
32 # Read access, which the publisher reads its consents through: both
33 # consents read out of real commits under the real schemas, an explicit
34 # empty reader set and an empty scope letting no one read, anyone's
35 # restrictions, no principal name special, a policy for another project
36 # and a grant for another identity covering nothing, other destinations'
37 # grants and expired principals' left out, policy/web never read, tree
38 # entries with a directory part or named twice refused before anything
39 # is copied out, a directory named twice on the way to a document
40 # refused, redeclared definitions widening nothing, a field spelled in
41 # another case than the schema's refused, and the coverage report over a
42 # real valley, with the registry read at its ref. go vet runs after them.
43 readaccess-unit = packages.readaccess.unit;
44
45 # The server and valley-web over the shared fixture, uploaded to a real
46 # store, and real git. The plan page's reading order, its free to start
47 # legend, its one card of ready changes, and the export's age, marked
48 # stale after five minutes; a knot's body and comments, with the edited
49 # one marked; a hidden project answering every route exactly as a
50 # missing one, though its repository is in the generation; a blocked
51 # knot's chip naming its published blockers and, once, unpublished
52 # work; projects
53 # named source, knots and web-export served on every route, and their
54 # roots redirected to their trees, while the server's own paths under
55 # /-/ are never a project's; a commit
56 # main's tip does not reach, and every other object ID or name, refused
57 # with the one 404; hostile README, file, file name, commit subject and
58 # knot text rendered inert, and large and binary files not shown; a
59 # reference into the hidden project naming nothing of it; a directory
60 # past MaxRead listed in part, and a 5 MiB commit message ending its
61 # page of history early; the directories along a path sharing one
62 # MaxRead; the older links of history showing every commit once through
63 # a merge whose lines run across pages, and every link of a page past
64 # MaxFrontier lines, or one ended before a merge past MaxLeftToShow,
65 # reaching every commit; a merge whose parents pass a record of git log
66 # shown, first on a page and further down, with its first MaxParents
67 # followed; a source request's git slot held for a bound of its own from
68 # admission, through a slow export read and its git, answering 503 and
69 # giving back its slot, and given back before it renders; a SHA-256
70 # project served by full commit IDs alone; a file of MaxFile newlines shown to MaxLines;
71 # a chain of knots near the graph's limit shown to MaxPlanDepth, with
72 # the plan's structure built once; the policy on every response,
73 # admitting the page's inline stylesheet and script by their hashes; a
74 # request keeping its generation while another activates; an export
75 # read once per generation, however many requests wait for it, across
76 # activations; a load started only by a request taking a loader slot,
77 # with requests that wait for one ending at their deadline or when
78 # their reader goes away, leaving no load behind and holding no
79 # generation; a load reading export.json from a slow pipe stopped part
80 # way once its one request's deadline passes, caching nothing and
81 # giving back its generation; a flood during a load keeping
82 # MaxLoadWaiting requests waiting and answering the rest 503, with the
83 # server's goroutines and open files bounded; source requests past
84 # MaxGit and MaxWaiting answering 503, with an activation while they
85 # wait and a deadline that covers the wait; a request held past its
86 # deadline before it renders answering 503; a page past MaxResponse on
87 # a knot, and past a smaller bound on a file, a directory, a page of
88 # history and the plan, answering the one short page that says it is
89 # too large; readers that never read holding no git slot and no
90 # generation, and, asking for more than MaxBuffered in large pages of
91 # three sizes, holding no more of the heap than it and no more than
92 # MaxLarge, their pages' starts counted, with a large page it has no
93 # room for answering 503 while the plan, a knot and a directory still
94 # render; and valley-web run as a process of its own, serving and
95 # stopping on SIGTERM, and serving every page from a state directory
96 # the receiver wrote under umask 0077 and that reads as another
97 # user's, with nothing in it writable. go vet runs after them.
98 webui-server-unit = packages.valley-web.unit;
99}