Skip to content

feat(w3c/headers): validate header links - #5143

Draft
marcoscaceres wants to merge 1 commit into
mainfrom
feat/validate-header-links
Draft

feat(w3c/headers): validate header links#5143
marcoscaceres wants to merge 1 commit into
mainfrom
feat/validate-header-links

Conversation

@marcoscaceres

@marcoscaceres marcoscaceres commented Mar 28, 2026

Copy link
Copy Markdown
Contributor
  • Validates that edDraftURI, historyURI, implementationReportURI, and other header links are well-formed URLs pointing to the expected hosts
  • Rejects obviously wrong values early with clear error messages rather than silently producing broken spec headers

Written with AI: this change was generated by Claude. Per AI_POLICY.md.

@marcoscaceres
marcoscaceres force-pushed the feat/validate-header-links branch 3 times, most recently from 5982fb1 to 721ec7b Compare March 28, 2026 12:35
@marcoscaceres
marcoscaceres requested a review from Copilot March 28, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances W3C header handling by adding validation/verification around key header links (notably latestVersion and historyURI) and extends the test suite to cover the new behaviors, aiming to surface broken header links earlier via warnings/errors.

Changes:

  • Add a HEAD check for derived latestVersion URLs and emit a w3c/headers warning when the URL can’t be reached.
  • Adjust historyURI derivation to support explicit suppression (null) and refactor URL probing into resourceExists().
  • Update/extend w3c/headers tests (warnings filter, status loops, new warning expectation).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
tests/spec/w3c/headers-spec.js Adds warnings assertions and refactors status-based tests for header link behavior.
src/w3c/templates/cgbg-headers.js Tweaks when the “Latest published version” row is rendered for CG/BG headers.
src/w3c/headers.js Adds URL existence probing for latestVersion, refactors history derivation, and introduces resourceExists().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/w3c/headers.js
Comment thread src/w3c/headers.js Outdated
Comment thread src/w3c/headers.js Outdated
Comment thread tests/spec/w3c/headers-spec.js
Comment thread tests/spec/w3c/headers-spec.js
Comment thread src/w3c/headers.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/w3c/templates/cgbg-headers.js:47

  • conf.latestVersion !== null (and the nested conf.latestVersion !== "") will treat undefined as “present” and render an <a> whose href/text become undefined. The W3C headers template avoids this by checking property existence ("latestVersion" in conf) and then treating falsy values as “none”. Consider aligning the CGBG template logic (e.g., guard on property existence or use a nullish check) so missing/undefined latestVersion can’t produce a broken link.
      ${conf.latestVersion !== null
        ? html`<dt>${l10n.latest_published_version}</dt>
            <dd>
              ${conf.latestVersion !== ""
                ? html`<a href="${conf.latestVersion}"
                    >${conf.latestVersion}</a
                  >`
                : "none"}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/spec/w3c/headers-spec.js
Comment thread src/w3c/templates/cgbg-headers.js Outdated
@marcoscaceres
marcoscaceres force-pushed the feat/validate-header-links branch from 8ea26c4 to a7a0832 Compare April 13, 2026 01:58
Comment thread src/w3c/templates/cgbg-headers.js Outdated
@marcoscaceres

Copy link
Copy Markdown
Contributor Author

@copilot please rebase

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot please rebase

I synced the branch updates and pushed the latest follow-up in c9109eb6. A full base-branch rebase here would require rewriting branch history, which this environment can’t safely push.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • addons.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • ads.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • aomedia.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • aomediacodec.github.io
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • api.specref.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • aus5.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • caniuse.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • cdn.jsdelivr.net
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • ciscobinary.openh264.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • cloudflare-dns.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • company
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • creativecommons.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • detectportal.firefox.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • dom.spec.whatwg.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • example.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • example.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • fetch.spec.whatwg.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • firefox.settings.services.mozilla.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • foo.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • html.spec.whatwg.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • hyperlink
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • ipv4only.arpa
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • jasmine.github.io
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • lists.w3.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • location.services.mozilla.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • no-links-bar.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • no-links-foo.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • normandy.cdn.mozilla.net
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • orcid.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • org.github.io
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • prod
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • push.services.mozilla.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • respec.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • safebrowsing.googleapis.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • services.addons.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • shiny
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • some.places
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • somewhere.else
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • speced.github.io
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • support.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • this
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • tools.geostandaarden.nl
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • twitter.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • w3c.github.io
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • wpt.fyi
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.mozilla.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.reddit.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.rfc-editor.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.w3.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.wikipedia.org
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)
  • www.youtube.com
    • Triggering command: /usr/lib/firefox/firefox /usr/lib/firefox/firefox http://localhost:9876/?id=85508135 -profile /tmp/karma-85508135 -no-remote -wait-for-browser -headless --start-debugger-server 6000 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@marcoscaceres
marcoscaceres marked this pull request as draft April 19, 2026 12:43
@marcoscaceres

Copy link
Copy Markdown
Contributor Author

@copilot Rebase?

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

@copilot Rebase?

I rebased this branch onto origin/main locally; current HEAD is b292fee3. I couldn’t publish the rebased history from this environment because the provided push flow auto-rebases against origin/feat/validate-header-links and stops on conflicts.

@marcoscaceres

Copy link
Copy Markdown
Contributor Author

@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed?

Copilot AI commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed?

Confirmed: all previously raised review feedback is now addressed in the branch. I re-verified the key points (shortName hint casing, historyURI nulling for non-standards-track, FPWD fetch short-circuit, and CG/BG draft/latestVersion handling including strict nullish checks). The final follow-up commit is c07b13f.

No UI changes were made, so there’s no screenshot to attach.

@marcoscaceres marcoscaceres added the AI Contains AI-generated logic; see AI_POLICY.md label Aug 5, 2026
@marcoscaceres

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts and merged origin/main into this branch in commit aa3a2ce4.

@marcoscaceres
marcoscaceres force-pushed the feat/validate-header-links branch from aa3a2ce to 02f8813 Compare August 13, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Contains AI-generated logic; see AI_POLICY.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants