From e0d637e73562ad9fb719a7bf5530a7e0c9350718 Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 12 Aug 2026 08:27:24 +0000 Subject: [PATCH 1/3] Initial commit with task details Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/54 --- .gitkeep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitkeep diff --git a/.gitkeep b/.gitkeep new file mode 100644 index 0000000..d1588b5 --- /dev/null +++ b/.gitkeep @@ -0,0 +1 @@ +# .gitkeep file auto-generated at 2026-08-12T08:27:23.951Z for PR creation at branch issue-54-4596c828ef2e for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/54 \ No newline at end of file From 08e8a83d73a11f936d7b1267a9478e8a2d23be95 Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 12 Aug 2026 08:30:04 +0000 Subject: [PATCH 2/3] test(ci): reject archived broken live links --- tests/test_workflows.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 3365f2f..6a60693 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -136,8 +136,8 @@ def test_security_workflow_scans_code_actions_and_dependencies() -> None: assert "comment-summary-in-pr: on-failure" in dependency_job -def test_links_workflow_checks_docs_with_web_archive_fallback() -> None: - """Markdown and HTML changes must trigger the bounded broken-link check.""" +def test_links_workflow_fails_for_every_broken_live_link() -> None: + """Archived snapshots must not make broken live links pass validation.""" workflow = read_workflow("links.yml") link_job = workflow_job_block(workflow, "link-checker") lychee_step = workflow_step_block(link_job, "Check links with lychee") @@ -145,7 +145,7 @@ def test_links_workflow_checks_docs_with_web_archive_fallback() -> None: link_job, "Check broken links against Web Archive" ) failure_step = workflow_step_block( - link_job, "Fail if broken links found and no web archive fallback" + link_job, "Fail if broken links were found" ) assert "- '**.md'" in workflow @@ -161,7 +161,8 @@ def test_links_workflow_checks_docs_with_web_archive_fallback() -> None: assert "output: lychee/out.md" in lychee_step assert "if: steps.lychee.outputs.exit_code != 0" in archive_step assert "python scripts/check_web_archive.py" in archive_step - assert "steps.webarchive.outputs.all_archived != 'true'" in failure_step + assert "if: always() && steps.lychee.outputs.exit_code != 0" in failure_step + assert "all_archived" not in failure_step assert "exit 1" in failure_step From df4399b1d1dcefba751020aa0ec90ea8feb36213 Mon Sep 17 00:00:00 2001 From: konard Date: Wed, 12 Aug 2026 08:30:30 +0000 Subject: [PATCH 3/3] fix(ci): fail archived broken live links --- .github/workflows/links.yml | 8 ++++---- .gitkeep | 1 - changelog.d/20260812_issue_54_archived_broken_links.md | 3 +++ tests/test_workflows.py | 4 +--- 4 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 .gitkeep create mode 100644 changelog.d/20260812_issue_54_archived_broken_links.md diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index ed04d53..4a8387d 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -64,14 +64,14 @@ jobs: env: LYCHEE_OUTPUT: lychee/out.md - - name: Fail if broken links found and no web archive fallback - if: steps.lychee.outputs.exit_code != 0 && steps.webarchive.outputs.all_archived != 'true' + - name: Fail if broken links were found + if: always() && steps.lychee.outputs.exit_code != 0 run: | - echo "::error::Broken links were detected with no Web Archive fallback available." + echo "::error::Broken live links were detected." echo "" echo "What happened:" echo " lychee found one or more broken links in the *.md and *.html files of this repository." - echo " The Web Archive check found no archived versions for some of them." + echo " An available Web Archive snapshot is a suggested replacement; it does not make the live link valid." echo "" echo "How to fix:" echo " 1. Review the 'Check links with lychee' step above for the broken links." diff --git a/.gitkeep b/.gitkeep deleted file mode 100644 index d1588b5..0000000 --- a/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# .gitkeep file auto-generated at 2026-08-12T08:27:23.951Z for PR creation at branch issue-54-4596c828ef2e for issue https://github.com/link-foundation/python-ai-driven-development-pipeline-template/issues/54 \ No newline at end of file diff --git a/changelog.d/20260812_issue_54_archived_broken_links.md b/changelog.d/20260812_issue_54_archived_broken_links.md new file mode 100644 index 0000000..6f314b4 --- /dev/null +++ b/changelog.d/20260812_issue_54_archived_broken_links.md @@ -0,0 +1,3 @@ +### Fixed + +- Fail broken-link validation for dead live URLs even when Web Archive snapshots are available. diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 6a60693..069379f 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -144,9 +144,7 @@ def test_links_workflow_fails_for_every_broken_live_link() -> None: archive_step = workflow_step_block( link_job, "Check broken links against Web Archive" ) - failure_step = workflow_step_block( - link_job, "Fail if broken links were found" - ) + failure_step = workflow_step_block(link_job, "Fail if broken links were found") assert "- '**.md'" in workflow assert "- '**.html'" in workflow