Uh oh!
There was an error while loading. Please reload this page.
bpo-37860: re-add netlify.toml to set up deploy previews for docs - #92852
Conversation
This reverts commit fbaf2e6.
epicfaace
commented
May 16, 2022
Do we need a NEWS label for this? I was thinking we could skip news? |
hugovk
commented
May 16, 2022
Thanks for this! I added the Please could you do a deploy to a demo site first to check the command still works three years later? For example, Ubuntu Focal is now the default image, and the default Python is 3.8 (not 2.7) so may be able to skip https://github.com/netlify/build-image/blob/focal/included_software.md |
epicfaace
commented
May 16, 2022
@hugovk made some small fixes, it now deploys correctly. My branch is deployed at: https://steady-heliotrope-731cac.netlify.app/ |
hugovk
commented
May 16, 2022
Good work! Out of interest, how long does a single build/deploy take? |
epicfaace
commented
May 16, 2022
It took 4m16s. |
hugovk
commented
May 17, 2022
Thanks, so with 25,000 minutes per month, 4-5 minutes per build gives us 5,000-6,250 builds per month. That's significantly better than the ~170/month estimate 2 years ago: #15288 (comment). I see it's also possible to configure ignored builds, can we only build previews when there are changes in the |
This is already configured by default. The link above says "Depending on your Branches settings, any time there is a change in a linked repository, Netlify tries to determine whether there are changes in the site’s base directory by comparing the last known version of the files in that directory." The |
hugovk
commented
May 17, 2022
Great, then I think we're all set! @ewdurbin As a follow on to #15288 (comment) in 2019, we should now have 25k minutes per month (#82041 (comment)), and are ready to try this out again. Please could you hook up the Netlify account? I would suggest we only run it on If we have max 3 team members (#15288 (comment)), @Mariatta, you asked to be added in 2019 (#15288 (comment)), would you still like to? And to further increase the bus factor, who would like to be the 3rd? |
epicfaace
commented
May 17, 2022
I'm happy to be the third! If it's fine though I'm not a committer |
epicfaace
commented
May 17, 2022
Also, looks like we're no longer limited to 3 team members max: see https://www.netlify.com/legal/open-source-policy/:
|
Also, one more thing: I think to comply with the requirements mentioned in https://www.netlify.com/legal/open-source-policy/, we should add a Netlify badge / "This site is powered by Netlify" message on all deploy previews. I don't think we need to / should add it to the main docs, but we can add it on deploy previews only -- for example, we could set an environment variable that then renders the Netlify badge only on deploy previews. I'm happy to implement if we're good with that approach. What do you think @hugovk ? |
hugovk
commented
May 18, 2022
The env var approach sounds good to add it only to deploy previews. Perhaps the text link option, in the footer? And just on the homepage or all pages? |
Mariatta
commented
May 18, 2022
Thanks for your work @epicface. I think we need to display more prominently that the docs rendered is a "preview". So where-ever we put the netlify badge, we should add the "preview" info as well. Is that something we can do? As comparison, on the devguide (built with readthedocs), the preview is displayed at the top of the page: |
AA-Turner
commented
May 21, 2022
Adding a warning admonition to the top of the page seems a reasonable idea regardless, although the ephemeral nature of the previews (& non-canonical URL) should help to disambiguate d.p.o from the previews. @hugovk from the linked Netifly page, it seems only the "main page" is required - so A |
hugovk
commented
Jun 18, 2022
Hi again @epicfaace! Do you think you can make the above changes? Thanks! |
arhadthedev
commented
Jun 18, 2022
I think the popup warning that collapses into the bottom will be more noticeable. Here is an example from tc39/ecma262: |
epicfaace
commented
Jun 19, 2022
Yes, doing so! @arhadthedev I like that idea. relevant code here: https://github.com/tc39/ecma262/blob/267fdbdc716677bc9934906a498cf9bad4bfb70d/scripts/snapshot_warning.htmlhttps://github.com/tc39/ecma262/blob/267fdbdc716677bc9934906a498cf9bad4bfb70d/scripts/insert_snapshot_warning.js and https://github.com/tc39/ecma262/blob/267fdbdc716677bc9934906a498cf9bad4bfb70d/scripts/snapshot_warning.css |
All right, this PR should be ready now, @Mariatta and @hugovk . I just added a simple banner for now that displays on top of all pages: Sample deploy preview: https://62af84a185fcf70008d07339--steady-heliotrope-731cac.netlify.app/ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
hugovk
commented
Jun 19, 2022
epicfaace
commented
Jun 19, 2022
Note that this banner uses the same styling as the "This document is for an old version of Python that is no longer supported" banner. The top of this banner will also be hidden once we start showing this banner on versions of the docs that have a responsive mobile layout. This means that when 3.8 reaches EOL (as 3.8 is the first version of the docs with a responsive mobile layout), we'll have a similar problem in which the top of the banner "This document is for an old version of Python that is no longer supported." will be hidden. |
epicfaace
commented
Jun 19, 2022
hugovk
commented
Jun 19, 2022
Ah okay. So for the "no longer supported" it won't happen until 3.8 is EOL on 2024-10-14, but for the previews it will happen right away :) We could report this to (I guess) https://github.com/python/python-docs-theme and come up with a fix later? |
epicfaace
commented
Jun 19, 2022
@hugovk yes. It seems more involved to fix that issue so I've went ahead and reported it in python/python-docs-theme#95. |
hugovk
commented
Jul 27, 2022
@ewdurbin Hi! Please could you hook up the Netlify account again? See #92852 (comment) And please add @Mariatta to the team. Thank you! |
encukou
commented
Aug 22, 2022
@ewdurbin Will you be able to do this, or is something blocking you? |
hugovk
commented
Dec 6, 2022
Looks like we're all set now! Here's a recent docs PR build: And the corresponding preview: Thank you Ee for setting up Netlify and Ashwin for this and the earlier PRs! 👏 |
encukou
commented
Dec 6, 2022
The banner is missing, though. |
hugovk
commented
Dec 6, 2022
You're right, with an up-to-date branch it works! |
Mariatta
commented
Dec 6, 2022
This is amazing! Thank you everyone for pushing through and thanks @epicfaace for this PR. This is a great help to all contributors here. |
epicfaace
commented
Dec 6, 2022
Amazing, thank you all for reviewing and getting this in! |







Fixes#82041 by setting up Netlify to set up deploy previews for docs.
This PR re-does #15288. Reverts #30272 (where we had originally removed netlify.toml due to build limits). As per #82041 (comment), the build limits are now large enough that they should be fine to use for cpython.