Skip to content

Dereference site-dir links during the copy, and fail broken ones through fail - #17

Merged
dmccoystephenson merged 3 commits into
mainfrom
feature/site-dir-links
Nov 6, 2026
Merged

dmccoystephenson merged 3 commits into
mainfrom
feature/site-dir-links

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Links in site-dir that point outside it, and broken links, are handled here. The README says the action dereferences links, but only absolute links were tested.

Closes #18

Summary

  • A relative link out of site-dir. The tree was copied with cp -R, which keeps links as links, so relative.html -> ../page.html dangled inside the mktemp copy and tar --dereference stopped on it. cp -RL dereferences during the copy, against the original location.
  • A broken link. The failure left through set -e with tar's own message, not through fail, so no ::error:: annotation was written. cp ... || fail gives it one, naming the likely cause.
  • tar --dereference is dropped, since the copy no longer holds any links.

Commits were pushed tests-first, so the regression evidence is on this branch: run 41817007115 (relative link) and run 41817136677 (broken link) went red with tar: ./<link>: File removed before we read it, ahead of the fix commit.

Test plan

  • Test / deploy-to-a-real-arcade is green on the PR head, including:
    • "Build a static site" and "The site is served as files, without isolation headers", with the new relative.html link
    • "Bad inputs fail before any request, each with its own ::error::", with the new broken-site line
  • test.yml was edited by hand. Running deploy.sh, bash -n and shellcheck locally was blocked by the session sandbox, so CI is the only real check.

CI runs on ubuntu-latest only, so cp -RL is not exercised on macOS or BSD. -R and -L together are specified by POSIX.

Compatibility

Backward-compatible for @v1 callers: no input, output or default changes. A site with a broken link failed before and still fails, now with an annotation. A site with a relative link out of the tree starts working. A link to a directory now arrives as a copy of that directory, as tar --dereference already produced.

Deferred issues

Not checked this cycle

  • Whether the pinned arcade ref: (v0.6.6) lags the latest release: gh release list was not available in this session.

This PR changes .github/workflows/test.yml, so it is do-not-auto-merge and is handed off for human review.

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dmccoystephenson and others added 2 commits November 4, 2026 03:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (anchored on CI run 41817264108, green on head 90b5cdf):

  • Scope: PASS. Only deploy.sh, .github/workflows/test.yml and README.md change, all for site-dir: a relative link out of the tree or a broken link stops the deploy without an ::error:: #18.
  • Tests-new: PASS. The new fail branch has an exact-message expect_error line in "Bad inputs fail before any request". The relative-link path is asserted by a curl of relative.html. The log of the green run shows both lines executed and <html>linked page</html> served twice.
  • Tests-fix: PASS, by CI. Local execution was blocked by the session sandbox, so the tests were pushed ahead of the fix: run 41817007115 went red at "Deploy a static site through the action" (tar: ./relative.html: File removed before we read it), run 41817136677 went red at "Bad inputs fail before any request" (tar: ./dead.html: File removed before we read it), and run 41817264108 went green with the fix. No temporary revert was needed.
  • Sibling structure: PASS. No new files.
  • Sibling renames: PASS. Nothing renamed.
  • Docs: PASS. The README static-game paragraph and "Tests" list were updated. action.yml descriptions and the deploy.sh comment still hold; the comment moved with the dereference to the cp line.
  • Issue resolution: PASS. Both cases named in site-dir: a relative link out of the tree or a broken link stops the deploy without an ::error:: #18 are changed and tested.
  • CI: PASS. Green on the head, with conclusion and step results read from gh run view.
  • Input parity: PASS. All nine action.yml inputs have an env line, a matching deploy.sh default and a README row; none was touched.
  • Output parity: PASS. version and url are unchanged.
  • Token hygiene: PASS. No diff line touches the token, the auth file, umask, the trap or curl.
  • Failure messages: PASS, with a note below. The new exit goes through fail.
  • Pre-network validation: PASS. The copy fails before the curl call, as the unreachable-url fixture proves.
  • Compatibility: PASS. action.yml is unchanged. Only previously failing sites change behaviour.

Judgment calls for the human reviewer:

  • deploy.sh:36 — cp can also fail for reasons other than a broken link (an unreadable file, a full disk). The message is therefore phrased as a question, and cp's own line stays in the log above it.
  • deploy.sh:36 — cp -RL is not exercised on macOS or BSD, since CI runs on ubuntu-latest only. The flags are POSIX.
  • A circular link in site-dir is untested. It is expected to reach the same fail, whose wording would then be slightly off.

shellcheck and bash -n could not be run locally (sandbox), and shellcheck is not part of CI.

The PR matches the do-not-auto-merge list through .github/workflows/test.yml, so it is left open for human review.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 07181eb into main Nov 6, 2026
1 check passed
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.

site-dir: a relative link out of the tree or a broken link stops the deploy without an ::error::

1 participant