Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

historic docs v2 #1770

Merged
merged 1 commit into from
Sep 6, 2024
Merged

historic docs v2 #1770

merged 1 commit into from
Sep 6, 2024

Conversation

sh-rp
Copy link
Collaborator

@sh-rp sh-rp commented Aug 29, 2024

Description

PR for adding historic docs without checking these historic docs into the repo. Mechanism:

  • Discover all tags and find all the most recent minor versions (above a certain configurable threshold)
  • Check out each tag in a separate folder and build the docs at that point in time and copy them into the main project
  • Current repo version will be the devel version, so we should only deploy docs from devel.
  • Will deploy the master branch as the version for the current highest release instead of the tag
  • Prevents indexing by google via header tags
  • Ensure algolia does not index historic versions (via algolia console, you can explicitely say to respect noindex header tags)

TODO after merging:

  • Switch of devel deployment on netfliy, we might need to update the paths in the website that point the /docs/devel path to that deployment.

@sh-rp sh-rp marked this pull request as ready for review August 29, 2024 15:24
Copy link

netlify bot commented Aug 29, 2024

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit cb9c44c
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/66dac4131b08ab00086f363c
😎 Deploy Preview https://deploy-preview-1770--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@sh-rp sh-rp added the documentation Improvements or additions to documentation label Sep 2, 2024
@rudolfix rudolfix added the sprint Marks group of tasks with core team focus at this moment label Sep 2, 2024
Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

Cool! Let's merge it and then we can enable it on netlify even before 1.0 release. Both master and devel branch changes should trigger the same build (as we do both devel and master + tags in each)

const selectedVersions = ["master"];
let lastVersion = versions[0];
for (let ver of versions) {
if (semver.minor(ver) != semver.minor(lastVersion) || semver.major(ver) != semver.major(lastVersion)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not want to nitpick but this works correctly for 0.x.x version. For 1.x.x we want to keep only
1,x,x,
2,x,x

tldr;> check only the difference on major

VERSIONED_SIDEBARS_FOLDER = "versioned_sidebars"

// no doc versions below this version will be deployed
MINIMUM_SEMVER_VERSION = "0.4.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd drop 0.4


// go through the versions and find all newest versions of minor versions
const selectedVersions = ["master"];
let lastVersion = versions[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add 0.5.4 (latest) to the top tag?

console.log("Checking branch")
const branch = proc.execSync(`cd ${REPO_DIR} && git rev-parse --abbrev-ref HEAD`).toString().trim()

if (branch != "devel") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I do not understand this part. We should not use the REPO_DIR to build the current (development) docs. What IMO we should do:

  • what we call devel we should build using the already checked out repo including uncommitted local changes. this will also allow to build previews for PRs (or this already works like that? because we still build local docs)
  • the highest tag found should not be built from this tag but from master. this will allow to update docs in master branch and get then online without increasing the tag

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is how it works, this line only is a sanity check wether the repo could be checked out properly. the devel branch of the checked out repo never actually is built, check further down, it only ever builds stuff collected in the versions.

@sh-rp sh-rp force-pushed the feat/1712-historic-docs-v2 branch from 2c49693 to 48fa9d4 Compare September 6, 2024 08:55
@sh-rp sh-rp force-pushed the feat/1712-historic-docs-v2 branch from 48fa9d4 to cb9c44c Compare September 6, 2024 08:57
@sh-rp sh-rp merged commit 8995f70 into devel Sep 6, 2024
47 checks passed
@sh-rp sh-rp deleted the feat/1712-historic-docs-v2 branch September 6, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation sprint Marks group of tasks with core team focus at this moment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants