Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Doc preview updates not showing in edge #4059

Closed
Tracked by #4064
kcoriordan opened this issue Apr 15, 2022 · 2 comments · Fixed by #4319
Closed
Tracked by #4064

Doc preview updates not showing in edge #4059

kcoriordan opened this issue Apr 15, 2022 · 2 comments · Fixed by #4319
Assignees
Labels
kind/bug A bug in an existing capability
Milestone

Comments

@kcoriordan
Copy link
Contributor

When I create a PR with doc edits, I can’t see edits to existing files in edge preview and new file shows in toc, but gives a link error.
ref: ##4058

Bug Report

Expected Behavior

I expect to see updates to existing file and new file

Steps to Reproduce the Bug

  • I create a PR, edit an existing file and add another new file Doc updates for unmanaged cluster #4058
  • I click on the netlify preview link in the PR, select the Documentation tab and change the url from docs/v0.11/ to docs/edge
  • updates to existing file not showing, new file showing in toc, but link broken

Screenshots or additional information and context

Environment Details

  • Build version (tanzu version):
  • Deployment (Managed/Unmanaged cluster):
  • Infrastructure Provider (Docker/AWS/Azure/vSphere):
  • Operating System (client):

Diagnostics and log bundle

@kcoriordan kcoriordan added kind/bug A bug in an existing capability triage/needs-triage Needs triage by TCE maintainers labels Apr 15, 2022
@stmcginnis stmcginnis removed the triage/needs-triage Needs triage by TCE maintainers label Apr 15, 2022
@stmcginnis stmcginnis added this to the v0.13.0 milestone Apr 15, 2022
@jpmcb jpmcb mentioned this issue Apr 15, 2022
7 tasks
@jonasrosland
Copy link
Contributor

@a-mccarthy will take a look at this!

@a-mccarthy
Copy link
Contributor

@jonasrosland from my digging today, it looks like there are some issues with how the folders are set up. i'm basing this off how we have this set up in Harbor, https://github.com/goharbor/website/, which hopefully isn't too different for what you are going for here.

It looks like the main problem is that load-docs.sh isn't accounting for local changes when it pulls docs in from the branches.

Hugo builds the site based on whats in the /content folder and it looks like the load-docs.sh correctly pulls down all the files from the repo and puts it into versioned folders in the /content/docs folder. But load-docs.sh doesn't move the local changes into a place were they can be seeing in a local build or PR preview.

Screen Shot 2022-04-27 at 3 30 26 PM

^ after running make prepare, local changes in architecture.md are there, but not in a version folder so they wont show up.

In Harbor, we get around this by keeping the docs in a separate folder other than the /content folder. So we have a separate /docs folder which holds the docs, and when we build the site using load-docs.sh we pull content from the versions release branches from the branch's /docs folder and copy it into the local /content/docs/v{release-branch} folder.

We also use a folder link for our edge version of the docs. The /edge version should be the place where the changes you are trying to make show up in your local and PR preview (at least this in true on Harbor, so i assume its what you are going for here). To do this, we link the docs in our /docs folder to the content/docs/edge folder.

Screen Shot 2022-04-27 at 3 37 56 PM

^ So when you make a change in /docs, its populated to the /content/docs/edge folder, hugo detects the change in /edge, and rebuilds the site to show the new changes.

The /main folder isn't really needed. it gets created based on when is in the main branch, but if your PR merges then whatever you have in edge, will be become whats in the main branch. So having it is a bit redundant.

Notes:

  • We keep non-versioned docs content still in the /content folder. So things like the community page, which doesnt need to be versioned is still there.
  • We also gitignore things in the content/docs folder. bc the files we care about are in the /docs folder.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in an existing capability
Projects
None yet
4 participants