Skip to content

Tos gate base64 urls feature with TDD and new CI workflow#1269

Merged
miczyg1 merged 5 commits into
masterfrom
tos-gate-base64-urls
May 18, 2026
Merged

Tos gate base64 urls feature with TDD and new CI workflow#1269
miczyg1 merged 5 commits into
masterfrom
tos-gate-base64-urls

Conversation

@artur-rs
Copy link
Copy Markdown
Member

$ pytest
====================================== test session starts ======================================
platform linux -- Python 3.13.13, pytest-8.3.2, pluggy-1.6.0
rootdir: /<redacted>/Dasharo/docs
collected 384 items                                                                             

tests/test_tos_gate.py ................sssssssssssssssssssssssssssssssss.sssssss.ssssssss [ 17%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 40%]
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.ssssssssssss [ 63%]
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 86%]
sssssssssssssssssssssssssssssssssssssssssssssss....                                       [100%]

================================ 23 passed, 361 skipped in 0.48s ================================

artur-rs added 2 commits May 17, 2026 18:43
- docs/javascripts/tos-gate.js - new revealGated() function, intentionally no
  rel="noreferrer
- main.py - Added tos_gated_downloads(section_id, files, tos_url) macro;
  tos_checkbox kept for other uses
- mkdocs.yml - Added javascripts/tos-gate.js to extra_javascript
- overrides/main.html - New pins Referrer-Policy:
  strict-origin-when-cross-origin globally

Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
29 tests across four classes:
- TestTosGatedDownloads (9) - macro unit tests: URL absent from HTML,
  base64/JSON roundtrip, group format encoding, checkbox attributes,
  prose_section_id, tos_url override
- TestTosCheckbox (4) - legacy macro: element presence, section ID, URL
  defaults/override
- TestTosGateJs (7) - JS file: function defined, noreferrer absent from link
  template but warning comment present, data-prose-group selector present, group
  branch present, prose hidden on uncheck
- TestStaticFiles (9) - no plain dl.3mdeb.com links, correct macro usage in
  variants/ files, tos-gate.js in mkdocs.yml, permalink: true, referrer meta in
  overrides/main.html

Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
@artur-rs artur-rs requested review from miczyg1 and pietrushnic May 17, 2026 17:18
@artur-rs artur-rs self-assigned this May 17, 2026
Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
Comment thread docs/variants/gigabyte_mz33-ar1/releases.md Outdated
Signed-off-by: Artur Raglis <artur.raglis@3mdeb.com>
@artur-rs artur-rs force-pushed the tos-gate-base64-urls branch from 5b6b077 to adfa93e Compare May 18, 2026 08:25
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
@miczyg1 miczyg1 merged commit dd784e0 into master May 18, 2026
4 of 5 checks passed
@miczyg1 miczyg1 deleted the tos-gate-base64-urls branch May 18, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants