blob: b7c743e9df537beae4a903472942f612eccf7664 [file] [log] [blame]
# LUCI configuration definition language
{{/* Renders documentation for all functions in the given struct. */}}
{{define "gen-funcs-doc"}}
{{range $sym := .Symbols "func"}}
### {{.FullName}} {#{{$sym.Anchor}}}
```python
{{$sym.InvocationSnippet}}
```
{{if $sym.HasDocTag "advanced"}}
*** note
**Advanced function.** It is not used for common use cases.
***
{{end}}
{{$sym.Doc.Description | LinkifySymbols}}
#### Arguments {#{{$sym.Anchor "args"}}}
{{range $sym.Doc.Args}}
* **{{.Name | EscapeMD}}**: {{.Desc | LinkifySymbols}}
{{- end}}
{{if $sym.Doc.Returns}}
#### Returns {#{{$sym.Anchor "returns"}}}
{{$sym.Doc.Returns | LinkifySymbols}}
{{end}}
{{end}}
{{end}}
{{/* Renders TODO note. */}}
{{define "todo"}}
*** note
TODO: To be written.
***
{{end}}
{{/*
Load all symbols we are going to document in advance to let LinkifySymbols
know that they can be referred to through anchors.
*/}}
{{ $core := Symbol "@stdlib//builtins.star" "core" }}
{{ $acl := Symbol "@stdlib//builtins.star" "acl" }}
{{ $swarming := Symbol "@stdlib//builtins.star" "swarming" }}
[TOC]
## Overview
### Working with lucicfg
{{template "todo"}}
### Concepts
{{template "todo"}}
### Resolving naming ambiguities
{{template "todo"}}
### Defining durations {#durations_doc}
{{template "todo"}}
### Defining cron schedules {#schedules_doc}
{{template "todo"}}
## Core rules
{{template "gen-funcs-doc" $core}}
## ACLs
### Roles {#roles_doc}
Below is the table with role constants that can be passed as `roles` in
{{LinkifySymbols "acl.entry(...)"}}.
Due to some inconsistencies in how LUCI service are currently implemented, some
roles can be assigned only in {{LinkifySymbols "core.project(...)"}} rule, but
some also in individual {{LinkifySymbols "core.bucket(...)"}} rules.
Similarly some roles can be assigned to individual users, other only to groups.
| Role | Scope | Principals | Allows |
|-------|-------|------------|--------|
{{- range $sym := $acl.Symbols "var"}}
| {{.FullName}} |
{{- if .HasDocTag "project_level_only"}}project only{{else}}project, bucket{{end}} |
{{- if .HasDocTag "groups_only"}}groups{{else}}groups, users{{end}} |
{{- .Doc.Description | LinkifySymbols}} |
{{- end}}
{{template "gen-funcs-doc" $acl}}
## Swarming
{{template "gen-funcs-doc" $swarming}}
## Other builtin functions
These functions are available in the global namespace.
{{template "todo"}}