Sync example plugin zoraxy_plugin copies after AccessRuleCreatedEvent update#1114
Draft
Sync example plugin zoraxy_plugin copies after AccessRuleCreatedEvent update#1114
Conversation
…adersOnly field) Agent-Logs-Url: https://github.com/tobychui/zoraxy/sessions/13328b84-2bb2-4e23-85f0-274ea2e5a64b Co-authored-by: tobychui <24617523+tobychui@users.noreply.github.com>
… update Agent-Logs-Url: https://github.com/tobychui/zoraxy/sessions/13328b84-2bb2-4e23-85f0-274ea2e5a64b Co-authored-by: tobychui <24617523+tobychui@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job check-example-plugins
Sync example plugin zoraxy_plugin copies after AccessRuleCreatedEvent update
Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check-example-pluginsCI was failing becausebuild_all.shcopiessrc/mod/plugins/zoraxy_plugininto each example plugin, and the source had gained a new field (TrustProxyHeadersOnly) that wasn't reflected in the committed copies — causinggit diff --exit-codeto fail on every run.Changes
events/events.goin all 10 example plugins to match the current source, adding the missingTrustProxyHeadersOnly boolfield toAccessRuleCreatedEvent:Affected plugins:
api-call-example,debugger,dynamic-capture-example,event-subscriber-example,helloworld,plugin2plugin-comms-peer1,plugin2plugin-comms-peer2,restful-example,static-capture-example,upnp.Original prompt
Create a fix for failing GitHub Actions job
check-example-pluginsin repotobychui/zoraxy(workflow:.github/workflows/ci.yaml).Failure details:
example/plugins:bash build_all.sh && git diff --exit-code.TrustProxyHeadersOnly booljson:"trust_proxy_headers_only"``func (e *AccessRuleCreatedEvent) GetName() EventName {build_all.sheither fails to build or generates/rewrites tracked files causinggit diff --exit-codeto fail.Task:
example/plugins/build_all.shand any scripts/generators it runs.build_all.shsucceeds.bash build_all.shinexample/pluginsleaves the repo clean (git diff --exit-codepasses) and builds succeed.Constraints:
Expected result:
CI (lints, tests (todo), and builds)passes, especiallycheck-example-plugins.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failing job is
check-example-plugins, specifically this step in.github/workflows/ci.yaml:example/plugins:bash build_all.sh && git diff --exit-codeThis job fails when either:
build_all.shreturns a non-zero exit code (build failure), orbuild_all.shmodifies tracked files (sogit diff --exit-codedetects changes), meaning generated outputs aren’t committed / builds aren’t reproducible.What the log indicates
Your log shows a
--- ERROR ---block printing a snippet of Go source around:…and then the step exits with code 1. This pattern strongly suggests
build_all.shruns a formatter or code generator that changes Go files, and then treats the diff as an error (or the script itself detects a diff and prints context before exiting).Fix (most likely): commit the generated/normalized files
cd example/plugins bash build_all.sh git status git diffTypical causes:
go fmt(or goimports) reformatting codetrust_proxy_headers_onlyMake the output deterministic (if changes keep appearing)
If every CI run produces diffs even after committing, then the build script is likely generating non-deterministic output (timestamps, Go version strings, absolute paths, map iteration order, etc.).
Common hardening steps inside
example/plugins/build_all.sh:go generate, ensure the generator code produces stable ordering (sort keys before emitting JSON/YAML)gofmtis run consistently (and locally in the same way CI runs it)If instead it’s a real compile error
The truncated log doesn’t show the actual compiler error text, but the failure happens during
bash build_all.sh. Run the same script locally to surface the full error and fix the compilation issue it reports (the snippet suggests it’s in an “event” type file nearAccessRuleCreatedEvent).Concrete next change to make in the PR
bash build_all.shunderexample/plugins/git diff --exit-codeis enforcing)If you paste the contents of
example/plugins/build_all.sh(or the full--- ERROR ---section from the job log), I can point to the exact file(s) that changed and suggest a precise patch (e.g., sorting output keys, removing timestamps, or fixing a specific compile error).User: Can you create a pull request to fix it for me?
Assistant: I’ve kicked off the pull request creation process to apply a fix, but it’s currently waiting on t...
This pull request was created from Copilot chat.