Repository navigation
fix: --config-data and the environment route need explicit intent; bounded output queues and adapter model; escaped device strings (v0.9.0) - #30
Merged
Conversation
…unded output queues and adapter model; escaped device strings (v0.9.0) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Prepares v0.9.0 (previous v0.8.1), built on go-ethernetip v0.8.1 (was v0.8.0; its
eds.GenerateGokeeps the header comment on one line). Two changes are breaking for scripts and are listed under### Breakingin RELEASE.md.Breaking
forward-openandiowith--config-dataneed--yes: the target writes the configuration data to its configuration assembly.forward-opengains--yes(no environment variable). Without it both exit 2 (confirmation_required) before any connection. To keep the old handling, add--yeswhere--config-datais passed.write,reset,assembly writeandtag writetake a route only from--route. WithETHERNETIPCTL_ROUTEset and no--route, the change goes to the host on the command line and stderr saysETHERNETIPCTL_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-openandforward-closealways send the configuration instance in the connection path ([instance 0]for--config 0), asiodoes and as the--configdescription says.droppedevent counts what was left out; on stop it waits at most a second for stdout.invalid_config(exit 3) before the adapter starts.resetnames its route in text and table output.tag readandtag decodesize the values of a reply by its data.eds codegenwrites the EDS file name into the generated header with control characters replaced by_.diagnosehelp 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.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, soreset --type 4294967296was a power cycle there andtag read --count 4294967297read one element.TestIntFlagKeepsValueWithinIntand two new rows of the flag-value table incmd/, which failed on linux/386 before.🤖 Generated with Claude Code