Merge ~rkratky/ubuntu-governance-docs:docs-checks-update into ubuntu-governance-docs:main
- Git
- lp:~rkratky/ubuntu-governance-docs
- docs-checks-update
- Merge into main
Proposed by
Robert Krátký
Status: | Merged |
---|---|
Merged at revision: | 9e386a9878dee90465db68a8d33ba52c712f7cbe |
Proposed branch: | ~rkratky/ubuntu-governance-docs:docs-checks-update |
Merge into: | ubuntu-governance-docs:main |
Diff against target: |
1470 lines (+662/-306) 19 files modified
dev/null (+0/-114) docs/.custom_wordlist.txt (+50/-0) docs/.gitignore (+15/-4) docs/.sphinx/.markdownlint.json (+27/-0) docs/.sphinx/.pre-commit-config.yaml (+23/-0) docs/.sphinx/.wordlist.txt (+6/-3) docs/.sphinx/_static/project_specific.css (+0/-0) docs/.sphinx/_templates/footer.html (+111/-0) docs/.sphinx/_templates/header.html (+4/-4) docs/.sphinx/get_vale_conf.py (+34/-7) docs/.sphinx/metrics/build_metrics.sh (+15/-0) docs/.sphinx/metrics/source_metrics.sh (+66/-0) docs/.sphinx/pa11y.json (+1/-1) docs/.sphinx/requirements.txt (+3/-1) docs/.sphinx/spellingcheck.yaml (+29/-29) docs/Makefile (+165/-8) docs/conf.py (+37/-59) docs/index.md (+7/-7) docs/policy/3rd-party-software-sources.md (+69/-69) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robie Basak | Approve | ||
Review via email:
|
Commit message
Update Sphinx config & fix content to pass docs checks
Description of the change
Update Sphinx config
* Update syntax to pass linter
* Add matrix.to to linkcheck ignore list
* Fix Launchpad URLs
Fix content to pass docs checks
* Switch spellcheck to US English
* Fix spelling mistakes
* Add exceptions to ignore list
* Fix/update links to pass linkcheck
* Fix headings to sentence case
To post a comment you must log in.
Revision history for this message

Robert Krátký (rkratky) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/docs/.custom_wordlist.txt b/docs/.custom_wordlist.txt |
2 | index e69de29..e23a5aa 100644 |
3 | --- a/docs/.custom_wordlist.txt |
4 | +++ b/docs/.custom_wordlist.txt |
5 | @@ -0,0 +1,50 @@ |
6 | +# Leave a blank line at the end of this file to support concatenation |
7 | +ACL |
8 | +Bacher |
9 | +Basak |
10 | +Fi |
11 | +FlatHub |
12 | +Flatpak |
13 | +GPG |
14 | +LibreOffice |
15 | +NVIDIA |
16 | +PPAs |
17 | +Robie |
18 | +SRU |
19 | +Samuele |
20 | +TBC |
21 | +TOC |
22 | +Vugt |
23 | +WCAG |
24 | +WSL |
25 | +Wi |
26 | +amd |
27 | +arm |
28 | +armhf |
29 | +auditability |
30 | +cjk |
31 | +cryptographically |
32 | +devel |
33 | +dfsg |
34 | +discoverable |
35 | +dvipng |
36 | +fonts |
37 | +freefont |
38 | +github |
39 | +gyre |
40 | +https |
41 | +kustom |
42 | +lang |
43 | +latexmk |
44 | +otf |
45 | +plantuml |
46 | +repos |
47 | +supportability |
48 | +tex |
49 | +texlive |
50 | +txt |
51 | +ubuntu |
52 | +utils |
53 | +wordlist |
54 | +xetex |
55 | +xindy |
56 | diff --git a/docs/.gitignore b/docs/.gitignore |
57 | index da6f688..bf16e0d 100644 |
58 | --- a/docs/.gitignore |
59 | +++ b/docs/.gitignore |
60 | @@ -1,14 +1,25 @@ |
61 | -/*env*/ |
62 | +# Environment |
63 | +*env*/ |
64 | .sphinx/venv/ |
65 | + |
66 | +# Sphinx |
67 | .sphinx/warnings.txt |
68 | .sphinx/.wordlist.dic |
69 | .sphinx/.doctrees/ |
70 | .sphinx/node_modules/ |
71 | -package*.json |
72 | + |
73 | +# Vale |
74 | +.sphinx/styles/* |
75 | +.sphinx/vale.ini |
76 | + |
77 | +# Build outputs |
78 | _build |
79 | + |
80 | +# Node.js |
81 | +package*.json |
82 | + |
83 | +# Unrelated cache and config files |
84 | .DS_Store |
85 | __pycache__ |
86 | .idea/ |
87 | .vscode/ |
88 | -.sphinx/styles/* |
89 | -.sphinx/vale.ini |
90 | \ No newline at end of file |
91 | diff --git a/docs/.sphinx/.markdownlint.json b/docs/.sphinx/.markdownlint.json |
92 | new file mode 100644 |
93 | index 0000000..f42753f |
94 | --- /dev/null |
95 | +++ b/docs/.sphinx/.markdownlint.json |
96 | @@ -0,0 +1,27 @@ |
97 | +{ |
98 | + "default": false, |
99 | + "MD003": { |
100 | + "style": "atx" |
101 | + }, |
102 | + "MD013": { |
103 | + "code_blocks": false, |
104 | + "tables": false, |
105 | + "stern": true, |
106 | + "line_length": 150 |
107 | + }, |
108 | + "MD014": true, |
109 | + "MD018": true, |
110 | + "MD022": true, |
111 | + "MD023": true, |
112 | + "MD026": { |
113 | + "punctuation": ".,;。,;" |
114 | + }, |
115 | + "MD031": { |
116 | + "list_items": false |
117 | + }, |
118 | + "MD032": true, |
119 | + "MD035": true, |
120 | + "MD042": true, |
121 | + "MD045": true, |
122 | + "MD052": true |
123 | +} |
124 | \ No newline at end of file |
125 | diff --git a/docs/.sphinx/.pre-commit-config.yaml b/docs/.sphinx/.pre-commit-config.yaml |
126 | new file mode 100644 |
127 | index 0000000..07e0b48 |
128 | --- /dev/null |
129 | +++ b/docs/.sphinx/.pre-commit-config.yaml |
130 | @@ -0,0 +1,23 @@ |
131 | +repos: |
132 | + - repo: local |
133 | + hooks: |
134 | + - id: make-spelling |
135 | + name: Run make spelling |
136 | + entry: make -C docs spelling |
137 | + language: system |
138 | + pass_filenames: false |
139 | + files: ^docs/.*\.(rst|md|txt)$ |
140 | + |
141 | + - id: make-linkcheck |
142 | + name: Run make linkcheck |
143 | + entry: make -C docs linkcheck |
144 | + language: system |
145 | + pass_filenames: false |
146 | + files: ^docs/.*\.(rst|md|txt)$ |
147 | + |
148 | + - id: make-woke |
149 | + name: Run make woke |
150 | + entry: make -C docs woke |
151 | + language: system |
152 | + pass_filenames: false |
153 | + files: ^docs/.*\.(rst|md|txt)$ |
154 | diff --git a/docs/.sphinx/.wordlist.txt b/docs/.sphinx/.wordlist.txt |
155 | index fb4137d..be5021a 100644 |
156 | --- a/docs/.sphinx/.wordlist.txt |
157 | +++ b/docs/.sphinx/.wordlist.txt |
158 | @@ -1,13 +1,15 @@ |
159 | -# This wordlist is from the Sphinx starter pack and should not be |
160 | -# modified. Add any custom terms to .custom_wordlist.txt instead. |
161 | - |
162 | +ACME |
163 | +ACME's |
164 | addons |
165 | +AGPLv |
166 | API |
167 | APIs |
168 | balancer |
169 | Charmhub |
170 | CLI |
171 | +DCO |
172 | Diátaxis |
173 | +Dqlite |
174 | dropdown |
175 | EBS |
176 | EKS |
177 | @@ -53,6 +55,7 @@ RTD |
178 | subdirectories |
179 | subfolders |
180 | subtree |
181 | +TODO |
182 | Ubuntu |
183 | UI |
184 | UUID |
185 | diff --git a/docs/.sphinx/_static/favicon.png b/docs/.sphinx/_static/favicon.png |
186 | deleted file mode 100644 |
187 | index 7f175e4..0000000 |
188 | Binary files a/docs/.sphinx/_static/favicon.png and /dev/null differ |
189 | diff --git a/docs/.sphinx/_static/project_specific.css b/docs/.sphinx/_static/project_specific.css |
190 | new file mode 100644 |
191 | index 0000000..e69de29 |
192 | --- /dev/null |
193 | +++ b/docs/.sphinx/_static/project_specific.css |
194 | diff --git a/docs/.sphinx/_static/tag.png b/docs/.sphinx/_static/tag.png |
195 | deleted file mode 100644 |
196 | index f6f6e5a..0000000 |
197 | Binary files a/docs/.sphinx/_static/tag.png and /dev/null differ |
198 | diff --git a/docs/.sphinx/_templates/footer.html b/docs/.sphinx/_templates/footer.html |
199 | new file mode 100644 |
200 | index 0000000..2d118a8 |
201 | --- /dev/null |
202 | +++ b/docs/.sphinx/_templates/footer.html |
203 | @@ -0,0 +1,111 @@ |
204 | +{# ru-fu: copied from Furo, with modifications as stated below. Modifications are marked 'mod:'. #} |
205 | + |
206 | +<div class="related-pages"> |
207 | + {# mod: Per-page navigation #} |
208 | + {% if meta %} |
209 | + {% if 'sequential_nav' in meta %} |
210 | + {% set sequential_nav = meta.sequential_nav %} |
211 | + {% endif %} |
212 | + {% endif %} |
213 | + {# mod: Conditional wrappers to control page navigation buttons #} |
214 | + {% if sequential_nav != "none" -%} |
215 | + {% if next and (sequential_nav == "next" or sequential_nav == "both") -%} |
216 | + <a class="next-page" href="{{ next.link }}"> |
217 | + <div class="page-info"> |
218 | + <div class="context"> |
219 | + <span>{{ _("Next") }}</span> |
220 | + </div> |
221 | + <div class="title">{{ next.title }}</div> |
222 | + </div> |
223 | + <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> |
224 | + </a> |
225 | + {%- endif %} |
226 | + {% if prev and (sequential_nav == "prev" or sequential_nav == "both") -%} |
227 | + <a class="prev-page" href="{{ prev.link }}"> |
228 | + <svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg> |
229 | + <div class="page-info"> |
230 | + <div class="context"> |
231 | + <span>{{ _("Previous") }}</span> |
232 | + </div> |
233 | + {% if prev.link == pathto(root_doc) %} |
234 | + <div class="title">{{ _("Home") }}</div> |
235 | + {% else %} |
236 | + <div class="title">{{ prev.title }}</div> |
237 | + {% endif %} |
238 | + </div> |
239 | + </a> |
240 | + {%- endif %} |
241 | + {%- endif %} |
242 | +</div> |
243 | +<div class="bottom-of-page"> |
244 | + <div class="left-details"> |
245 | + {%- if show_copyright %} |
246 | + <div class="copyright"> |
247 | + {%- if hasdoc('copyright') %} |
248 | + {% trans path=pathto('copyright'), copyright=copyright|e -%} |
249 | + <a href="{{ path }}">Copyright</a> © {{ copyright }} |
250 | + {%- endtrans %} |
251 | + {%- else %} |
252 | + {% trans copyright=copyright|e -%} |
253 | + Copyright © {{ copyright }} |
254 | + {%- endtrans %} |
255 | + {%- endif %} |
256 | + </div> |
257 | + {%- endif %} |
258 | + |
259 | + {# mod: removed "Made with" #} |
260 | + |
261 | + {%- if last_updated -%} |
262 | + <div class="last-updated"> |
263 | + {% trans last_updated=last_updated|e -%} |
264 | + Last updated on {{ last_updated }} |
265 | + {%- endtrans -%} |
266 | + </div> |
267 | + {%- endif %} |
268 | + |
269 | + {%- if show_source and has_source and sourcename %} |
270 | + <div class="show-source"> |
271 | + <a class="muted-link" href="{{ pathto('_sources/' + sourcename, true)|e }}" |
272 | + rel="nofollow">Show source</a> |
273 | + </div> |
274 | + {%- endif %} |
275 | + </div> |
276 | + <div class="right-details"> |
277 | + |
278 | + {# mod: replaced RTD icons with our links #} |
279 | + |
280 | + {% if discourse %} |
281 | + <div class="ask-discourse"> |
282 | + <a class="muted-link" href="{{ discourse }}">Ask a question on Discourse</a> |
283 | + </div> |
284 | + {% endif %} |
285 | + |
286 | + {% if irc %} |
287 | + <div class="ask-mattermost"> |
288 | + <a class="muted-link" href="{{ irc }}">Ask a question on IRC</a> |
289 | + </div> |
290 | + {% endif %} |
291 | + |
292 | + {% if matrix %} |
293 | + <div class="ask-matrix"> |
294 | + <a class="muted-link" href="{{ matrix }}">Ask a question on Matrix</a> |
295 | + </div> |
296 | + {% endif %} |
297 | + |
298 | + {% if launchpad_url and launchpad_version and launchpad_folder %} |
299 | + |
300 | + {% if launchpad_issues %} |
301 | + <div class="issue-github"> |
302 | + <a class="muted-link" href="{{ launchpad_issues }}">Open a Launchpad issue for this documentation</a> |
303 | + </div> |
304 | + {% endif %} |
305 | + |
306 | + <div class="edit-github"> |
307 | + <a class="muted-link" href="{{ launchpad_url }}/tree{{ launchpad_folder }}{{ pagename }}{{ page_source_suffix }}">View this page on Launchpad</a> |
308 | + </div> |
309 | + {% endif %} |
310 | + |
311 | + |
312 | + </div> |
313 | + </div> |
314 | +</div> |
315 | diff --git a/docs/.sphinx/_templates/header.html b/docs/.sphinx/_templates/header.html |
316 | index 30c52c5..d0ac8e5 100644 |
317 | --- a/docs/.sphinx/_templates/header.html |
318 | +++ b/docs/.sphinx/_templates/header.html |
319 | @@ -26,9 +26,9 @@ |
320 | </li> |
321 | {% endif %} |
322 | |
323 | - {% if mattermost %} |
324 | + {% if irc %} |
325 | <li> |
326 | - <a href="{{ mattermost }}" class="p-navigation__sub-link p-dropdown__link">Mattermost</a> |
327 | + <a href="{{ irc }}" class="p-navigation__sub-link p-dropdown__link">IRC</a> |
328 | </li> |
329 | {% endif %} |
330 | |
331 | @@ -38,9 +38,9 @@ |
332 | </li> |
333 | {% endif %} |
334 | |
335 | - {% if github_url %} |
336 | + {% if launchpad_url %} |
337 | <li> |
338 | - <a href="{{ github_url }}" class="p-navigation__sub-link p-dropdown__link">GitHub</a> |
339 | + <a href="{{ launchpad_url }}" class="p-navigation__sub-link p-dropdown__link">Launchpad</a> |
340 | </li> |
341 | {% endif %} |
342 | |
343 | diff --git a/docs/.sphinx/get_vale_conf.py b/docs/.sphinx/get_vale_conf.py |
344 | index 23d8901..cb73a64 100644 |
345 | --- a/docs/.sphinx/get_vale_conf.py |
346 | +++ b/docs/.sphinx/get_vale_conf.py |
347 | @@ -3,16 +3,18 @@ |
348 | import requests |
349 | import os |
350 | |
351 | -DIR=os.getcwd() |
352 | +DIR = os.getcwd() |
353 | |
354 | def main(): |
355 | - |
356 | if os.path.exists(f"{DIR}/.sphinx/styles/Canonical"): |
357 | print("Vale directory exists") |
358 | else: |
359 | os.makedirs(f"{DIR}/.sphinx/styles/Canonical") |
360 | |
361 | - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/Canonical" |
362 | + url = ( |
363 | + "https://api.github.com/repos/canonical/praecepta/" |
364 | + + "contents/styles/Canonical" |
365 | + ) |
366 | r = requests.get(url) |
367 | for item in r.json(): |
368 | download = requests.get(item["download_url"]) |
369 | @@ -20,22 +22,47 @@ def main(): |
370 | file.write(download.text) |
371 | file.close() |
372 | |
373 | + # Update dictionary |
374 | + if os.path.exists(f"{DIR}/.sphinx/styles/config/dictionaries"): |
375 | + print("Dictionary directory exists") |
376 | + else: |
377 | + os.makedirs(f"{DIR}/.sphinx/styles/config/dictionaries") |
378 | + url = ( |
379 | + "https://api.github.com/repos/canonical/praecepta/" |
380 | + + "contents/styles/config/dictionaries" |
381 | + ) |
382 | + r = requests.get(url) |
383 | + for item in r.json(): |
384 | + download = requests.get(item["download_url"]) |
385 | + file = open(".sphinx/styles/config/dictionaries/" + item["name"], "w") |
386 | + file.write(download.text) |
387 | + file.close() |
388 | + |
389 | if os.path.exists(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical"): |
390 | print("Vocab directory exists") |
391 | else: |
392 | os.makedirs(f"{DIR}/.sphinx/styles/config/vocabularies/Canonical") |
393 | - |
394 | - url = "https://api.github.com/repos/canonical/praecepta/contents/styles/config/vocabularies/Canonical" |
395 | + |
396 | + url = ( |
397 | + "https://api.github.com/repos/canonical/praecepta/" |
398 | + + "contents/styles/config/vocabularies/Canonical" |
399 | + ) |
400 | r = requests.get(url) |
401 | for item in r.json(): |
402 | download = requests.get(item["download_url"]) |
403 | - file = open(".sphinx/styles/config/vocabularies/Canonical/" + item["name"], "w") |
404 | + file = open( |
405 | + ".sphinx/styles/config/vocabularies/Canonical/" + item["name"], |
406 | + "w" |
407 | + ) |
408 | file.write(download.text) |
409 | file.close() |
410 | - config = requests.get("https://raw.githubusercontent.com/canonical/praecepta/main/vale.ini") |
411 | + config = requests.get( |
412 | + "https://raw.githubusercontent.com/canonical/praecepta/main/vale.ini" |
413 | + ) |
414 | file = open(".sphinx/vale.ini", "w") |
415 | file.write(config.text) |
416 | file.close() |
417 | |
418 | + |
419 | if __name__ == "__main__": |
420 | main() |
421 | diff --git a/docs/.sphinx/metrics/build_metrics.sh b/docs/.sphinx/metrics/build_metrics.sh |
422 | new file mode 100755 |
423 | index 0000000..bd1ff1c |
424 | --- /dev/null |
425 | +++ b/docs/.sphinx/metrics/build_metrics.sh |
426 | @@ -0,0 +1,15 @@ |
427 | +#!/bin/bash |
428 | +# shellcheck disable=all |
429 | + |
430 | +links=0 |
431 | +images=0 |
432 | + |
433 | +# count number of links |
434 | +links=$(find . -type d -path './.sphinx' -prune -o -name '*.html' -exec cat {} + | grep -o "<a " | wc -l) |
435 | +# count number of images |
436 | +images=$(find . -type d -path './.sphinx' -prune -o -name '*.html' -exec cat {} + | grep -o "<img " | wc -l) |
437 | + |
438 | +# summarise latest metrics |
439 | +echo "Summarising metrics for build files (.html)..." |
440 | +echo -e "\tlinks: $links" |
441 | +echo -e "\timages: $images" |
442 | diff --git a/docs/.sphinx/metrics/source_metrics.sh b/docs/.sphinx/metrics/source_metrics.sh |
443 | new file mode 100755 |
444 | index 0000000..07147d6 |
445 | --- /dev/null |
446 | +++ b/docs/.sphinx/metrics/source_metrics.sh |
447 | @@ -0,0 +1,66 @@ |
448 | +#!/bin/bash |
449 | +# shellcheck disable=all |
450 | + |
451 | +VENV=".sphinx/venv/bin/activate" |
452 | + |
453 | +files=0 |
454 | +words=0 |
455 | +readabilityWords=0 |
456 | +readabilitySentences=0 |
457 | +readabilitySyllables=0 |
458 | +readabilityAverage=0 |
459 | +readable=true |
460 | + |
461 | +# measure number of files (.rst and .md), excluding those in .sphinx dir |
462 | +files=$(find . -type d -path './.sphinx' -prune -o -type f \( -name '*.md' -o -name '*.rst' \) -print | wc -l) |
463 | + |
464 | +# calculate metrics only if source files are present |
465 | +if [ "$files" -eq 0 ]; then |
466 | + echo "There are no source files to calculate metrics" |
467 | +else |
468 | + # measure raw total number of words, excluding those in .sphinx dir |
469 | + words=$(find . -type d -path './.sphinx' -prune -o \( -name '*.md' -o -name '*.rst' \) -exec cat {} + | wc -w) |
470 | + |
471 | + # calculate readability for markdown source files |
472 | + echo "Activating virtual environment to run vale..." |
473 | + source "${VENV}" |
474 | + |
475 | + for file in *.md *.rst; do |
476 | + if [ -f "$file" ]; then |
477 | + readabilityWords=$(vale ls-metrics "$file" | grep '"words"' | sed 's/[^0-9]*//g') |
478 | + readabilitySentences=$(vale ls-metrics "$file" | grep '"sentences"' | sed 's/[^0-9]*//g') |
479 | + readabilitySyllables=$(vale ls-metrics "$file" | grep '"syllables"' | sed 's/[^0-9]*//g') |
480 | + fi |
481 | + done |
482 | + |
483 | + echo "Deactivating virtual environment..." |
484 | + deactivate |
485 | + |
486 | + # calculate mean number of words |
487 | + if [ "$files" -ge 1 ]; then |
488 | + meanval=$((readabilityWords / files)) |
489 | + else |
490 | + meanval=$readabilityWords |
491 | + fi |
492 | + |
493 | + readabilityAverage=$(echo "scale=2; 0.39 * ($readabilityWords / $readabilitySentences) + (11.8 * ($readabilitySyllables / $readabilityWords)) - 15.59" | bc) |
494 | + |
495 | + # cast average to int for comparison |
496 | + readabilityAverageInt=$(echo "$readabilityAverage / 1" | bc) |
497 | + |
498 | + # value below 8 is considered readable |
499 | + if [ "$readabilityAverageInt" -lt 8 ]; then |
500 | + readable=true |
501 | + else |
502 | + readable=false |
503 | + fi |
504 | + |
505 | + # summarise latest metrics |
506 | + echo "Summarising metrics for source files (.md, .rst)..." |
507 | + echo -e "\ttotal files: $files" |
508 | + echo -e "\ttotal words (raw): $words" |
509 | + echo -e "\ttotal words (prose): $readabilityWords" |
510 | + echo -e "\taverage word count: $meanval" |
511 | + echo -e "\treadability: $readabilityAverage" |
512 | + echo -e "\treadable: $readable" |
513 | +fi |
514 | diff --git a/docs/.sphinx/pa11y.json b/docs/.sphinx/pa11y.json |
515 | index 8df0cb9..04dc1e1 100644 |
516 | --- a/docs/.sphinx/pa11y.json |
517 | +++ b/docs/.sphinx/pa11y.json |
518 | @@ -6,4 +6,4 @@ |
519 | }, |
520 | "reporter": "cli", |
521 | "standard": "WCAG2AA" |
522 | -} |
523 | \ No newline at end of file |
524 | +} |
525 | diff --git a/docs/.sphinx/requirements.txt b/docs/.sphinx/requirements.txt |
526 | index c019f17..9ff666c 100644 |
527 | --- a/docs/.sphinx/requirements.txt |
528 | +++ b/docs/.sphinx/requirements.txt |
529 | @@ -1,2 +1,4 @@ |
530 | -git+https://github.com/canonical/canonical-sphinx@main#egg=canonical-sphinx |
531 | +canonical-sphinx[full] |
532 | sphinx-autobuild |
533 | +sphinxcontrib-svg2pdfconverter[CairoSVG] |
534 | +sphinx-last-updated-by-git |
535 | diff --git a/docs/.sphinx/spellingcheck.yaml b/docs/.sphinx/spellingcheck.yaml |
536 | index 5f3dbad..417a541 100644 |
537 | --- a/docs/.sphinx/spellingcheck.yaml |
538 | +++ b/docs/.sphinx/spellingcheck.yaml |
539 | @@ -1,30 +1,30 @@ |
540 | matrix: |
541 | -- name: rST files |
542 | - aspell: |
543 | - lang: en |
544 | - d: en_GB |
545 | - dictionary: |
546 | - wordlists: |
547 | - - .sphinx/.wordlist.txt |
548 | - - .custom_wordlist.txt |
549 | - output: .sphinx/.wordlist.dic |
550 | - sources: |
551 | - - _build/**/*.html |
552 | - pipeline: |
553 | - - pyspelling.filters.html: |
554 | - comments: false |
555 | - attributes: |
556 | - - title |
557 | - - alt |
558 | - ignores: |
559 | - - code |
560 | - - pre |
561 | - - spellexception |
562 | - - link |
563 | - - title |
564 | - - div.relatedlinks |
565 | - - strong.command |
566 | - - div.visually-hidden |
567 | - - img |
568 | - - a.p-navigation__link |
569 | - - a.contributor |
570 | + - name: rST files |
571 | + aspell: |
572 | + lang: en |
573 | + d: en_US |
574 | + dictionary: |
575 | + wordlists: |
576 | + - .sphinx/.wordlist.txt |
577 | + - .custom_wordlist.txt |
578 | + output: .sphinx/.wordlist.dic |
579 | + sources: |
580 | + - _build/**/*.html |
581 | + pipeline: |
582 | + - pyspelling.filters.html: |
583 | + comments: false |
584 | + attributes: |
585 | + - title |
586 | + - alt |
587 | + ignores: |
588 | + - code |
589 | + - pre |
590 | + - spellexception |
591 | + - link |
592 | + - title |
593 | + - div.relatedlinks |
594 | + - strong.command |
595 | + - div.visually-hidden |
596 | + - img |
597 | + - a.p-navigation__link |
598 | + - a.contributor |
599 | diff --git a/docs/Makefile b/docs/Makefile |
600 | index a861ba8..b9bdea0 100644 |
601 | --- a/docs/Makefile |
602 | +++ b/docs/Makefile |
603 | @@ -1,11 +1,23 @@ |
604 | -# This Makefile stub allows you to customize starter pack (SP) targets. |
605 | -# Consider this file as a bridge between your project |
606 | -# and the starter pack's predefined targets that reside in Makefile.sp. |
607 | +# Minimal makefile for Sphinx documentation |
608 | # |
609 | -# You can add your own, non-SP targets here or override SP targets |
610 | -# to fit your project's needs. For example, you can define and use targets |
611 | -# named "install" or "run", but continue to use SP targets like "sp-install" |
612 | -# or "sp-run" when working on the documentation. |
613 | +# Add your customisation to `Makefile` instead. |
614 | + |
615 | +# You can set these variables from the command line, and also |
616 | +# from the environment for the first two. |
617 | +SPHINXDIR = .sphinx |
618 | +SPHINXOPTS ?= -c . -d $(SPHINXDIR)/.doctrees -j auto |
619 | +SPHINXBUILD ?= $(VENVDIR)/bin/sphinx-build |
620 | +SOURCEDIR = . |
621 | +BUILDDIR = _build |
622 | +VENVDIR = $(SPHINXDIR)/venv |
623 | +PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json |
624 | +VENV = $(VENVDIR)/bin/activate |
625 | +TARGET = * |
626 | +ALLFILES = *.rst **/*.rst |
627 | +METRICSDIR = $(SOURCEDIR)/.sphinx/metrics |
628 | +REQPDFPACKS = latexmk fonts-freefont-otf texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-font-utils texlive-lang-cjk texlive-xetex plantuml xindy tex-gyre dvipng |
629 | +CONFIRM_SUDO ?= N |
630 | +VALE_CONFIG = $(SPHINXDIR)/vale.ini |
631 | |
632 | # Put it first so that "make" without argument is like "make help". |
633 | help: |
634 | @@ -23,8 +35,153 @@ help: |
635 | "* check accessibility: make pa11y \n" \ |
636 | "* check style guide compliance: make vale \n" \ |
637 | "* check style guide compliance on target: make vale TARGET=* \n" \ |
638 | + "* check metrics for documentation: make allmetrics \n" \ |
639 | "* other possible targets: make <TAB twice> \n" \ |
640 | "------------------------------------------------------------- \n" |
641 | |
642 | +.PHONY: full-help woke-install spellcheck-install pa11y-install install run html \ |
643 | + epub serve clean clean-doc spelling spellcheck linkcheck woke \ |
644 | + allmetrics pa11y pdf-prep-force pdf-prep pdf vale-install vale |
645 | + |
646 | +full-help: $(VENVDIR) |
647 | + @. $(VENV); $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
648 | + @echo "\n\033[1;31mNOTE: This help texts shows unsupported targets!\033[0m" |
649 | + @echo "Run 'make help' to see supported targets." |
650 | + |
651 | +# If requirements are updated, venv should be rebuilt and timestamped. |
652 | +$(VENVDIR): |
653 | + python3 -c "import venv" || \ |
654 | + (echo "You must install python3-venv before you can build the documentation."; exit 1) |
655 | + @echo "... setting up virtualenv" |
656 | + python3 -m venv $(VENVDIR) |
657 | + . $(VENV); pip install $(PIPOPTS) --require-virtualenv \ |
658 | + --upgrade -r $(SPHINXDIR)/requirements.txt \ |
659 | + --log $(VENVDIR)/pip_install.log |
660 | + @test ! -f $(VENVDIR)/pip_list.txt || \ |
661 | + mv $(VENVDIR)/pip_list.txt $(VENVDIR)/pip_list.txt.bak |
662 | + @. $(VENV); pip list --local --format=freeze > $(VENVDIR)/pip_list.txt |
663 | + @touch $(VENVDIR) |
664 | + |
665 | +spellcheck-install: |
666 | + @type aspell >/dev/null 2>&1 || \ |
667 | + { \ |
668 | + echo "Installing system-wide \"aspell\" packages..."; \ |
669 | + confirm_sudo=$(CONFIRM_SUDO); \ |
670 | + if [ "$$confirm_sudo" != "y" ] && [ "$$confirm_sudo" != "Y" ]; then \ |
671 | + read -p "This requires sudo privileges. Proceed? [y/N]: " confirm_sudo; \ |
672 | + fi; \ |
673 | + if [ "$$confirm_sudo" = "y" ] || [ "$$confirm_sudo" = "Y" ]; then \ |
674 | + sudo apt-get install aspell aspell-en; \ |
675 | + else \ |
676 | + echo "Installation cancelled."; \ |
677 | + fi \ |
678 | + } |
679 | + |
680 | +pa11y-install: |
681 | + @type $(PA11Y) >/dev/null 2>&1 || { \ |
682 | + echo "Installing \"pa11y\" from npm... \n"; \ |
683 | + mkdir -p $(SPHINXDIR)/node_modules/ ; \ |
684 | + npm install --prefix $(SPHINXDIR) pa11y; \ |
685 | + } |
686 | + |
687 | +install: $(VENVDIR) |
688 | + |
689 | +run: install |
690 | + . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) |
691 | + |
692 | +# Doesn't depend on $(BUILDDIR) to rebuild properly at every run. |
693 | +html: install |
694 | + . $(VENV); $(SPHINXBUILD) -W --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) |
695 | + |
696 | +epub: install |
697 | + . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) |
698 | + |
699 | +serve: html |
700 | + cd "$(BUILDDIR)"; python3 -m http.server --bind 127.0.0.1 8000 |
701 | + |
702 | +clean: clean-doc |
703 | + @test ! -e "$(VENVDIR)" -o -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" |
704 | + rm -rf $(VENVDIR) |
705 | + rm -rf $(SPHINXDIR)/node_modules/ |
706 | + rm -rf $(SPHINXDIR)/styles |
707 | + rm -rf $(VALE_CONFIG) |
708 | + |
709 | +clean-doc: |
710 | + git clean -fx "$(BUILDDIR)" |
711 | + rm -rf $(SPHINXDIR)/.doctrees |
712 | + |
713 | +spellcheck: spellcheck-install |
714 | + . $(VENV) ; python3 -m pyspelling -c $(SPHINXDIR)/spellingcheck.yaml -j $(shell nproc) |
715 | + |
716 | +spelling: html spellcheck |
717 | + |
718 | +linkcheck: install |
719 | + . $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) || { grep --color -F "[broken]" "$(BUILDDIR)/output.txt"; exit 1; } |
720 | + exit 0 |
721 | + |
722 | +pa11y: pa11y-install html |
723 | + find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y) |
724 | + |
725 | +vale-install: install |
726 | + @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install rst2html vale |
727 | + @. $(VENV); test -f $(VALE_CONFIG) || python3 $(SPHINXDIR)/get_vale_conf.py |
728 | + @printf '.Name=="Canonical.400-Enforce-inclusive-terms"' > $(SPHINXDIR)/styles/woke.filter |
729 | + @printf '.Level=="error" and .Name!="Canonical.500-Repeated-words" and .Name!="Canonical.000-US-spellcheck"' > $(SPHINXDIR)/styles/error.filter |
730 | + @printf '.Name=="Canonical.000-US-spellcheck"' > $(SPHINXDIR)/styles/spelling.filter |
731 | + @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(VALE_CONFIG)" $(TARGET) > /dev/null \; |
732 | + |
733 | +woke: vale-install |
734 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
735 | + @cat $(SPHINXDIR)/.wordlist.txt $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt |
736 | + @printf "Running Vale acceptable term check against $(TARGET). To change target set TARGET= with make command\n" |
737 | + @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/woke.filter' --glob='*.{md,rst}' $(TARGET) || true |
738 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt && rm $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
739 | + |
740 | +vale: vale-install |
741 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
742 | + @cat $(SPHINXDIR)/.wordlist.txt $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt |
743 | + @printf "Running Vale against $(TARGET). To change target set TARGET= with make command\n" |
744 | + @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/error.filter' --glob='*.{md,rst}' $(TARGET) || true |
745 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt && rm $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
746 | + |
747 | +vale-spelling: vale-install |
748 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
749 | + @cat $(SPHINXDIR)/.wordlist.txt $(SOURCEDIR)/.custom_wordlist.txt >> $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt |
750 | + @printf "Running Vale against $(TARGET). To change target set TARGET= with make command\n" |
751 | + @. $(VENV); vale --config="$(VALE_CONFIG)" --filter='$(SPHINXDIR)/styles/spelling.filter' --glob='*.{md,rst}' $(TARGET) || true |
752 | + @cat $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt > $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept.txt && rm $(SPHINXDIR)/styles/config/vocabularies/Canonical/accept_backup.txt |
753 | + |
754 | +pdf-prep: install |
755 | + @for packageName in $(REQPDFPACKS); do (dpkg-query -W -f='$${Status}' $$packageName 2>/dev/null | \ |
756 | + grep -c "ok installed" >/dev/null && echo "Package $$packageName is installed") && continue || \ |
757 | + (echo "\nPDF generation requires the installation of the following packages: $(REQPDFPACKS)" && \ |
758 | + echo "" && echo "Run 'sudo make pdf-prep-force' to install these packages" && echo "" && echo \ |
759 | + "Please be aware these packages will be installed to your system") && exit 1 ; done |
760 | + |
761 | +pdf-prep-force: |
762 | + apt-get update |
763 | + apt-get upgrade -y |
764 | + apt-get install --no-install-recommends -y $(REQPDFPACKS) \ |
765 | + |
766 | +pdf: pdf-prep |
767 | + @. $(VENV); sphinx-build -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) |
768 | + @rm ./$(BUILDDIR)/latex/front-page-light.pdf || true |
769 | + @rm ./$(BUILDDIR)/latex/normal-page-footer.pdf || true |
770 | + @find ./$(BUILDDIR)/latex -name "*.pdf" -exec mv -t ./$(BUILDDIR) {} + |
771 | + @rm -r $(BUILDDIR)/latex |
772 | + @echo "\nOutput can be found in ./$(BUILDDIR)\n" |
773 | + |
774 | +allmetrics: html |
775 | + @echo "Recording documentation metrics..." |
776 | + @echo "Checking for existence of vale..." |
777 | + . $(VENV) |
778 | + @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale |
779 | + @. $(VENV); test -f $(VALE_CONFIG) || python3 $(SPHINXDIR)/get_vale_conf.py |
780 | + @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(VALE_CONFIG)" $(TARGET) > /dev/null \; |
781 | + @eval '$(METRICSDIR)/source_metrics.sh $(PWD)' |
782 | + @eval '$(METRICSDIR)/build_metrics.sh $(PWD) $(METRICSDIR)' |
783 | + |
784 | +# Catch-all target: route all unknown targets to Sphinx using the new |
785 | +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
786 | %: |
787 | - $(MAKE) -f Makefile.sp sp-$@ |
788 | + . $(VENV); $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
789 | diff --git a/docs/Makefile.sp b/docs/Makefile.sp |
790 | deleted file mode 100644 |
791 | index 80b5141..0000000 |
792 | --- a/docs/Makefile.sp |
793 | +++ /dev/null |
794 | @@ -1,114 +0,0 @@ |
795 | -# Minimal makefile for Sphinx documentation |
796 | -# |
797 | -# `Makefile.sp` is from the Sphinx starter pack and should not be |
798 | -# modified. |
799 | -# Add your customisation to `Makefile` instead. |
800 | - |
801 | -# You can set these variables from the command line, and also |
802 | -# from the environment for the first two. |
803 | -SPHINXDIR = .sphinx |
804 | -SPHINXOPTS ?= -c . -d $(SPHINXDIR)/.doctrees -j auto |
805 | -SPHINXBUILD ?= $(VENVDIR)/bin/sphinx-build |
806 | -SOURCEDIR = . |
807 | -BUILDDIR = _build |
808 | -VENVDIR = $(SPHINXDIR)/venv |
809 | -PA11Y = $(SPHINXDIR)/node_modules/pa11y/bin/pa11y.js --config $(SPHINXDIR)/pa11y.json |
810 | -VENV = $(VENVDIR)/bin/activate |
811 | -TARGET = * |
812 | -ALLFILES = *.rst **/*.rst |
813 | - |
814 | -.PHONY: sp-full-help sp-woke-install sp-spellcheck-install sp-pa11y-install sp-install sp-run sp-html \ |
815 | - sp-epub sp-serve sp-clean sp-clean-doc sp-spelling sp-spellcheck sp-linkcheck sp-woke \ |
816 | - sp-pa11y Makefile.sp sp-vale |
817 | - |
818 | -sp-full-help: $(VENVDIR) |
819 | - @. $(VENV); $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
820 | - @echo "\n\033[1;31mNOTE: This help texts shows unsupported targets!\033[0m" |
821 | - @echo "Run 'make help' to see supported targets." |
822 | - |
823 | -# If requirements are updated, venv should be rebuilt and timestamped. |
824 | -$(VENVDIR): |
825 | - python3 -c "import venv" || \ |
826 | - (echo "You must install python3-venv before you can build the documentation."; exit 1) |
827 | - @echo "... setting up virtualenv" |
828 | - python3 -m venv $(VENVDIR) |
829 | - . $(VENV); pip install --require-virtualenv \ |
830 | - --upgrade -r $(SPHINXDIR)/requirements.txt \ |
831 | - --log $(VENVDIR)/pip_install.log |
832 | - @test ! -f $(VENVDIR)/pip_list.txt || \ |
833 | - mv $(VENVDIR)/pip_list.txt $(VENVDIR)/pip_list.txt.bak |
834 | - @. $(VENV); pip list --local --format=freeze > $(VENVDIR)/pip_list.txt |
835 | - @touch $(VENVDIR) |
836 | - |
837 | -sp-woke-install: |
838 | - @type woke >/dev/null 2>&1 || \ |
839 | - { echo "Installing \"woke\" snap... \n"; sudo snap install woke; } |
840 | - |
841 | -sp-spellcheck-install: |
842 | - @type aspell >/dev/null 2>&1 || \ |
843 | - { echo "Installing aspell... \n"; sudo apt-get install aspell aspell-en; } |
844 | - |
845 | -sp-pa11y-install: |
846 | - @type $(PA11Y) >/dev/null 2>&1 || { \ |
847 | - echo "Installing \"pa11y\" from npm... \n"; \ |
848 | - mkdir -p $(SPHINXDIR)/node_modules/ ; \ |
849 | - npm install --prefix $(SPHINXDIR) pa11y; \ |
850 | - } |
851 | - |
852 | -sp-install: $(VENVDIR) |
853 | - |
854 | -sp-run: sp-install |
855 | - . $(VENV); $(VENVDIR)/bin/sphinx-autobuild -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) |
856 | - |
857 | -# Doesn't depend on $(BUILDDIR) to rebuild properly at every run. |
858 | -sp-html: sp-install |
859 | - . $(VENV); $(SPHINXBUILD) -W --keep-going -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) |
860 | - |
861 | -sp-epub: sp-install |
862 | - . $(VENV); $(SPHINXBUILD) -b epub "$(SOURCEDIR)" "$(BUILDDIR)" -w $(SPHINXDIR)/warnings.txt $(SPHINXOPTS) |
863 | - |
864 | -sp-serve: sp-html |
865 | - cd "$(BUILDDIR)"; python3 -m http.server --bind 127.0.0.1 8000 |
866 | - |
867 | -sp-clean: sp-clean-doc |
868 | - @test ! -e "$(VENVDIR)" -o -d "$(VENVDIR)" -a "$(abspath $(VENVDIR))" != "$(VENVDIR)" |
869 | - rm -rf $(VENVDIR) |
870 | - rm -rf $(SPHINXDIR)/node_modules/ |
871 | - rm -rf $(SPHINXDIR)/styles |
872 | - rm -rf $(SPHINXDIR)/vale.ini |
873 | - |
874 | -sp-clean-doc: |
875 | - git clean -fx "$(BUILDDIR)" |
876 | - rm -rf $(SPHINXDIR)/.doctrees |
877 | - |
878 | -sp-spellcheck: sp-spellcheck-install |
879 | - . $(VENV) ; python3 -m pyspelling -c $(SPHINXDIR)/spellingcheck.yaml -j $(shell nproc) |
880 | - |
881 | -sp-spelling: sp-html sp-spellcheck |
882 | - |
883 | -sp-linkcheck: sp-install |
884 | - . $(VENV) ; $(SPHINXBUILD) -b linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) || { grep --color -F "[broken]" "$(BUILDDIR)/output.txt"; exit 1; } |
885 | - exit 0 |
886 | - |
887 | -sp-woke: sp-woke-install |
888 | - woke $(ALLFILES) --exit-1-on-failure \ |
889 | - -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml |
890 | - |
891 | -sp-pa11y: sp-pa11y-install sp-html |
892 | - find $(BUILDDIR) -name *.html -print0 | xargs -n 1 -0 $(PA11Y) |
893 | - |
894 | -sp-vale: sp-install |
895 | - @. $(VENV); test -d $(SPHINXDIR)/venv/lib/python*/site-packages/vale || pip install vale |
896 | - @. $(VENV); test -f $(SPHINXDIR)/vale.ini || python3 $(SPHINXDIR)/get_vale_conf.py |
897 | - @. $(VENV); find $(SPHINXDIR)/venv/lib/python*/site-packages/vale/vale_bin -size 195c -exec vale --config "$(SPHINXDIR)/vale.ini" $(TARGET) > /dev/null \; |
898 | - @echo "" |
899 | - @echo "Running Vale against $(TARGET). To change target set TARGET= with make command" |
900 | - @echo "" |
901 | - @. $(VENV); vale --config "$(SPHINXDIR)/vale.ini" --glob='*.{md,txt,rst}' $(TARGET) |
902 | - |
903 | - |
904 | - |
905 | -# Catch-all target: route all unknown targets to Sphinx using the new |
906 | -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). |
907 | -%: Makefile.sp |
908 | - . $(VENV); $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
909 | diff --git a/docs/conf.py b/docs/conf.py |
910 | index a8b1cd9..7efa397 100644 |
911 | --- a/docs/conf.py |
912 | +++ b/docs/conf.py |
913 | @@ -17,13 +17,13 @@ import datetime |
914 | ############################################################ |
915 | |
916 | # Product name |
917 | -project = 'Ubuntu Governance' |
918 | -author = 'Ubuntu Technical Board' |
919 | +project = "Ubuntu Governance" |
920 | +author = "Ubuntu Technical Board" |
921 | |
922 | # The title you want to display for the documentation in the sidebar. |
923 | # You might want to include a version number here. |
924 | # To not display any title, set this option to an empty string. |
925 | -html_title = project + ' Documentation' |
926 | +html_title = project + " Documentation" |
927 | |
928 | # The default value uses CC-BY-SA as the license and the current year |
929 | # as the copyright year. |
930 | @@ -46,17 +46,17 @@ html_title = project + ' Documentation' |
931 | # -H 'Accept: application/vnd.github.v3.raw' \ |
932 | # https://api.github.com/repos/canonical/<REPO> | jq '.created_at' |
933 | |
934 | -copyright = '%s CC-BY-SA, %s' % (datetime.date.today().year, author) |
935 | +copyright = "%s CC-BY-SA, %s" % (datetime.date.today().year, author) |
936 | |
937 | ## Open Graph configuration - defines what is displayed as a link preview |
938 | ## when linking to the documentation from another website (see https://ogp.me/) |
939 | # The URL where the documentation will be hosted (leave empty if you |
940 | # don't know yet) |
941 | -ogp_site_url = 'https://canonical-ubuntu-governance-docs.readthedocs-hosted.com/' |
942 | +ogp_site_url = "https://canonical-ubuntu-governance-docs.readthedocs-hosted.com/" |
943 | # The documentation website name (usually the same as the product name) |
944 | ogp_site_name = project |
945 | # The URL of an image or logo that is used in the preview |
946 | -ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg' |
947 | +ogp_image = "https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg" |
948 | |
949 | # Update with the local path to the favicon for your product |
950 | # (default is the circle of friends) |
951 | @@ -65,55 +65,37 @@ ogp_image = 'https://assets.ubuntu.com/v1/253da317-image-document-ubuntudocs.svg |
952 | # (Some settings must be part of the html_context dictionary, while others |
953 | # are on root level. Don't move the settings.) |
954 | html_context = { |
955 | - |
956 | # Change to the link to the website of your product (without "https://") |
957 | # For example: "ubuntu.com/lxd" or "microcloud.is" |
958 | # If there is no product website, edit the header template to remove the |
959 | # link (see the readme for instructions). |
960 | - 'product_page': 'wiki.ubuntu.com/TechnicalBoard', |
961 | - |
962 | + "product_page": "wiki.ubuntu.com/TechnicalBoard", |
963 | # Add your product tag (the orange part of your logo, will be used in the |
964 | # header) to ".sphinx/_static" and change the path here (start with "_static") |
965 | # (default is the circle of friends) |
966 | # 'product_tag': '_static/tag.png', |
967 | - |
968 | # Change to the discourse instance you want to be able to link to |
969 | # using the :discourse: metadata at the top of a file |
970 | # (use an empty value if you don't want to link) |
971 | - 'discourse': 'https://discourse.ubuntu.com', |
972 | - |
973 | - # Change to the Mattermost channel you want to link to |
974 | - # (use an empty value if you don't want to link) |
975 | - 'mattermost': '', |
976 | - |
977 | - # Change to the Matrix channel you want to link to |
978 | - # (use an empty value if you don't want to link) |
979 | - 'matrix': '', |
980 | - |
981 | - # Change to the GitHub URL for your project |
982 | - # This is used, for example, to link to the source files and allow creating GitHub issues directly from the documentation. |
983 | - 'github_url': 'https://launchpad.net/~techboard/ubuntu-governance-docs', |
984 | - |
985 | + "discourse": "https://discourse.ubuntu.com", |
986 | + # Your IRC channel |
987 | + # "irc": "https://web.libera.chat/gamja/?channels=%23ubuntu-devel", |
988 | + # Your Matrix channel URL |
989 | + "matrix": "https://matrix.to/#/#devel:ubuntu.com", |
990 | + # Your Launchpad URL |
991 | + "launchpad_url": "https://git.launchpad.net/ubuntu-governance-docs", |
992 | # Change to the branch for this version of the documentation |
993 | - 'github_version': 'main', |
994 | - |
995 | + "launchpad_version": "main", |
996 | # Change to the folder that contains the documentation |
997 | # (usually "/" or "/docs/") |
998 | - 'github_folder': '/docs/', |
999 | - |
1000 | - # Change to an empty value if your GitHub repo doesn't have issues enabled. |
1001 | - # This will disable the feedback button and the issue link in the footer. |
1002 | - 'github_issues': '', |
1003 | - |
1004 | + "launchpad_folder": "/docs/", |
1005 | + # Change to an empty value to disable the issue link in the footer. |
1006 | + "launchpad_issues": "https://bugs.launchpad.net/techboard/+filebug", |
1007 | # Controls the existence of Previous / Next buttons at the bottom of pages |
1008 | # Valid options: none, prev, next, both |
1009 | - # 'sequential_nav': "none", |
1010 | - |
1011 | - # Uncomment to disable displaying the contributors for each file. |
1012 | - # (You can also limit the time frame for displaying contributors |
1013 | - # by setting a "display_contributors_since" variable.) |
1014 | - # "display_contributors": False, |
1015 | - |
1016 | + "sequential_nav": "both", |
1017 | + # Controls whether to display the contributors for each file |
1018 | + "display_contributors": False, |
1019 | } |
1020 | |
1021 | # If your project is on documentation.ubuntu.com, specify the project |
1022 | @@ -124,8 +106,8 @@ html_context = { |
1023 | # You can comment them out if you don't need this (but you can also just |
1024 | # leave them). |
1025 | |
1026 | -html_static_path = ['.sphinx/_static'] |
1027 | -templates_path = ['.sphinx/_templates'] |
1028 | +html_static_path = [".sphinx/_static"] |
1029 | +templates_path = [".sphinx/_templates"] |
1030 | |
1031 | ############################################################ |
1032 | ### Redirects |
1033 | @@ -144,15 +126,11 @@ redirects = {} |
1034 | ############################################################ |
1035 | |
1036 | # Links to ignore when checking links |
1037 | -linkcheck_ignore = [ |
1038 | - 'http://127.0.0.1:8000' |
1039 | - ] |
1040 | +linkcheck_ignore = ["http://127.0.0.1:8000", "https://matrix.to"] |
1041 | |
1042 | # Pages on which to ignore anchors |
1043 | # (This list will be appended to linkcheck_anchors_ignore_for_url) |
1044 | -linkcheck_anchors_ignore_for_url = [ |
1045 | - r'https://github\.com/.*' |
1046 | -] |
1047 | +linkcheck_anchors_ignore_for_url = [r"https://github\.com/.*"] |
1048 | |
1049 | ############################################################ |
1050 | ### Additions to default configuration |
1051 | @@ -165,9 +143,9 @@ linkcheck_anchors_ignore_for_url = [ |
1052 | # substitution, deflist, linkify |
1053 | # If you need more extensions, add them here. |
1054 | myst_enable_extensions = { |
1055 | - 'colon_fence', |
1056 | - 'substitution', |
1057 | - } |
1058 | + "colon_fence", |
1059 | + "substitution", |
1060 | +} |
1061 | |
1062 | # You must include the canonical_sphinx extension here. |
1063 | # This extension automatically enables the following Sphinx extensions: |
1064 | @@ -178,13 +156,13 @@ myst_enable_extensions = { |
1065 | # If you need more extensions, add them here (in addition to |
1066 | # canonical_sphinx). |
1067 | extensions = [ |
1068 | - 'canonical_sphinx' |
1069 | - ] |
1070 | + "canonical_sphinx", |
1071 | + "sphinxcontrib.cairosvgconverter", |
1072 | + "sphinx_last_updated_by_git", |
1073 | +] |
1074 | |
1075 | # Add files or directories that should be excluded from processing. |
1076 | -exclude_patterns = [ |
1077 | - 'doc-cheat-sheet*', |
1078 | - ] |
1079 | +exclude_patterns = [] |
1080 | |
1081 | # Add custom CSS files (located in .sphinx/_static/) |
1082 | # html_css_files = [] |
1083 | @@ -215,11 +193,11 @@ exclude_patterns = [ |
1084 | ## Add any configuration that is not covered by the common conf.py file. |
1085 | |
1086 | # Define a :center: role that can be used to center the content of table cells. |
1087 | -rst_prolog = ''' |
1088 | +rst_prolog = """ |
1089 | .. role:: center |
1090 | :class: align-center |
1091 | -''' |
1092 | +""" |
1093 | |
1094 | # Workaround for https://github.com/canonical/canonical-sphinx/issues/34 |
1095 | -if not 'discourse_prefix' in html_context and 'discourse' in html_context: |
1096 | - html_context['discourse_prefix'] = html_context['discourse'] + '/t/' |
1097 | +if not "discourse_prefix" in html_context and "discourse" in html_context: |
1098 | + html_context["discourse_prefix"] = html_context["discourse"] + "/t/" |
1099 | diff --git a/docs/index.md b/docs/index.md |
1100 | index f1df1f6..bba4f6e 100644 |
1101 | --- a/docs/index.md |
1102 | +++ b/docs/index.md |
1103 | @@ -1,4 +1,4 @@ |
1104 | -# Ubuntu Governance Docs |
1105 | +# Ubuntu governance docs |
1106 | |
1107 | ```{toctree} |
1108 | :maxdepth: 2 |
1109 | @@ -22,11 +22,11 @@ As a community we adhere to the Ubuntu code of conduct. |
1110 | * **[Get support](https://askubuntu.com/)**: |
1111 | Ask Ubuntu is a question and answer site for Ubuntu users and developers. |
1112 | |
1113 | -* **[Join our online chat](https://web.libera.chat/gamja/?channels=%23channel)**: |
1114 | -Meet us in `#channel` on IRC Libera.Chat. |
1115 | +* **Join our online chat**: |
1116 | +Meet us in the [Ubuntu Development](https://matrix.to/#/#devel:ubuntu.com) channel on Matrix. |
1117 | |
1118 | -* **[Report bugs](https://launchpad.net/~techboard/ubuntu-governance-docs/+filebug)**: |
1119 | -We want to know about the problems so we can fix them. |
1120 | +* **[Report bugs](https://launchpad.net/techboard/+filebug)**: |
1121 | +We want to know about the problems, so we can fix them. |
1122 | |
1123 | -* **[Contribute docs](https://launchpad.net/~techboard/ubuntu-governance-docs)**: |
1124 | -The documentation sources on GitHub. |
1125 | +* **[Contribute docs](https://launchpad.net/ubuntu-governance-docs)**: |
1126 | +The documentation sources on Launchpad. |
1127 | diff --git a/docs/policy/3rd-party-software-sources.md b/docs/policy/3rd-party-software-sources.md |
1128 | index 40675dd..4ff3a94 100644 |
1129 | --- a/docs/policy/3rd-party-software-sources.md |
1130 | +++ b/docs/policy/3rd-party-software-sources.md |
1131 | @@ -3,9 +3,9 @@ |
1132 | |
1133 | ## Purpose |
1134 | |
1135 | -Ubuntu maintains its own standards for certain aspects of quality and behaviour in relation to software that it ships, with the goal that users can expect and rely upon this. For example, the "Ubuntu LTS" label comes with an expectation that we do not generally disrupt users with free-for-all improvements during the lifetime of such an LTS release. |
1136 | +Ubuntu maintains its own standards for certain aspects of quality and behavior in relation to software that it ships, with the goal that users can expect and rely upon this. For example, the "Ubuntu LTS" label comes with an expectation that we do not generally disrupt users with free-for-all improvements during the lifetime of such an LTS release. |
1137 | |
1138 | -With an increasing reliance on snaps to ship to Ubuntu users by default, it's important to continue setting appropriate expectations for quality and behaviour outside the traditional "deb" archive and ensuring that they are met. For example, snaps are intended to delegate quality considerations and decisions to the snap publisher: anyone can publish snaps. But we want the snaps that Ubuntu ships by default, or otherwise makes available by default, to meet our own minimum quality standards. |
1139 | +With an increasing reliance on snaps to ship to Ubuntu users by default, it's important to continue setting appropriate expectations for quality and behavior outside the traditional "deb" archive and ensuring that they are met. For example, snaps are intended to delegate quality considerations and decisions to the snap publisher: anyone can publish snaps. But we want the snaps that Ubuntu ships by default, or otherwise makes available by default, to meet our own minimum quality standards. |
1140 | |
1141 | This document is intended to set a baseline for these expectations in general—for debs, snaps and any other packaging system that might be used in the future. |
1142 | |
1143 | @@ -19,17 +19,17 @@ This document specifies Ubuntu's baseline policy requirements on all software pr |
1144 | |
1145 | 1. Someone may want the installation of a deb from the Ubuntu archive to automatically enable and pull in a Flatpak from FlatHub. |
1146 | |
1147 | -1. The "Software Centre" of an Ubuntu flavour may choose to enable, by default, a third party package repository of some form. |
1148 | +1. The "Software Center" of an Ubuntu flavor may choose to enable, by default, a third party package repository of some form. |
1149 | |
1150 | -Any behaviour of this kind must comply with the requirements specified in this document. |
1151 | +Any behavior of this kind must comply with the requirements specified in this document. |
1152 | |
1153 | -The requirements documented here are intended to fulfil user expectations and similar issues that arise in relation to software origin. These are not the only set of requirements that exist. For example, Debian policy and the derived Ubuntu policy still apply for debs. |
1154 | +The requirements documented here are intended to fulfill user expectations and similar issues that arise in relation to software origin. These are not the only set of requirements that exist. For example, Debian policy and the derived Ubuntu policy still apply for debs. |
1155 | |
1156 | ### Not in scope |
1157 | |
1158 | If all routes to install some other software involves users explicitly choosing to opt in to some other software source and such that they are reasonably informed or is otherwise reasonably expected to understand that this choice means that Ubuntu is not responsible for software installed from this source, then this policy does not apply. |
1159 | |
1160 | -## General Requirements |
1161 | +## General requirements |
1162 | |
1163 | ### Review and approvals |
1164 | |
1165 | @@ -41,17 +41,17 @@ For example, the Technical Board expects to decline to approve PPAs as a mechani |
1166 | |
1167 | Various packages are exceptional for various reasons, and Ubuntu has a tradition of being pragmatic about this in order to deliver the best experience to our users. This document merely specifies the baseline. Exceptions will continue to be made on a case-by-case basis by the Technical Board or by any other teams as delegated by them. Exceptions granted by the Technical Board are documented in {ref}`appendix-a-general-exceptions`. |
1168 | |
1169 | -## Specific Principles |
1170 | +## Specific principles |
1171 | |
1172 | -### Principle 1: behaviour will remain "stable" for the lifetime of an Ubuntu release. |
1173 | +### Principle 1: behavior will remain "stable" for the lifetime of an Ubuntu release. |
1174 | |
1175 | The package publisher must agree that the package and any subsequent updates presented to Ubuntu users by default will remain stable for the lifetime of the Ubuntu release. |
1176 | |
1177 | -"Stable" means that behaviour from users' perspectives will not change, except to fix bugs, unless the change already matches a category of standing exception generally granted for Ubuntu packages themselves, as defined at [https://wiki.ubuntu.com/StableReleaseUpdates\#When](https://wiki.ubuntu.com/StableReleaseUpdates\#When) under the "When" section. |
1178 | +"Stable" means that behavior from users' perspectives will not change, except to fix bugs, unless the change already matches a category of standing exception generally granted for Ubuntu packages themselves, as defined at [Stable Release Updates](https://wiki.ubuntu.com/StableReleaseUpdates\#When) under the "When" section. |
1179 | |
1180 | Since updates may be made to the package without review by Ubuntu, this requirement is enforced by trust only. Ubuntu would appreciate consultation to discuss where we stand on individual issues that fall close to the line. Ultimately, if Ubuntu is unhappy about the way this requirement is being met, then the package, and other packages from the same maintenance teams, may be removed from publication by default in future Ubuntu releases to help meet the user expectation of stable release stability. |
1181 | |
1182 | -Rationale: Ubuntu users expect, for most packages, that a stable Ubuntu release remains stable in the sense that functionality and behaviour does not change until they opt-in to upgrading to a subsequent release. There are a number of pragmatic exceptions to this rule; the list of these should continue to be managed under the governance of the Technical Board. |
1183 | +Rationale: Ubuntu users expect, for most packages, that a stable Ubuntu release remains stable in the sense that functionality and behavior does not change until they opt-in to upgrading to a subsequent release. There are a number of pragmatic exceptions to this rule; the list of these should continue to be managed under the governance of the Technical Board. |
1184 | |
1185 | ### Principle 2: Ubuntu developers can override and patch packages |
1186 | |
1187 | @@ -75,7 +75,7 @@ Since updates may be made to the package without review by Ubuntu, this requirem |
1188 | |
1189 | Rationale: this is an expectation that exists for the Ubuntu deb archive, and should continue to exist for anything Ubuntu ships by default. |
1190 | |
1191 | -### Principle 4: licensing would be acceptable to Ubuntu ie. dfsg-free |
1192 | +### Principle 4: licensing would be acceptable to Ubuntu i.e. dfsg-free |
1193 | |
1194 | The package must be licensed under terms acceptable under the [Debian Free Software Guidelines](https://www.debian.org/social\_contract\#guidelines). |
1195 | |
1196 | @@ -83,9 +83,9 @@ Rationale: these are the same requirements Ubuntu has always applied to its main |
1197 | |
1198 | ### Principle 5: packages are built on a build farm that is trusted by the Ubuntu project |
1199 | |
1200 | -Packages must be built by and published from Ubuntu’s own infrastructure (ie. Launchpad and the Snap Store). |
1201 | +Packages must be built by and published from Ubuntu’s own infrastructure (i.e. Launchpad and the Snap Store). |
1202 | |
1203 | -Rationale: user security depends on trustworthiness of the build and publication process and is best served by keeping the number of organisations that must be trusted to a minimum; namely, one. |
1204 | +Rationale: user security depends on trustworthiness of the build and publication process and is best served by keeping the number of organizations that must be trusted to a minimum; namely, one. |
1205 | |
1206 | ### Principle 6: sources for published builds are retained and publicly available |
1207 | |
1208 | @@ -106,7 +106,7 @@ It must be possible for a user to locate and post in a public bug tracker about |
1209 | Rationale: an inability to do this harms the ability for users to develop and share modifications to packages. Such modifications are the essence of Free Software and the ability to communicate with other users in a bug database is a long-standing expectation of users of Ubuntu. |
1210 | |
1211 | (appendix-a-general-exceptions)= |
1212 | -## Appendix A: General Exceptions |
1213 | +## Appendix A: General exceptions |
1214 | |
1215 | ### Exception to Principle 7: available on all architectures supported by Ubuntu |
1216 | |
1217 | @@ -116,7 +116,7 @@ If Launchpad does not allow the general public to build on a particular architec |
1218 | |
1219 | This section only applies to a package that, regardless of architecture support, could only practically be used exclusively by desktop users. |
1220 | |
1221 | -If such a package is only used for the purposes of being made available in some flavours (by seeding or presenting it for user installation in a flavour-specific way), then only the architectures supported by those flavours need to be supported. |
1222 | +If such a package is only used for the purposes of being made available in some flavors (by seeding or presenting it for user installation in a flavor-specific way), then only the architectures supported by those flavors need to be supported. |
1223 | |
1224 | This exception may exclude the opportunity for those architectures from doing “remote desktop hosting” because widespread support across packages for those architectures may be missing as a result. We think this is an acceptable trade-off between this possibility and the burden of maintaining such packages in those architectures. |
1225 | |
1226 | @@ -124,48 +124,48 @@ This exception may exclude the opportunity for those architectures from doing |
1227 | |
1228 | If it is not practical to maintain full architecture support for some specific package, and the more general exceptions above cannot be used, then the Technical Board may grant and document an exception here. The following packages currently have such exceptions: |
1229 | |
1230 | -* Firefox. Must build on amd64, arm64 and armhf. Reason: unsupported upstream, too complex to fix at the distro level. |
1231 | -* snap-store (ie. the new one currently on the preview channel). |
1232 | -* Ubuntu desktop installer. Uses Flutter for which there isn’t a runtime on other arches. |
1233 | +* Firefox. Must build on amd64, arm64 and armhf. Reason: unsupported upstream, too complex to fix at the distribution level. |
1234 | +* snap-store (i.e. the new one currently on the preview channel). |
1235 | +* Ubuntu desktop installer. Uses Flutter for which there isn’t a runtime on other architectures. |
1236 | |
1237 | -## Appendix B: Snap Specifics |
1238 | +## Appendix B: Snap specifics |
1239 | |
1240 | -### How Snaps Implement the Principles |
1241 | +### How snaps implement the principles |
1242 | |
1243 | #### Track mappings and ICE branches |
1244 | |
1245 | Principles 1 and 2 are implemented in snaps through the use of *track mappings* and *ICE branches* as defined here. Tracks and branches are aspects of [snap channels](https://snapcraft.io/docs/channels). |
1246 | |
1247 | -* **Track mappings.** To maintain stable behaviour for the lifetime of a given Ubuntu release, that release is mapped to a snap track for each snap that is within scope. For example, we might declare that snap package “foo” shall, by default on a fresh installation of Ubuntu 24.04, be installed and mapped to track “15” of the “foo” snap package. This mapping would be expected to remain fixed for the lifetime of Ubuntu 24.04. |
1248 | -* **ICE branches.** snapd may be configured to follow a given channel branch for a particular installed snap, and this shall be done for all snaps when their installation falls under the scope of this policy. The branch name shall be “ubuntu-XX.YY”, where XX.YY is the Ubuntu release version in question. For example, on Ubuntu 24.04, the firefox snap should track “latest/stable/ubuntu-24.04” by default. For the purposes of this policy, we’ll call this snap branch the in-case-of emergency branch (“ICE branch”). Since the Firefox snap holds an exception to principle 1, only principle 2 is implemented in this example. |
1249 | +* **Track mappings.** To maintain stable behavior for the lifetime of a given Ubuntu release, that release is mapped to a snap track for each snap that is within scope. For example, we might declare that snap package “foo” shall, by default on a fresh installation of Ubuntu 24.04, be installed and mapped to track “15” of the “foo” snap package. This mapping would be expected to remain fixed for the lifetime of Ubuntu 24.04. |
1250 | +* **ICE branches.** `snapd` may be configured to follow a given channel branch for a particular installed snap, and this shall be done for all snaps when their installation falls under the scope of this policy. The branch name shall be `ubuntu-XX.YY`, where `XX.YY` is the Ubuntu release version in question. For example, on Ubuntu 24.04, the Firefox snap should track `latest/stable/ubuntu-24.04` by default. For the purposes of this policy, we’ll call this snap branch the in-case-of emergency branch (“ICE branch”). Since the Firefox snap holds an exception to principle 1, only principle 2 is implemented in this example. |
1251 | |
1252 | When a user upgrades to a new Ubuntu distribution release, the track mapping is often expected to change. As an exception, the track mapping may also change during the lifetime of a stable release. |
1253 | |
1254 | -##### Behaviour on release upgrades |
1255 | +##### Behavior on release upgrades |
1256 | |
1257 | -1. **Snaps installed by default.** If a snap was installed by default on an Ubuntu installation, it is preferable for users to automatically refresh to the new default snap channel automatically (including track, risk and branch) regardless of whether they have previously deviated from previous default ICE-enabled channel. This practice is consistent with other package types and PPAs where release upgrades aim to create a consistent ‘standard’ configuration. For example: on upgrade from 24.04 to 26.04, the Software Centre snap should be refreshed to the track mapping and stable risk channel for 26.04 regardless of whether the user had adjusted it before. |
1258 | -1. **Snaps otherwise within scope.** If a snap was not installed by default, but instead installed by a different path that nevertheless falls within the scope of this document, then it should be refreshed to the new track mapping only if the user had not deviated from it tracking the ICE branch. For example, the lxd transitional deb on 24.10 might arrange for the snap to track 5.20/stable/ubuntu-24.10 based on its track mapping for 24.10. If on upgrade to 25.04 it is still tracking a branch that matches /^ubuntu-/ and the track mapping has changed to 5.21, then it would be migrated to track 5.21/stable/ubuntu-25.04 instead. However, had the user deviated away from tracking the ICE branch, that case would be indistinguishable from the following case “Snaps not in scope” and behaviour shall be as if the snap were no longer in scope. Therefore, users can opt a snap out of falling under this case by bringing them out of scope using `snap refresh` or `snap switch` to no longer track the ICE branch. |
1259 | +1. **Snaps installed by default.** If a snap was installed by default on an Ubuntu installation, it is preferable for users to automatically refresh to the new default snap channel automatically (including track, risk and branch) regardless of whether they have previously deviated from previous default ICE-enabled channel. This practice is consistent with other package types and PPAs where release upgrades aim to create a consistent ‘standard’ configuration. For example: on upgrade from 24.04 to 26.04, the Software Center snap should be refreshed to the track mapping and stable risk channel for 26.04 regardless of whether the user had adjusted it before. |
1260 | +1. **Snaps otherwise within scope.** If a snap was not installed by default, but instead installed by a different path that nevertheless falls within the scope of this document, then it should be refreshed to the new track mapping only if the user had not deviated from it tracking the ICE branch. For example, the `lxd` transitional deb on 24.10 might arrange for the snap to track `5.20/stable/ubuntu-24.10` based on its track mapping for 24.10. If on upgrade to 25.04 it is still tracking a branch that matches `/^ubuntu-/` and the track mapping has changed to 5.21, then it would be migrated to track `5.21/stable/ubuntu-25.04` instead. However, had the user deviated away from tracking the ICE branch, that case would be indistinguishable from the following case “Snaps not in scope” and behavior shall be as if the snap were no longer in scope. Therefore, users can opt a snap out of falling under this case by bringing them out of scope using `snap refresh` or `snap switch` to no longer track the ICE branch. |
1261 | 1. **Snaps not in scope.** If the snap is not installed by default on an Ubuntu installation and was installed by the user manually, then the channel it tracks should not change. This case is detected by the previous channel being tracked not having an ICE branch included. |
1262 | |
1263 | -Track mapping changes during release upgrades shall be handled between ubuntu-release-upgrader and transitional debs as required. If the snap being migrated was previously not tracking an ICE branch, the user should be notified so that they can manually return to the previous state if preferred. |
1264 | +Track mapping changes during release upgrades shall be handled between `ubuntu-release-upgrader` and transitional debs as required. If the snap being migrated was previously not tracking an ICE branch, the user should be notified so that they can manually return to the previous state if preferred. |
1265 | |
1266 | -Exceptional track mapping changes during the lifetime of an Ubuntu release may occur. These would require approval from the Technical Board on a case-by-case basis. They would be expected to be handled via the SRU of a suitable deb package which would then implement this logic in its postinst. We do not consider it necessary to implement this unless and until such an exception becomes necessary. |
1267 | +Exceptional track mapping changes during the lifetime of an Ubuntu release may occur. These would require approval from the Technical Board on a case-by-case basis. They would be expected to be handled via the SRU of a suitable deb package which would then implement this logic in its `postinst` script. We do not consider it necessary to implement this unless and until such an exception becomes necessary. |
1268 | |
1269 | ##### ICE branch details |
1270 | |
1271 | -Normally, ICE branches are tracked by the snapd client but nevertheless do not exist, and in this case snapd falls back to not using any branch. For example, while tracking “latest/stable/ubuntu-24.04” it would install and maintain Firefox from the “latest/stable” channel so long as “latest/stable/ubuntu-24.04” does not exist. However, it does still continue to track “latest/stable/ubuntu-24.04” even if it has applied this fallback mechanism, so future publication into the ICE branch would cause users to switch to this published build, enabling principle 2\. |
1272 | +Normally, ICE branches are tracked by the `snapd` client but nevertheless do not exist, and in this case `snapd` falls back to not using any branch. For example, while tracking `latest/stable/ubuntu-24.04` it would install and maintain Firefox from the `latest/stable` channel so long as `latest/stable/ubuntu-24.04` does not exist. However, it does still continue to track `latest/stable/ubuntu-24.04` even if it has applied this fallback mechanism, so future publication into the ICE branch would cause users to switch to this published build, enabling principle 2. |
1273 | |
1274 | -After a release upgrade, the name of an ICE branch changes. If “Behaviour on release upgrades” above requires the snap to be migrated, then the ICE branch name being tracked should also change as part of the upgrade. |
1275 | +After a release upgrade, the name of an ICE branch changes. If “Behavior on release upgrades” above requires the snap to be migrated, then the ICE branch name being tracked should also change as part of the upgrade. |
1276 | |
1277 | -To identify “Snaps otherwise within scope”, for robustness, we shall consider the tracking of any ICE branch name as a qualifier, not just the specific ICE branch matching the release from which we are upgrading. For example, if the system is tracking “latest/beta/ubuntu-18.04” at the time of upgrading from Ubuntu 22.04 to Ubuntu 24.04, the upgrade process would change the channel being tracked to “15/stable/ubuntu-24.04” if that’s what “Behaviour on release upgrades” says, even though the previous track didn’t match the previous mapping, and even though the previous ICE branch name didn’t match the release from which we were upgrading. |
1278 | +To identify “Snaps otherwise within scope”, for robustness, we shall consider the tracking of any ICE branch name as a qualifier, not just the specific ICE branch matching the release from which we are upgrading. For example, if the system is tracking `latest/beta/ubuntu-18.04` at the time of upgrading from Ubuntu 22.04 to Ubuntu 24.04, the upgrade process would change the channel being tracked to `15/stable/ubuntu-24.04` if that’s what “Behavior on release upgrades” says, even though the previous track didn’t match the previous mapping, and even though the previous ICE branch name didn’t match the release from which we were upgrading. |
1279 | |
1280 | ##### Summary |
1281 | |
1282 | -The specifics are documented above, but to avoid any doubt, the effect of the snap implementations of principles 1 and 2 are that snaps installed that are in scope shall usually combine to track a channel where the track is specified by the track mapping, the risk is `stable` and the branch is `ubuntu-XX.YY` where `XX.YY` is the Ubuntu release of the installed system. Exceptionally, if the Technical Board has granted an exception from principle 1 (eg. Firefox) then the track would be `latest` instead. For example, if Libreoffice were to ship as a snap and did not have an exception against principle 1 then a default 24.04 desktop system might track `24/stable/ubuntu-24.04`. It would be required that there is a `24` track in this example since use of a `latest` track would violate principle 1\. Firefox on the same system would be expected to track `latest/stable/ubuntu-24.04` since it does have an exception against principle 1\. |
1283 | +The specifics are documented above, but to avoid any doubt, the effect of the snap implementations of principles 1 and 2 are that snaps installed that are in scope shall usually combine to track a channel where the track is specified by the track mapping, the risk is `stable` and the branch is `ubuntu-XX.YY` where `XX.YY` is the Ubuntu release of the installed system. Exceptionally, if the Technical Board has granted an exception from principle 1 (e.g. Firefox) then the track would be `latest` instead. For example, if LibreOffice were to ship as a snap and did not have an exception against principle 1 then a default 24.04 desktop system might track `24/stable/ubuntu-24.04`. It would be required that there is a `24` track in this example since use of a `latest` track would violate principle 1. Firefox on the same system would be expected to track `latest/stable/ubuntu-24.04` since it does have an exception against principle 1. |
1284 | |
1285 | -#### Principle 1: behaviour will remain "stable" for the lifetime of an Ubuntu release |
1286 | +#### Principle 1: behavior will remain "stable" for the lifetime of an Ubuntu release |
1287 | |
1288 | -This is achieved by use of track mappings combined with established behaviour by the snapd client. The track mapping of a snap that is within scope must use a track for which upstream commits to maintain this principle. This means that `latest` is not a permitted track mapping unless an exception exists as below. |
1289 | +This is achieved by use of track mappings combined with established behavior by the `snapd` client. The track mapping of a snap that is within scope must use a track for which upstream commits to maintain this principle. This means that `latest` is not a permitted track mapping unless an exception exists as below. |
1290 | |
1291 | We then rely on the snap maintainer to keep the track stable. This is the normal expectation anyway for snap tracks that aren’t `latest`; we shall rely on trust as is permitted by the requirement. |
1292 | |
1293 | @@ -177,7 +177,7 @@ If the Technical Board were to grant an exception after release, then the mappin |
1294 | |
1295 | #### Principle 2: Ubuntu developers will be able to override and patch the package |
1296 | |
1297 | -This is achieved by use of ICE branches combined with established behaviour by the snapd client. |
1298 | +This is achieved by use of ICE branches combined with established behavior by the `snapd` client. |
1299 | |
1300 | This requires the Technical Board to have the ultimate authority to publish into such an ICE branch. It is a condition of the permission to include snaps into Ubuntu that the Snap Store admins defer to the Technical Board’s authority and permit such a publication should, in the sole opinion of the Technical Board, the need arises. |
1301 | |
1302 | @@ -185,7 +185,7 @@ This requires the Technical Board to have the ultimate authority to publish into |
1303 | |
1304 | We will document explicit agreement from individual snap maintainers. |
1305 | |
1306 | -#### Principle 4: licensing would be acceptable to Ubuntu ie. dfsg-free |
1307 | +#### Principle 4: licensing would be acceptable to Ubuntu i.e. dfsg-free |
1308 | |
1309 | This will be managed to the same standard as Ubuntu’s deb archive. At a minimum, an initial check is required by a competent person before moving a snap within scope, and a process by which deviations can be reported and resolved. |
1310 | |
1311 | @@ -207,7 +207,7 @@ Compliance will be checked for each in-scope snap once. A bug can be filed again |
1312 | |
1313 | #### Additional requirements |
1314 | |
1315 | -The TB agreed in their meeting on 30 May 2023 that any new seeded snaps must be announced in advance to ubuntu-devel@, to help the TB monitor the quality of seeded snaps whose maintainers may not necessarily be Ubuntu developers. |
1316 | +The TB agreed in their meeting on 30 May 2023 that any new seeded snaps must be announced in advance to the [ubuntu-devel@](https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel) mailing list, to help the TB monitor the quality of seeded snaps whose maintainers may not necessarily be Ubuntu developers. |
1317 | |
1318 | ## Appendix C: Matters not yet addressed |
1319 | |
1320 | @@ -227,67 +227,67 @@ The following snaps are identified to fall under the scope of these requirements |
1321 | |
1322 | Via Ubuntu-specific deb packages |
1323 | |
1324 | -* chromium |
1325 | +* `chromium` |
1326 | |
1327 | -* firefox |
1328 | +* `firefox` |
1329 | |
1330 | -* lxd (also seeded) |
1331 | +* `lxd` (also seeded) |
1332 | |
1333 | -* snapcraft |
1334 | +* `snapcraft` |
1335 | |
1336 | Via deb package as synced from Debian: |
1337 | |
1338 | -* cyphesis-cpp |
1339 | +* `cyphesis-cpp` |
1340 | |
1341 | -* ember |
1342 | +* `ember` |
1343 | |
1344 | Via [seeds](https://bazaar.launchpad.net/\~ubuntu-archive/ubuntu-archive-scripts/trunk/view/head:/update-seeds) |
1345 | |
1346 | -* snapd itself (Samuele says: *snapd itself is also a snap that we ship in images, it uses latest/stable like firefox and the deb has a SRU-exception(?). The snapd deb also installs it if not already present when installing snaps*) |
1347 | +* `snapd` itself (Samuele says: *`snapd` itself is also a snap that we ship in images, it uses latest/stable like `firefox` and the deb has a SRU-exception(?). The `snapd` deb also installs it if not already present when installing snaps*) |
1348 | |
1349 | -* freeshow (Ubuntu Studio) |
1350 | +* `freeshow` (Ubuntu Studio) |
1351 | |
1352 | -* Some of gnome-3-{28,34,38}-{18,20}04 |
1353 | +* Some of `gnome-3-{28,34,38}-{18,20}04` |
1354 | |
1355 | -* gtk-common-themes |
1356 | +* `gtk-common-themes` |
1357 | |
1358 | * Only in Bionic: |
1359 | |
1360 | - * gnome-calculator |
1361 | + * `gnome-calculator` |
1362 | |
1363 | - * gnome-characters |
1364 | + * `gnome-characters` |
1365 | |
1366 | - * gnome-log |
1367 | + * `gnome-log` |
1368 | |
1369 | - * gnome-system-monitor |
1370 | + * `gnome-system-monitor` |
1371 | |
1372 | - * pulsemixer (MATE) |
1373 | + * `pulsemixer` (MATE) |
1374 | |
1375 | -* snapd-desktop-integration |
1376 | +* `snapd-desktop-integration` |
1377 | |
1378 | -* software-boutique (MATE) |
1379 | +* `software-boutique` (MATE) |
1380 | |
1381 | -* ubuntu-budgie-welcome (Budgie) |
1382 | +* `ubuntu-budgie-welcome` (Budgie) |
1383 | |
1384 | -* ubuntu-mate-welcome (MATE) |
1385 | +* `ubuntu-mate-welcome` (MATE) |
1386 | |
1387 | -* lxd (also through transitional deb) |
1388 | +* `lxd` (also through transitional deb) |
1389 | |
1390 | -* snap-store |
1391 | +* `snap-store` |
1392 | |
1393 | -* ubuntu-desktop-installer/classic=latest/edge (from wsl) |
1394 | +* `ubuntu-desktop-installer/classic=latest/edge` (from WSL) |
1395 | |
1396 | Via installer image generation: |
1397 | |
1398 | -* subiquity |
1399 | +* `subiquity` |
1400 | |
1401 | #### Principle 3: the package maintainer agrees to maintain the package for the lifetime of the Ubuntu release |
1402 | |
1403 | We will arrange a place where agreements made can be documented and complete that for each snap within scope. |
1404 | |
1405 | -#### Principle 4: licensing would be acceptable to Ubuntu ie. dfsg-free |
1406 | +#### Principle 4: licensing would be acceptable to Ubuntu i.e. dfsg-free |
1407 | |
1408 | -* Individual analysis pending: chromium, cyphesis-cpp, ember, firefox, freeshow, gnome-3-38-2004, gtk-common-themes, lxd, snapcraft, snapd-desktop-integration, snap-store, ubuntu-desktop-installer, subiquity. |
1409 | +* Individual analysis pending: `chromium`, `cyphesis-cpp`, `ember`, `firefox`, `freeshow`, `gnome-3-38-2004`, `gtk-common-themes`, `lxd`, `snapcraft`, `snapd-desktop-integration`, `snap-store`, `ubuntu-desktop-installer`, `subiquity`. |
1410 | |
1411 | * Snaps compliant: TBC |
1412 | |
1413 | @@ -299,7 +299,7 @@ This is not currently the case, although the required metadata may be available |
1414 | |
1415 | #### Principle 7: published on all architectures supported by Ubuntu |
1416 | |
1417 | -* Individual analysis pending: chromium, cyphesis-cpp, ember, firefox, freeshow, gnome-3-38-2004, gtk-common-themes, lxd, snapcraft, snapd-desktop-integration, snap-store, ubuntu-desktop-installer, subiquity. |
1418 | +* Individual analysis pending: `chromium`, `cyphesis-cpp`, `ember`, `firefox`, `freeshow`, `gnome-3-38-2004`, `gtk-common-themes`, `lxd`, `snapcraft`, `snapd-desktop-integration`, `snap-store`, `ubuntu-desktop-installer`, `subiquity`. |
1419 | |
1420 | * Snaps compliant: TBC |
1421 | |
1422 | @@ -307,13 +307,13 @@ This is not currently the case, although the required metadata may be available |
1423 | |
1424 | #### Principle 8: a public issue/bug tracker is available |
1425 | |
1426 | -* Individual analysis pending: chromium, cyphesis-cpp, ember, firefox, freeshow, gnome-3-38-2004, gtk-common-themes, lxd, snapcraft, snapd-desktop-integration, snap-store, ubuntu-desktop-installer, subiquity. |
1427 | +* Individual analysis pending: `chromium`, `cyphesis-cpp`, `ember`, `firefox`, `freeshow`, `gnome-3-38-2004`, `gtk-common-themes`, `lxd`, `snapcraft`, `snapd-desktop-integration`, `snap-store`, `ubuntu-desktop-installer`, `subiquity`. |
1428 | |
1429 | * Snaps compliant: TBC |
1430 | |
1431 | * Snaps not compliant: TBC |
1432 | |
1433 | -### Unresolved Issues |
1434 | +### Unresolved issues |
1435 | |
1436 | The following issues are relevant to this document, and probably contradict this policy. In order to make progress, we will accept these for now, and hope to find a suitable resolution later. |
1437 | |
1438 | @@ -334,11 +334,11 @@ This identifies a similar issue in two different software components: |
1439 | |
1440 | Sebastian Bacher asked: |
1441 | |
1442 | -*Ubuntu has a restricted section for things like nvidia drivers which are provided by default and non dfsg-free, we should probably have an equivalent exception for snaps?* |
1443 | +*Ubuntu has a restricted section for things like NVIDIA drivers which are provided by default and non dfsg-free, we should probably have an equivalent exception for snaps?* |
1444 | |
1445 | Robie Basak responded: |
1446 | |
1447 | -*AIUI, these always require explicit user opt-in. Eg. the 22.04.1 installer says "Install third-party software for graphics and Wi-Fi hardware and additional media formats. This software is subject to license terms included with its documentation. Some is proprietary."* |
1448 | +*As I understand it, these always require explicit user opt-in. E.g. the 22.04.1 installer says "Install third-party software for graphics and Wi-Fi hardware and additional media formats. This software is subject to license terms included with its documentation. Some is proprietary."* |
1449 | |
1450 | *I think this puts the restricted archive component out of the scope of these requirements, based on the user's explicit informed consent that matches the requirement in the "Out of Scope" section of this document.* |
1451 | |
1452 | @@ -350,15 +350,15 @@ However, on checking, the restricted and multiverse archive components are enabl |
1453 | |
1454 | Sebastian Bacher asked, in reference to the requirement to make publicly available the sources and build logs, in respect of snaps: |
1455 | |
1456 | -*We don't have logs compliant with those requirements today afaik, build​-snapcraft.io doesn't publish build history and logs and launchpad only lists the 10 most recent builds entries and has no UI to browser older items. Was there any discussion started with the launchpad team about the topic?* |
1457 | +*We don't have logs compliant with those requirements today as far as I know, `build.snapcraft.io` doesn't publish build history and logs and Launchpad-only lists the 10 most recent builds entries and has no UI to browse older items. Was there any discussion started with the Launchpad team about the topic?* (Note: `build.snapcraft.io` has been deprecated: [We are changing the way you build snaps from GitHub repositories](https://snapcraft.io/blog/we-are-changing-the-way-you-build-snaps-from-github-repos).) |
1458 | |
1459 | Robie: yes, I did consult with the Snap Store team that this should in principle be fixed at the Snap Store end. The implementation of this requirement in the case of snaps will remain incomplete for now, pending the necessary engineering work. But this document initially defines that our goal as a project is that this will be done. |
1460 | |
1461 | -### Other Feedback |
1462 | +### Other feedback |
1463 | |
1464 | There was much valuable feedback received, and this led to many iterations of this document. However some feedback was considered out of scope or deliberately not acted upon. To avoid forgetting about it, these are documented here. |
1465 | |
1466 | #### Deferred for possible implementation in the future |
1467 | |
1468 | * William Grant asked, in the context of requiring public sources and build logs to be available: *Do we want to require debug symbols too?* |
1469 | -* @vanvugt [suggested](https://discourse.ubuntu.com/t/technical-board-feedback-requested-draft-policy-on-third-party-software-sources-included-by-ubuntu/46849/4?u=rbasak) requiring support for automated crash dumps and frame pointers |
1470 | +* Daniel van Vugt [suggested](https://discourse.ubuntu.com/t/technical-board-feedback-requested-draft-policy-on-third-party-software-sources-included-by-ubuntu/46849/4?u=rbasak) requiring support for automated crash dumps and frame pointers |
Forgot to mention that this MP follows up on https:/ /code.launchpad .net/~rkratky/ ubuntu- governance- docs/+git/ ubuntu- governance- docs/+merge/ 482863 and should only be merged after it.