GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Docs: Fix build preview banner by hugovk · Pull Request #104082 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented May 2, 2023

Copy link
Copy Markdown
Member

There should be a banner at the top of PR build previews for docs. Here's it working on this branch as a PR on my fork:

image

But for some reason it's missing for this upstream:

TODO

The code to control this:

cpython/Doc/conf.py

Lines 117 to 124 in f0ad456

# Deployment preview information
# (See .readthedocs.yml and https://docs.readthedocs.io/en/stable/reference/environment-variables.html)
repository_url = os.getenv("READTHEDOCS_GIT_CLONE_URL")
html_context = {
"is_deployment_preview": os.getenv("READTHEDOCS_VERSION_TYPE") == "external",
"repository_url": repository_url.removesuffix(".git") if repository_url else None,
"pr_id": os.getenv("READTHEDOCS_VERSION")
}

Let's start with a draft PR to debug the env vars.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
TEMP print all env vars
355ddc2
@bedevere-bot bedevere-bot added the awaiting core review label May 2, 2023
@hugovk hugovk added skip issue skip news labels May 2, 2023
@hugovk

hugovk commented May 2, 2023

Copy link
Copy Markdown
Member Author

It's working here too:

image

https://cpython-previews--104082.org.readthedocs.build/en/104082/


Looking at another PR build that is missing the banner:

  • https://cpython-previews--104029.org.readthedocs.build/en/104029/
  • https://readthedocs.org/projects/cpython-previews/builds/20353556/
  • GH-103963: Make dis display names of args for intrinsics opcodes #104029

The RtD build page says:

Configure your documentation builds! Adding a .readthedocs.yaml file to your project is the recommended way to configure your documentation builds. You can declare dependencies, set up submodules, and many other great features.

And looking at the PR, it's from before the #103843 was merged that updated conf.py, so I think we're good here.

One thing to do though, is backport #103843 to at least 3.11 so we get banners on backport builds too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented May 2, 2023

Copy link
Copy Markdown
Member Author

Backport PR: #104083

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk closed this May 2, 2023
@hugovk
hugovk deleted the docs-banner branch May 24, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner will be requested when the pull request is marked ready for review AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting core review skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@hugovk @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.