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

deploy(playwright): work around externally-enforced HTTPS #1899

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

dscho
Copy link
Member

@dscho dscho commented Oct 7, 2024

Changes

Runs the Playwright tests using the https:// URL, always, even if http:// would be possible.

Context

It is possible to enforce HTTPS on GitHub Pages, via https://docs.github.com/en/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https#enforcing-https-for-your-github-pages-site

Without this flag enabled, it is still possible to access the site via http:// URLs, otherwise such URLs will automatically redirect to https:// URLs.

However, it is also possible to enforce HTTPS e.g. by using a custom domain and putting Cloudflare in front of GitHub Pages.

The Playwright tests, which are designed to catch undesired redirects that may, say, drop the /git-scm.com/ part of the URLs in forks by mistake, are currently not expecting this.

Since GitHub Pages supports HTTPS in all cases, and there are no options anywhere to enforce HTTP instead of HTTPS, let's just test with the https:// URL even if no enforcement was configured.

This supersedes #1898.

It is possible to enforce HTTPS on GitHub Pages, via
https://docs.github.com/en/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https#enforcing-https-for-your-github-pages-site

Without this flag enabled, it is still possible to access the site via
http:// URLs, otherwise such URLs will automatically redirect to
https:// URLs.

However, it is also possible to enforce HTTPS e.g. by using a custom
domain and putting Cloudflare in front of GitHub Pages.

The Playwright tests, which are designed to catch undesired redirects
that may, say, drop the `/git-scm.com/` part of the URLs in forks by
mistake, are currently not expecting this.

Since GitHub Pages supports HTTPS in all cases, and there are no options
anywhere to enforce HTTP instead of HTTPS, let's just test with the
https:// URL even if no enforcement was configured.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copy link
Member

@ttaylorr ttaylorr left a comment

Choose a reason for hiding this comment

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

This looks great, thanks!

@ttaylorr ttaylorr merged commit b99865e into git:gh-pages Oct 7, 2024
1 check passed
@dscho dscho deleted the github-workflows branch October 7, 2024 15:11
@dscho
Copy link
Member Author

dscho commented Oct 7, 2024

Unfortunately, this broke regular deployments (because the certificate is apparently unliked):

2024-10-07T15:10:18.7803921Z 1) [chrome] › git-scm.spec.js:25:1 › generator is Hugo ───────────────────────────────────────────
2024-10-07T15:10:18.7804731Z
2024-10-07T15:10:18.7823346Z Error: page.goto: net::ERR_CERT_COMMON_NAME_INVALID at https://git-scm.com/

I'll fix it.

@dscho
Copy link
Member Author

dscho commented Oct 7, 2024

I'll fix it.

d4f88c1 is the fix (and the commit message contains a bit of context to understand why http://git-scm.com/ (and that URL only) needs to be special-cased.

@dscho
Copy link
Member Author

dscho commented Oct 7, 2024

And 0340ff6 is the fix for the fix ;-) The deployment worked now.

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