test(#3928): add behaviour scenarios for URL-sourced harness dispatch#5407
test(#3928): add behaviour scenarios for URL-sourced harness dispatch#5407fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add three behaviour test scenarios that verify URL-sourced custom agent harness dispatch via the harness-dispatch pipeline: 1. URL-sourced harness with CEL trigger: registers a harness YAML at a raw.githubusercontent.com URL with sha256 integrity hash, dispatches on matching label event, and verifies agent execution. 2. Mixed URL + local harnesses: registers both a local-path and a URL-sourced harness in the same config, verifies the local harness enumerates and matches independently. 3. Bad integrity hash: registers a URL-sourced harness with a deliberately wrong sha256 hash alongside a valid local harness. Verifies the failed URL agent is skipped at runtime while dispatch continues for the local agent. New step definitions in url_dispatch.go handle URL-sourced harness setup: commit harness YAML to config repo, compute sha256 hash, construct raw.githubusercontent.com URL, register in config with URL source and allowed_remote_resources update. Closes #3928
|
🤖 Finished Review · ✅ Success · Started 10:16 AM UTC · Completed 10:31 AM UTC |
Site previewPreview: https://32857044-site.fullsend-ai.workers.dev Commit: |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsLow
Labels: PR adds e2e behaviour test scenarios for URL-sourced harness dispatch |
| @@ -0,0 +1,9 @@ | |||
| agent: agents/triage.md | |||
There was a problem hiding this comment.
[low] dead-code
Fixture file is not referenced anywhere in the codebase. It duplicates the inline harness YAML from Scenario 1's docstring but serves no purpose. May be leftover scaffolding from development.
Suggested fix: Either remove the file or wire it into a test step if it was intended to be served as the URL-sourced harness content.
| | Prove local execution | write_fixture| output/dispatch-local-ok.json, fixtures/dispatch/ok.json | | ||
| And an issue | ||
| When the issue is labeled "ready-for-mixed-ping" | ||
| Then the harness "local-ping" workflow completes successfully |
There was a problem hiding this comment.
[low] scope-question
The third scenario tests hash failure but not allowlist failure, though issue #3928 says 'fails allowlist or integrity hash'. The code implements the allowlist failure path (skipAllowlist option with a registered step 'not in allowlist with:'), but no scenario exercises it yet.
Suggested fix: Confirm whether a fourth scenario for allowlist failure is intended for this PR or a follow-up. The step definition is already wired.
| } | ||
|
|
||
| // containsPrefix reports whether the list already contains the given prefix. | ||
| func containsPrefix(list []string, prefix string) bool { |
There was a problem hiding this comment.
[low] naming-consistency
Function name containsPrefix suggests prefix matching but implementation uses exact match via slices.Contains.
Suggested fix: Rename to containsExact or inline the slices.Contains call at the usage site.
|
|
||
| merged, err := yaml.Marshal(cfg) | ||
| if err != nil { | ||
| return err |
There was a problem hiding this comment.
[low] error-wrapping-consistency
Bare return err from yaml.Marshal differs from the consistent error wrapping pattern used throughout the rest of the file. dispatch.go uses the same bare pattern.
|
/fs-fix The new step functions assume the existence of the Fix the comments by the review agent as well. |
Summary
Add behaviour test scenarios for URL-sourced custom agent harness dispatch, verifying that
FetchAgentHarnessURL resolution works end-to-end in theharness-dispatchpipeline.Related Issue
Fixes #3928
Changes
e2e/behaviour/features/dispatch/url-dispatch.feature): Three scenarios covering URL-sourced harness CEL trigger dispatch, mixed URL+local harness enumeration, and graceful skip on integrity hash failure.pkg/behaviourtest/steps/url_dispatch.go):givenURLSourcedCustomHarnesscommits harness YAML to the config repo, computes SHA256 integrity hash, constructsraw.githubusercontent.comURL, and registers the agent in config with the URL source andallowed_remote_resourcesupdate. SupportsbadHashandskipAllowlistoption variants for failure testing.e2e/behaviour/fixtures/dispatch/url-harness.yaml): Reference harness YAML for URL-sourced tests.pkg/behaviourtest/steps/url_dispatch_test.go): Covers input validation, URL format construction, bad hash injection, allowlist skip, andcontainsPrefixhelper.pkg/behaviourtest/steps/registry.go): Registers new URL dispatch step definitions.Testing
go test ./pkg/behaviourtest/steps/...go vetcleanChecklist
!for breaking changes)Closes #3928
Post-script verification
agent/3928-url-dispatch-behaviour-tests)d9185cb4c47c583de659ff76e15a7ba167899d3a..HEAD)