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: add fetch_multiversion_configuration #1303

Merged

Conversation

dgarcia360
Copy link
Collaborator

@dgarcia360 dgarcia360 commented Nov 29, 2024

Related issue: scylladb/scylladb-docs-homepage#30

Adds a helper to get multiversion data from a remote URL.

To test the changes, we'll build multiple versions using data from the following URL:
https://gist.github.com/dgarcia360/d18edbfac5e2fc1443ba0819840e2fd1

{
    "tags": [],
    "branches": ["master", "branch-1.8"],
    "latest": "branch-1.8",
    "unstable": ["master"],
    "deprecated": []
}

How to test

  1. Checkout master and branch-1.8 branches:
git checkout branch-1.8
git checkout master
  1. Checkout this PR:
 gh pr checkout 1303
  1. Edit docs/conf.pyglobal variables section as follows:
VERSIONS_URL = "https://gist.githubusercontent.com/dgarcia360/d18edbfac5e2fc1443ba0819840e2fd1/raw/dcf460800849f5bc623982532edeb70499f0e3a9/gistfile1.json"
MULTIVERSION_CONFIG = fetch_multiversion_configuration(VERSIONS_URL)
# Builds documentation for the following tags and branches.
TAGS = MULTIVERSION_CONFIG.get("tags", [])
BRANCHES = MULTIVERSION_CONFIG.get("branches", [])
# Sets the latest version.
LATEST_VERSION = MULTIVERSION_CONFIG.get("latest", "master")
# Set which versions are not released yet.
UNSTABLE_VERSIONS = MULTIVERSION_CONFIG.get("unstable", [])
# Set which versions are deprecated
DEPRECATED_VERSIONS = MULTIVERSION_CONFIG.get("deprecated", [])
# Sets custom build.
FLAGS = ["theme"]

This change will read configuration versions from an external file.

  1. In the same conf.py, set smv_remote_whitelist to None:
smv_remote_whitelist = None

This ensures the multiversion build considers only the local branches cloned in Step 1.

  1. In the terminal, run the multiversion preview:

    make multiversionpreview
    
  2. Verify docs build with multiversion enabled. The branch-1.8 version should be listed as available in the documentation.

Next steps

Release a new version of the theme and configure open-source and enterprise repo to read from remote files for multiversion config.

@dgarcia360 dgarcia360 marked this pull request as ready for review November 29, 2024 09:58
@annastuchlik
Copy link
Collaborator

Run with
from sphinx_scylladb_theme.utils import multiversion_regex_builder, fetch_multiversion_configuration

Copy link
Collaborator

@annastuchlik annastuchlik left a comment

Choose a reason for hiding this comment

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

LGTM

@dgarcia360 dgarcia360 merged commit 2027062 into scylladb:master Dec 6, 2024
4 checks passed
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.

2 participants