Skip to content

fix: --config-data and the environment route need explicit intent; bounded output queues and adapter model; escaped device strings (v0.9.0) - #30

Merged
boeboe merged 1 commit into
mainfrom
fix/policy-1.6-review
Nov 15, 2026
Merged

boeboe merged 1 commit into
mainfrom
fix/policy-1.6-review

Conversation

@boeboe

@boeboe boeboe commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Prepares v0.9.0 (previous v0.8.1), built on go-ethernetip v0.8.1 (was v0.8.0; its eds.GenerateGo keeps the header comment on one line). Two changes are breaking for scripts and are listed under ### Breaking in RELEASE.md.

Breaking

  • forward-open and io with --config-data need --yes: the target writes the configuration data to its configuration assembly. forward-open gains --yes (no environment variable). Without it both exit 2 (confirmation_required) before any connection. To keep the old handling, add --yes where --config-data is passed.
  • write, reset, assembly write and tag write take a route only from --route. With ETHERNETIPCTL_ROUTE set and no --route, the change goes to the host on the command line and stderr says ETHERNETIPCTL_ROUTE=<route> is not used: a change takes its route only from --route. The reading commands keep the variable. To keep the old handling, pass --route "$ETHERNETIPCTL_ROUTE".

Other changes

  • forward-open and forward-close always send the configuration instance in the connection path ([instance 0] for --config 0), as io does and as the --config description says.
  • adapter: events reach stdout through a queue of 1024; while stdout does not keep up the adapter goes on serving and a new dropped event counts what was left out; on stop it waits at most a second for stdout.
  • adapter: a model holds at most 4096 assemblies, tags and templates and 64 MiB of assembly and tag data; a BOOL member's bit is 0 to 7. Larger models are refused as invalid_config (exit 3) before the adapter starts.
  • io: up to 1024 samples (4 MiB of hex) wait for stdout; when stdout is slower the oldest are dropped and the summary counts them; after Ctrl-C only the queued samples are written.
  • Text and table output escape the characters that do not print in names and strings a device sends. JSON is unchanged.
  • reset names its route in text and table output.
  • tag read and tag decode size the values of a reply by its data.
  • eds codegen writes the EDS file name into the generated header with control characters replaced by _.
  • Docs: diagnose help gives exit code 1 (findings); README and SECURITY.md give exit 2 for a change without --yes; SECURITY.md, README, docs/exitcodes.md, docs/commands.md, docs/json-output.md and docs/adapter-config.md follow the changes.
  • CI: a job runs make e2e.

Files: cmd/adapter/adapter.go, cmd/device/{connection,explicit}.go, cmd/tag/tag.go, internal/adapter/{model,run}.go, internal/cli/route.go (new), internal/config/types.go, internal/eip/{connection,diagnose,eds,io,tag}.go, internal/types/{connection,explicit,identity,tag,util}.go, .github/workflows/ci.yml, README.md, SECURITY.md, CONTRIBUTING.md, RELEASE.md, docs/{adapter-config,commands,exitcodes,json-output}.md.

Tests (each fails on the code before the change): TestConfigDataNeedsYes, TestChangingCommandsTakeTheRouteOnlyFromTheFlag, TestForwardOpenSendsThePathOfIO, TestDeviceStringsArePrintable, TestAdapterServesWhileStdoutStalls, TestEDSCodegenFileName, TestDiagnoseHelpNamesItsExitCode (cmd); TestModelBounds, TestModelBoolMemberBit, TestEmitterDropsWhileLogStalls, TestEmitterCloseDoesNotWaitForAStalledLog (internal/adapter); TestConnectionPathAlwaysNamesTheConfigInstance, TestValuesOfSizedByItsData, TestSamplerQueueIsBounded, TestIOWithAStalledOutput, TestCommentName (internal/eip); TestPrintable, TestDeviceStringsEscaped, TestResetNamesTheRoute (internal/types). All against go-ethernetip servers or fake devices on loopback.

Also (found by the 32-bit test run before this pull request): int flags read their value in 64 bits and keep it within the range of int (internal/config/flags.go, intFlag). pflag's int flag kept the low 32 bits on 32-bit builds, so reset --type 4294967296 was a power cycle there and tag read --count 4294967297 read one element. TestIntFlagKeepsValueWithinInt and two new rows of the flag-value table in cmd/, which failed on linux/386 before.

🤖 Generated with Claude Code

…unded output queues and adapter model; escaped device strings (v0.9.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.41379% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/adapter/model.go 96.36% 1 Missing and 1 partial ⚠️
internal/cli/route.go 83.33% 1 Missing and 1 partial ⚠️
internal/eip/io.go 93.93% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@boeboe
boeboe merged commit 82ca691 into main Nov 15, 2026
17 checks passed
@boeboe
boeboe deleted the fix/policy-1.6-review branch November 15, 2026 15:58
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.

1 participant