Skip to content

chore: filtering patches from docs deployment script#3779

Merged
TomAFrench merged 8 commits intomasterfrom
zpedro/filtering_patches
Dec 15, 2023
Merged

chore: filtering patches from docs deployment script#3779
TomAFrench merged 8 commits intomasterfrom
zpedro/filtering_patches

Conversation

@signorecello
Copy link
Copy Markdown
Contributor

Description

This change makes the script that runs before yarn build filter down the patches to the latest patch of every major.

Problem*

This script used to remove:

  • Prereleases
  • Nightlies (which are prereleases)
  • "Aztec" versions

However, this would mean that every patch, as long as it was stable, would have its own docs deployed. This would lead to docs having three patch versions, which shouldn't even differ (they're patches, no breaking changes), like 0.19.1, 0.19.2, etc

Summary*

This change simplifies the script by removing some computation that was there just for debugging reasons. It also stops assuming all "aztec" versions are prereleases. And finally, it filters down only for the latest patch version.

Additional Context

Another way of doing it (which is how we're doing it now) is to just make all non-latest patch as prereleases, which is kinda annoying. With this change, it shouldn't matter.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 12, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 12, 2023

@Savio-Sou Savio-Sou linked an issue Dec 12, 2023 that may be closed by this pull request
@Savio-Sou
Copy link
Copy Markdown
Collaborator

It doesn't show our third-recent stable release v0.10.5 🤔
image

@TomAFrench
Copy link
Copy Markdown
Member

It doesn't show our third-recent stable release v0.10.5 🤔

Likely a pagination issue on the github api due to the nightly releases.

@signorecello
Copy link
Copy Markdown
Contributor Author

It only shows three versions, that's dev + 2... I think this is good this way, I believe there's no reason to support anything older than v17

@socket-security
Copy link
Copy Markdown

socket-security bot commented Dec 13, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

@TomAFrench
Copy link
Copy Markdown
Member

It only shows three versions, that's dev + 2... I think this is good this way, I believe there's no reason to support anything older than v17

The issue is that nightlies are pushing all of the stable releases out of the api response. As time goes on then we'll gradually get fewer and fewer versions showing up in the dropdown unless we release new breaking versions fast enough to ensure that we have 3 on the first page of the response from github.

The way filtering is set up currently does "3 + dev" afaik as we're filtering the api response whereas dev gets added later by docusaurus. If you drop the limit down to 2 I expect that we'll get the same dropdown.

@Savio-Sou
Copy link
Copy Markdown
Collaborator

+1 concern isn't on v0.10.5 specifically, but to make sure frequent nightlies / pre-releases would not affect versions available on docs.

@signorecello
Copy link
Copy Markdown
Contributor Author

signorecello commented Dec 13, 2023

I'm sure it is getting pretty much all the versions, it does pagination but we get versions all the way back to 0.7ish iirc.

It's the filtering that makes only the last 2 releases + dev show up 😊 but I can have a look tomorrow just to be sure before merging

@TomAFrench
Copy link
Copy Markdown
Member

I only see releases back to 0.19.0 although this is just when opening up the endpoint in the browser so maybe if you're using an API key then you get more.

@signorecello
Copy link
Copy Markdown
Contributor Author

So yeah seems like we're getting 100 versions per page, which is apparently not enough for 0.10.5. Here are all the versions pulled from the axios call:

Screenshot 2023-12-14 at 14 01 42

And this is after the first .filter that removes prereleases, nightlies and stables:

Screenshot 2023-12-14 at 14 05 12

Had a quick look and indeed, versions like 0.15.0 are not stable. We also remove 0.16.0 manually for some reason I currently do not recall. That leaves us with these two.

I'll make the change to pull more pages to filter, but I still believe it wouldn't be important to document anything below 0.17. Wdyt @Savio-Sou ?

@TomAFrench
Copy link
Copy Markdown
Member

We also remove 0.16.0 manually for some reason I currently do not recall.

It had an unsafe merkle tree impl in the stdlib.

I still believe it wouldn't be important to document anything below 0.17. Wdyt @Savio-Sou ?

It's not so much that we need to go back to 0.10.5, the trouble is that going forwards in the best case scenario the longest time that we show docs for a particular minor version is around 3 months (before it's pushed off of the first page of the api response). I think that 3 months is a pretty short amount of time to display docs for a particular version.

@signorecello
Copy link
Copy Markdown
Contributor Author

signorecello commented Dec 14, 2023

Makes sense 👍 Just updated the script to deal with 3 pages, which is enough to get ALL the versions since the beginning of time 💥

It will document v0.10.5, because why not It's not documenting v0.10.5 because I removed that version artifacts in #3778, so I'm removing 0.10.5 instead of creating them back from that tag

gtg @TomAFrench @Savio-Sou

Copy link
Copy Markdown
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

Let's delete versions.json. Happy to merge once that's done.

@signorecello signorecello force-pushed the zpedro/filtering_patches branch from 2b2343c to 980ec38 Compare December 14, 2023 23:21
@TomAFrench TomAFrench added this pull request to the merge queue Dec 15, 2023
Merged via the queue into master with commit d617ea4 Dec 15, 2023
@TomAFrench TomAFrench deleted the zpedro/filtering_patches branch December 15, 2023 00:22
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs' setStable.js script to filter away patch versions

3 participants