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

feat: version callouts #19452

Merged
merged 2 commits into from
Mar 7, 2024
Merged

feat: version callouts #19452

merged 2 commits into from
Mar 7, 2024

Conversation

dvdksn
Copy link
Collaborator

@dvdksn dvdksn commented Feb 20, 2024

Description

Adds an introduced shortcode for making version callouts

  • feat: add "introduced" shortcode
  • build: use introduced shortcode for env vars

Supports optional rendering of versions depending on a threshold set in site config.

Also throws a warning if callouts refer to versions below the threshold.

Related issues

@github-actions github-actions bot added area/build Relates to Dockerfiles or docker build command hugo Updates related to hugo labels Feb 20, 2024
Copy link

netlify bot commented Feb 20, 2024

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 51790c1
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/65d4b18d9027db00088e7521
😎 Deploy Preview https://deploy-preview-19452--docsdocker.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.

@@ -343,7 +343,7 @@ Setting `NO_COLOR` to anything turns off colorized output, as recommended by

### BUILDKIT_HOST

_Introduced in [Buildx v0.9.0](../release-notes.md#090)_
{{< introduced buildx 0.9.0 "../release-notes.md#090" >}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not rendered because 0.9.0 is below the threshold set in site.Params.min_version_thresholds.buildx

Also generates a warning: https://github.com/docker/docs/actions/runs/7974560715/job/21770734246?pr=19452#step:4:301

@dvdksn dvdksn requested review from thaJeztah and a team February 20, 2024 13:54
@dvdksn dvdksn marked this pull request as ready for review February 20, 2024 13:54
@dvdksn dvdksn requested a review from crazy-max as a code owner February 20, 2024 13:54
@@ -103,8 +103,14 @@ params:
example_alpine_version: "3.19"
example_node_version: "20"

min_api_threshold: 1.41

min_version_thresholds:
Copy link
Member

Choose a reason for hiding this comment

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

Is it n-2 based? (n being the latest stable)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah, these are arbitrary atm so we need to decide. n-2 could be a good default. It might depend what the threshold is depending on the component, e.g. for Desktop n-2 might be too aggressive.

hugo.yaml Outdated Show resolved Hide resolved
@thaJeztah
Copy link
Member

❤️ nice! will have to have a closer look to see how it all works, but ❤️ for working on this!

The introduced shortcode takes three arguments:

- component id (as defined in site.Params)
- version (should be semver except for engine api)
- link (optional) to e.g. release note

The component and version argument is compared against the min threshold
set in site config.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Copy link
Contributor

@aevesdocker aevesdocker left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Dreaming a bit here; I wonder if we can combine this in future with some front-end (javascript) code to provide a richer experience;

  • e.g., links from binaries to the docs to include a version query-parameter (e.g. https://docs.docker.com/reference/cli/docker/buildx/build/?version=buildx-v0.13)
  • based on that version, we can control how these callouts / annotations are presented; think along the lines of;
    • <new!>
    • <not supported>
  • perhaps search (Algolia / other) could provide a "what's new" overview dynamically, or otherwise we could have some generated view for versions (not sure how well that would scale 🤔)
  • but also the reverse; things that were introduced "x-versions before the version used" wouldn't need to be highlighted anymore (basically a more dynamic threshold)

@thaJeztah
Copy link
Member

This is really great!

Perhaps there's some enhancements to be made for styling; nit-picky me noticed that the indentation feels a bit odd, and that indentation before the > and between the > and the text is un-even, but those are definitely not a blocker!

Screenshot 2024-03-07 at 12 57 07

One thing I wondered is; if we'll be adding these to reference-docs pages, and if (not sure we do currently?) we use those sources also for generating man-pages; would these be problematic? I see they show up on GitHub (not a huge problem IMO), but for man-pages that could possibly be more problematic. Not sure if there's some syntax possible for them to be hidden (e.g. within html <!-- comments, or some "good'ol internet-explorer style conditional comment" ; https://en.wikipedia.org/wiki/Conditional_comment)

Screenshot 2024-03-07 at 13 01 43

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

oh! so make that an LGTM from my side, but maybe @crazy-max has thoughts on the "man-page" question

@dvdksn
Copy link
Collaborator Author

dvdksn commented Mar 7, 2024

@thaJeztah @crazy-max would it makes sense use something like flagset annotations to mark which release a given flag was introduced? e.g. https://pkg.go.dev/github.com/spf13/pflag#FlagSet.SetAnnotation

@dvdksn dvdksn merged commit 822d08b into docker:main Mar 7, 2024
9 checks passed
@dvdksn dvdksn deleted the version-callouts branch March 7, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to Dockerfiles or docker build command hugo Updates related to hugo status/review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants