Skip to content

ci: add reo integration#2687

Merged
moabu merged 9 commits intomainfrom
add-reo-integration
Mar 10, 2026
Merged

ci: add reo integration#2687
moabu merged 9 commits intomainfrom
add-reo-integration

Conversation

@ossdhaval
Copy link
Contributor

@ossdhaval ossdhaval commented Mar 4, 2026

Add reo.dev tracker to docs

Summary by CodeRabbit

  • New Features

    • Optional analytics integrations for documentation (Reo and Scarf), disabled by default; includes a client-side loader for Reo.
  • Chores

    • Documentation build updated to fetch theme overrides and assets during manual workflows or releases, and to enable the analytics flags when a release is published.

Signed-off-by: Dhaval D <343411+ossdhaval@users.noreply.github.com>
Signed-off-by: Dhaval D <343411+ossdhaval@users.noreply.github.com>
Signed-off-by: Dhaval D <343411+ossdhaval@users.noreply.github.com>
@ossdhaval ossdhaval self-assigned this Mar 4, 2026
@ossdhaval ossdhaval requested review from iromli and moabu as code owners March 4, 2026 15:22
@ossdhaval ossdhaval added the area-documentation Documentation needs to change as part of issue or PR label Mar 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

Adds optional analytics to the docs: a theme override and JS asset that can conditionally inject a Scarf tracking pixel and load Reo; mkdocs.yml gains a custom_dir and two feature flags; CI workflow steps fetch overrides/assets from main and can toggle the flags prior to deployment. (38 words)

Changes

Cohort / File(s) Summary
GitHub Actions workflow
.github/workflows/build-docs.yml
Added steps to pull docs/overrides/main.html, docs/assets/js/reo.js, and mkdocs assets from origin/main, and to set/print extra.enable_scarf_pixel and extra.enable_reo_flag before the mike deploy step; conditioned on workflow_dispatch and release events.
Docs template & assets
docs/overrides/main.html, docs/assets/js/reo.js
Added main.html override that conditionally injects a Scarf pixel and includes /assets/js/reo.js when flags are enabled; added reo.js which dynamically loads and initializes Reo from the CDN.
MkDocs config
mkdocs.yml
Added theme.custom_dir: docs/overrides and two booleans under extra: enable_scarf_pixel: false and enable_reo_flag: false.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions
    participant Repo as Repository
    participant Build as MkDocs Build
    participant Browser as Visitor Browser
    participant ReoCDN as Reo CDN

    CI->>Repo: fetch overrides (`docs/overrides/main.html`, `docs/assets/js/reo.js`) and mkdocs assets
    CI->>Repo: set extra flags (enable_scarf_pixel, enable_reo_flag)
    Repo->>Build: build docs with template override and extras
    Browser->>Build: request docs page
    Build-->>Browser: serve HTML (may include Scarf pixel + `/assets/js/reo.js`)
    Browser->>ReoCDN: request reo.js (if enabled)
    ReoCDN-->>Browser: deliver reo.js → reo.init(...) executes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I found a tiny pixel on the way,
A script that hops from far away.
Reo arrives to say hello,
Scarf leaves crumbs that softly glow.
Docs now whisper metrics as they play.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'ci: add reo integration' accurately reflects the main change: integrating Reo tracking into the CI/documentation workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-reo-integration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mo-auto mo-auto added the area-CI Indicates work required in automatic builds or CI infrastructure label Mar 4, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-docs.yml:
- Around line 133-136: The step "Use latest template overrides from main"
currently redirects output to docs/overrides/main.html which can fail if
docs/overrides doesn't exist; modify that step to create the directory first
(e.g., ensure docs/overrides exists with a mkdir -p equivalent) before running
git show origin/main:docs/overrides/main.html > docs/overrides/main.html so the
redirect cannot error out on missing directory.

In `@docs/overrides/main.html`:
- Around line 10-17: The template currently emits the Scarff pixel <img> and
reo.js <script> solely based on build-time flags
(config.extra.enable_scarf_pixel and config.extra.enable_reo_flag); change it to
perform a runtime consent check before injecting/loading those trackers by
replacing the static tags with a small inline script that queries your runtime
consent API/state (e.g., window.getUserConsent() or a consent
cookie/localStorage flag or navigator.doNotTrack) and only creates/appends the
<img src="..."> or loads reo.js when consent is granted; keep the build-time
flags to opt-in at deploy time but gate actual network calls on a runtime
consent function to prevent tracking before user consent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 231eaef2-ebdc-49f0-a8e8-6065bbf33436

📥 Commits

Reviewing files that changed from the base of the PR and between dc3bdd5 and f53fd04.

📒 Files selected for processing (4)
  • .github/workflows/build-docs.yml
  • docs/assets/js/reo.js
  • docs/overrides/main.html
  • mkdocs.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Dhaval D <343411+ossdhaval@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-docs.yml:
- Around line 133-137: The workflow step currently copies only
docs/overrides/main.html from origin/main, but also needs to copy
docs/assets/js/reo.js to avoid 404s when enabling Reo; update the same step (the
block that creates docs/overrides and runs git show
origin/main:docs/overrides/main.html) to additionally fetch
origin/main:docs/assets/js/reo.js into docs/assets/js/reo.js (ensure the target
directory docs/assets/js exists or is created first) so the tracker script is
present when Reo is enabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c1f4ca86-5c65-4721-a78c-9f427c7e280a

📥 Commits

Reviewing files that changed from the base of the PR and between f53fd04 and 0a9f324.

📒 Files selected for processing (1)
  • .github/workflows/build-docs.yml

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-docs.yml:
- Around line 140-146: The release path can operate on an older tag that lacks
the new mkdocs.yml keys, so before running the sed/grep commands in the "Enable
Reo and Scarf tracking for versioned docs" step ensure mkdocs.yml is backfilled
from main; add a command such as git fetch origin main && git checkout
origin/main -- mkdocs.yml (or git restore --source=origin/main mkdocs.yml)
before the sed lines so that the sed replacements and the grep
(enable_scarf_pixel/enable_reo_flag) operate on the up-to-date file and don’t
fail on older tags.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5206f536-037f-4c5b-821e-36cb2b8d255c

📥 Commits

Reviewing files that changed from the base of the PR and between 0a9f324 and 6cecac8.

📒 Files selected for processing (1)
  • .github/workflows/build-docs.yml

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 7, 2026

Signed-off-by: Dhaval D <343411+ossdhaval@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/build-docs.yml:
- Around line 133-139: The workflow currently writes mkdocs.yml twice for
workflow_dispatch: once in the earlier "restore" step and again in the "Use
latest template overrides and Reo asset from main" step (which runs for
workflow_dispatch and release), so collapse the mkdocs.yml backfill into this
single step by removing or disabling the earlier restore of mkdocs.yml and
keeping only the git show > mkdocs.yml invocation in the "Use latest template
overrides and Reo asset from main" step; ensure mkdocs.yml is no longer written
elsewhere so the dispatch path is unambiguous.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5bcdbc21-7892-43b6-8841-e4bb44a4d5a7

📥 Commits

Reviewing files that changed from the base of the PR and between 6cecac8 and 19c51f1.

📒 Files selected for processing (1)
  • .github/workflows/build-docs.yml

@ossdhaval
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@moabu
Copy link
Member

moabu commented Mar 10, 2026

@coderabbitai resolve

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

✅ Actions performed

Comments resolved. Auto-approval is disabled; enable reviews.request_changes_workflow to approve automatically.

@moabu moabu merged commit b6e855c into main Mar 10, 2026
7 checks passed
@moabu moabu deleted the add-reo-integration branch March 10, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CI Indicates work required in automatic builds or CI infrastructure area-documentation Documentation needs to change as part of issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants