examples: add harness overlay demo#778
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bee7c722fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22eecb1c71
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3aa93f561
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b3aa93f to
b759969
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b75996916d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cmd := osexec.CommandContext( | ||
| context.Background(), | ||
| filepath.Join(mustExampleDir(), "update-harness.sh"), | ||
| "--cache-dir", cacheDir, | ||
| ) |
There was a problem hiding this comment.
Remove live GitHub dependency from harness overlay tests
preparedWorkspaceForTests invokes update-harness.sh with its default upstream URL, so a clean test run requires reaching https://github.com/wedow/harness. In network-restricted or offline environments this command fails before either functional test runs, causing TestRunScriptHarnessHelp and TestOfflineHarnessLoopWithMockProvider to fail for infrastructure reasons rather than code behavior. This makes go test ./examples/harness-overlay non-hermetic and flaky; the fixture setup should use a local upstream (as done in TestUpdateHarnessScriptStagesPreparedWorkspace) instead of an external fetch.
Useful? React with 👍 / 👎.
| @workspace="$$(./harness-overlay/update-harness.sh)"; \ | ||
| echo "Running harness-overlay demo using $$workspace"; \ | ||
| HARNESS_OVERLAY_WORKSPACE="$$workspace" go run ./harness-overlay |
There was a problem hiding this comment.
Stop make target when workspace preparation fails
The run-harness-overlay recipe sequences commands with ;, so a failing ./harness-overlay/update-harness.sh does not stop the recipe and go run is still invoked with an empty HARNESS_OVERLAY_WORKSPACE. When workspace preparation fails (for example due to upstream fetch errors), this emits misleading follow-on errors and obscures the real failure point. The recipe should short-circuit on preparation failure (for example with && or explicit status checks).
Useful? React with 👍 / 👎.
Summary
mainexamples/harness-overlay/workspace/bintracked in gitbin/path through the repo ignore rules so clean checkouts contain the upstream launcher scriptsWhy
The jq/runtime issue that originally blocked this example is now fixed on
main, so the harness branch can be rebased cleanly. After rebasing, the remaining failure was packaging:examples/harness-overlay/workspace/bin/harnessandhswere missing from git because the repo-widebin/ignore pattern excluded them. That made the example fail immediately from a clean checkout even though the rest of the overlay was present.Impact
This PR makes the Harness overlay example runnable from a normal checkout without the temporary local regeneration workaround that was previously needed to repopulate
workspace/bin.Validation
go test ./examples/harness-overlaygo run ./examples/harness-overlay --script './bin/harness help'