Conversation
…idation, error logging, and test improvements Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix undefined variable multiWorkflowAddr in server code
Fix multiWorkflowAddr undeclared variable, path traversal in bundle import, and test robustness
Feb 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes multiple issues across the server binary and test suite: a compilation error from an undeclared flag variable, a path traversal security concern in bundle import handling, and several test robustness improvements.
Changes:
- Fixed undeclared
multiWorkflowAddrflag causing compilation failure - Added defense-in-depth path traversal validation for bundle workflow imports
- Improved test robustness by replacing error-ignoring patterns with fail-fast helpers and explicit assertions
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/server/main.go | Added missing multiWorkflowAddr flag declaration, aligned flag spacing, added path traversal validation for bundle imports, and improved cleanup error logging |
| engine_structural_test.go | Replaced fragile index-based plugin lookup with findPluginByName() helper, removed private field access using public schema.KnownModuleTypes() API, added getEngineModuleTypes() helper for necessary factory map access |
| module/api_v1_test.go | Added mustCreate* test helpers with proper error handling, fixed silently-ignored errors in multiple test functions, added explicit idempotency assertions |
| plugins/admin/plugin_test.go | Enhanced runtime interface validation, added nil guards and name assertions in factory tests, improved wiring hook test to verify module count increases |
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.
Several issues across the server binary and tests: missing flag declaration causing a compile error, a path traversal vulnerability in bundle workflow loading, silently swallowed cleanup errors, and fragile tests accessing private fields or ignoring errors.
cmd/server/main.gomultiWorkflowAddrflag — was referenced at 3 call sites but never declared, causing a build failuredatabaseDSN/jwtSecrethad inconsistent spacing vs. the rest of the blockworkflowPathfrombundle.Importwas read directly without verifying it stayed withindestDir; now validated viafilepath.Abs+filepath.Rel:os.Remove/os.RemoveAllfailures are now logged (suppressingIsNotExist) instead of silently ignoredengine_structural_test.goallPlugins()[0]withfindPluginByName("workflow-plugin-http")helperTestEngineFactoryMapPopulatedByPlugins— usesschema.KnownModuleTypes()instead ofengine.moduleFactoriesgetEngineModuleTypeshelper forTestSchemaKnowsPluginModuleTypesto encapsulate the remaining necessary factory map accessmodule/api_v1_test.gomustCreateCompany/Org/Projecthelpers — replace scattered_, _ignoring patterns with fail-fast setup helpersListWorkflowsafter delete, threeUpdateWorkflowcalls in versioning test, and setup inCreateAndListProjectsEnsureSystemHierarchy— replaced_ = c2; _ = o2; _ = p2with equality checks against the first-call IDsplugins/admin/plugin_test.goTestPluginImplementsEnginePlugin— add runtimeEngineManifest()call andValidate()check alongside the compile-time assertionTestModuleFactories— addnilguard withcontinueand assertmod.Name()matches the requested nameTestWiringHookMergesAdminConfig— verifylen(cfg.Modules)grows after the hook runs, not just thatadmin-serveris presentOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.