Skip to content

Resolve product docs from the caller's checkout - #5473

Open
dimitrieh wants to merge 3 commits into
mainfrom
docs-source-resolution
Open

Resolve product docs from the caller's checkout#5473
dimitrieh wants to merge 3 commits into
mainfrom
docs-source-resolution

Conversation

@dimitrieh

@dimitrieh dimitrieh commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Description

Docs resolution moves into nuxt/lib/docs-sync.mjs, which looks for the docs in this order: FLOWFUSE_DOCS_LOCAL, a sibling flowfuse checkout, the snapshot committed on live, then a download from main.

The sibling rule is the one #5177 removed. It means a local checkout is picked up with no setup, and the flowfuse doc check can build a docs PR against its own changes instead of against main.

Three smaller fixes ride along: clones keep full history, so each page gets its own "last updated" date instead of every page sharing one; npm run docs is back; and build.yml commits the docs onto live, so production deploys stop downloading them at deploy time.

This does not change whether docs publish. That is FlowFuse/flowfuse#8029.

Review steps are in the comment below.

Related Issue(s)

Part of #5432

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
  • For blog PRs, an Art Request has been created (instructions)

The docs source is now resolved in a documented order: FLOWFUSE_DOCS_LOCAL,
a sibling flowfuse checkout, the snapshot committed to live, then a clone.
Sibling detection is the convention CI depends on, so a docs PR is validated
against its own changes rather than whatever main happens to be.

Clone with full history so each page is dated from its own last commit, and
have the build workflow commit the resolved docs onto live so production
deploys use a pinned snapshot instead of cloning at deploy time.
@dimitrieh

Copy link
Copy Markdown
Contributor Author

comment with context at #5432 (comment)

A second [build.environment] table is a TOML redefinition, which Netlify
could not parse.
@dimitrieh
dimitrieh marked this pull request as ready for review August 3, 2026 09:46
@hardillb

hardillb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

You need to get somebody who works on the WebSite to review this

@dimitrieh

Copy link
Copy Markdown
Contributor Author

FlowFuse/flowfuse#8024 is intended to be merged after this one

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit d2ad6fb
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a70743b14a578000877ce15
😎 Deploy Preview https://deploy-preview-5473--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 66 (🔴 down 2 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@dimitrieh

Copy link
Copy Markdown
Contributor Author

Review steps. Each row is what the change gives you, and how to confirm it.

# What you get How to confirm
1 Your own docs checkout is used automatically, no setup. This is also what lets the flowfuse docs check test a PR's own docs instead of main. docs-sync.mjs#L33: sibling checkout is listed above downloading.
2 Every docs page shows the date it was actually last edited. Today all of them show one shared date, because the download only fetched the newest commit. docs-sync.mjs#L75: clone with full history, no depth limit.
3 A typo in FLOWFUSE_DOCS_LOCAL stops the build, instead of quietly publishing main's docs while you think you're previewing your own. docs-sync.mjs#L39: throws on a path that doesn't exist.
4 Dates are right on a real build. https://deploy-preview-5473--flowforge-website.netlify.app/docs/ , click 3 pages, expect 3 different dates. Production shows 2026-07-31 15:57:41 on all of them.
5 Local dev picks up your checkout. flowfuse next to website, no env var, npm run dev. Log says Using sibling docs from .... Script is scripts/sync_docs.mjs, no dependencies, since CI runs it before npm install.
6 The docs that shipped are pinned, so a redeploy gives back the same docs and a deploy doesn't break if GitHub is down. Cost is generated files, images included, living in git on live. build.yml#L52 commits them onto live, same as the bot used to commit src/docs. Your call whether that tradeoff is fine.
7 Docs match reality. README.md#L98 and .claude/CLAUDE.md describe the four sources and dev:nuxt, which was documented before but never existed.

Everything in the diff:

test_website and the Netlify deploy are green already.

Wdyt?

repository: 'FlowFuse/flowfuse'
ref: main
path: 'flowfuse'
# Full history: each docs page is dated from its own last commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hold on, we shouldn't need this. We're not doing a shallow clone?

ref: main
path: 'flowfuse'
# Full history: each docs page is dated from its own last commit.
fetch-depth: 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please do a partial clone, not a shallow one.

cd ./website
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add nuxt/content/docs nuxt/public/docs -A -f

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, please don't. Why not clone on build time? You're reverting to do everything that wasn't great about this previously

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.

3 participants