Skip to content

ENG-9503: Serve integration docs images locally#6671

Merged
Alek99 merged 7 commits into
mainfrom
carlos/self-serve-integrations-docs-images
Jun 24, 2026
Merged

ENG-9503: Serve integration docs images locally#6671
Alek99 merged 7 commits into
mainfrom
carlos/self-serve-integrations-docs-images

Conversation

@carlosabadia

Copy link
Copy Markdown
Contributor

No description provided.

@carlosabadia carlosabadia added the skip-changelog For doc/internal changes label Jun 19, 2026
@carlosabadia carlosabadia requested review from a team and Alek99 as code owners June 19, 2026 14:50
@linear-code

linear-code Bot commented Jun 19, 2026

Copy link
Copy Markdown

ENG-9503

@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces local serving of integration doc screenshots by rewriting raw GitHub URLs to local asset URLs via a new rewrite_integration_doc_images_in_source helper, mirroring the existing logo-serving pattern. It also fixes a markdown image-syntax typo ([!Roboflow]![Roboflow]) in roboflow.md and removes an unreachable HubSpot screenshot reference.

  • integrations.py: Refactors _integrations_logos_url into a shared _integrations_images_url(subdir) helper; adds _integrations_doc_images_url and rewrite_integration_doc_images_in_source with a fast-path short-circuit when no raw GitHub URLs are present.
  • docgen_pipeline.py: Applies the rewrite to each doc source before parsing, so the pipeline never serves images from raw GitHub.
  • test_integrations.py: Four new tests verify rewriting correctness, no-op behaviour, local image existence, and the ![alt](url) syntax rule — with a fixture that guards against symlink side effects during tests.

Confidence Score: 5/5

Changes are narrowly scoped to image URL rewriting in the docs pipeline; no data paths, auth flows, or runtime state are affected.

The refactoring is a clean extraction of an existing pattern, symlink safety (unlink before re-link) is handled correctly in the shared helper, the rewrite function is a simple idempotent string replace with a fast-path guard, and four targeted tests cover the key invariants. No logic regressions were found.

No files require special attention.

Important Files Changed

Filename Overview
packages/reflex-site-shared/src/reflex_site_shared/integrations.py Refactors _integrations_logos_url into a shared _integrations_images_url(subdir) helper, adds _integrations_doc_images_url and rewrite_integration_doc_images_in_source to serve screenshots locally; symlink safety (unlink before re-link) is handled correctly.
docs/app/tests/test_integrations.py New test module covers URL rewriting, no-op on non-matching sources, local image existence, and malformed [!alt](url) link syntax; autouse fixture correctly guards against symlink side effects.
docs/app/reflex_docs/docgen_pipeline.py Adds a single rewrite_integration_doc_images_in_source call before the existing FAQ extraction step; ordering is correct and non-intrusive.
.github/workflows/docs_tests.yml Adds packages/reflex-site-shared/** and packages/integrations-docs/** to the workflow trigger paths so doc tests run when these packages change.
packages/integrations-docs/src/integrations_docs/docs/roboflow.md Fixes [!Roboflow](url) typo to correct ![Roboflow](url) image syntax; the pipeline rewrite will serve it locally.
packages/integrations-docs/src/integrations_docs/docs/hubspot.md Removes the malformed [!HubSpot](url) reference since hubspot.webp does not exist locally; confirmed intentional per author.

Reviews (4): Last reviewed commit: "add tests here" | Re-trigger Greptile

Comment thread tests/units/reflex_site_shared/test_integrations.py Outdated
Comment thread packages/integrations-docs/src/integrations_docs/docs/hubspot.md
@codspeed-hq

codspeed-hq Bot commented Jun 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 26 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing carlos/self-serve-integrations-docs-images (5c8edef) with main (019bf0c)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@carlosabadia carlosabadia marked this pull request as draft June 19, 2026 15:06
@carlosabadia carlosabadia marked this pull request as ready for review June 19, 2026 15:38
@Alek99 Alek99 merged commit 1bb863c into main Jun 24, 2026
107 checks passed
@Alek99 Alek99 deleted the carlos/self-serve-integrations-docs-images branch June 24, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog For doc/internal changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants