Skip to content

c.com Link checker fix - #2846

Open
petesfrench wants to merge 10 commits into
mainfrom
link-checker-fix
Open

c.com Link checker fix#2846
petesfrench wants to merge 10 commits into
mainfrom
link-checker-fix

Conversation

@petesfrench

@petesfrench petesfrench commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Done

  • fix failing links
  • update link checker to retry failed links after the initial run with a 60s delay. This is to help with fickle links that can be temporarily 404
  • break out config and custom script in the separate file for easier local testing

QA

  • Check the updated links work by running it locally with ./scripts/check-links.sh

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-38126

Copilot AI review requested due to automatic review settings August 6, 2026 14:11
@webteam-app

Copy link
Copy Markdown

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.14%. Comparing base (f92e270) to head (3d50a15).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2846   +/-   ##
=======================================
  Coverage   74.14%   74.14%           
=======================================
  Files          19       19           
  Lines        2352     2352           
=======================================
  Hits         1744     1744           
  Misses        608      608           
Flag Coverage Δ
python 74.14% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Updates canonical.com’s link-checking and sitemap configuration to address failing links and make the live link-check workflow more resilient to transient failures.

Changes:

  • Allow assets.ubuntu.com as a CSP frame-src to unblock embedded content where needed.
  • Fix a broken sitemap index entry for Juju 12-factor v1 by pointing to the correct sitemap path.
  • Enhance the live link-check GitHub Action to capture failures, wait 60 seconds, and retry failed URLs.

Reviewed changes

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

File Description
webapp/handlers.py Expands CSP frame-src to include assets.ubuntu.com for iframe/embed compatibility.
templates/sitemap-index.xml Updates a Juju 12-factor v1 sitemap URL to resolve a failing/broken sitemap reference.
.github/workflows/live-links.yaml Adds a two-pass linkchecker run with a 60s delay and retry for previously failed URLs.

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

Comment thread .github/workflows/live-links.yaml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mtruj013
mtruj013 force-pushed the link-checker-fix branch 2 times, most recently from c0f3ba3 to d975ea6 Compare August 13, 2026 20:43

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 no new comments.

Comment on lines +14 to +15
- name: Checkout
uses: actions/checkout@v4

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.

Valid comment

@muhammad-ali-pk

Copy link
Copy Markdown
Contributor

@petesfrench Thank you for this piece of work. A few comments

  1. Here's the terminal output after a run. Notice how some of the urls are marked file and include the absolute path.
That's it. 19 links in 21 URLs checked. 4 warnings found. 19 errors found.
Stopped checking at 2026-08-25 12:51:12+005 (40 seconds)
Links still broken after 3 attempts:
file:///lxd/docs
file:///microcloud/docs/default/tutorial/single-member/
file:///microcloud/docs/default/
file:///home/engr-ali/canonical/projects/canonical.com/images/layers-2x.png
file:///home/engr-ali/canonical/projects/canonical.com/../img/flags.webp
file:///home/engr-ali/canonical/projects/canonical.com/../img/globe.webp
file:///home/engr-ali/canonical/projects/canonical.com/../img/flags@2x.webp
file:///home/engr-ali/canonical/projects/canonical.com/../img/globe@2x.webp
file:///data/kafka/docs/4
file:///microcloud/docs/
file:///home/engr-ali/canonical/projects/canonical.com/images/layers.png
file:///home/engr-ali/canonical/projects/canonical.com/images/marker-icon.png
https://www.elektrobit.com/products/ecu/eb-corbos/linux-built-on-ubuntu/free?utm_source=Canonical
https://en.digitalchina.com
https://canonical-charmed-spark.readthedocs-hosted.com/main/
https://canonical-charmed-spark.readthedocs-hosted.com/main
https://repo1.dso.mil/dsop/canonical/ubuntu/pro-cis-stig-20.04/ubuntu-pro-cis-stig-20.04
https://software.af.mil/dsop/services/
http://www.flextronics.com/
  1. Valid persist-credentials comment from copilot

  2. One of the changed sitemaps url is failing

@muhammad-ali-pk muhammad-ali-pk 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.

Left some comments from the code

</sitemap>
<sitemap>
<loc>https://canonical.com/juju/docs/12-factor/v1/doc-sitemap.xml</loc>
<loc>https://canonical.com/juju/docs/12-factor/v1/sitemap.xml</loc>

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.

This results in 404. The original one works as expected.

Comment on lines +14 to +15
- name: Checkout
uses: actions/checkout@v4

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.

Valid comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants