Skip to content

feat(eos): add show version with volatile-field exclusions#3761

Open
garryshtern wants to merge 2 commits intoytti:masterfrom
garryshtern:feat/eos-show-version
Open

feat(eos): add show version with volatile-field exclusions#3761
garryshtern wants to merge 2 commits intoytti:masterfrom
garryshtern:feat/eos-show-version

Conversation

@garryshtern
Copy link
Copy Markdown
Contributor

Pre-Request Checklist

  • Passes rubocop code analysis
  • Tests added or adapted
  • Changes are reflected in the documentation
  • User-visible changes appended to CHANGELOG.md

Description

Adds show version | no-more to the EOS model so that hardware identity
information (model, serial number, MAC addresses, software version, build
details) is captured alongside the running configuration.

The Uptime and Free memory lines are stripped with reject_lines
before the output is stored as a comment block. Without this exclusion
those two fields change on every poll cycle and would produce spurious
config-change events in git-based outputs.

Includes a device simulation fixture for a DCS-7050CX3-32S running
EOS 4.28.3M and the corresponding expected-output file.

🤖 Generated with Claude Code

Capture hardware identity (model, serial, software version, MAC
addresses, build info) from `show version | no-more` as a comment
block alongside the running config.

The `Uptime` and `Free memory` lines are stripped via `reject_lines`
before storing so they do not cause spurious config-change events on
every poll cycle.

Adds a device simulation and expected-output fixture for
DCS-7050CX3-32S running EOS 4.28.3M.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@robertcheramy robertcheramy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity - how much is from claude code and how much is from you?
I don't think claude code can generate a YAML simulation file and the corresponding output.

Comment thread CHANGELOG.md Outdated
- Move entry to end of Changed section (chronological order)
- Describe what show version captures (hardware identity) rather than
  mentioning internal implementation detail (volatile field exclusions)
- Fix author to match PR author (@garryshtern)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@garryshtern
Copy link
Copy Markdown
Contributor Author

To answer your question honestly: this PR was entirely generated by Claude Code (claude-sonnet-4-6), directed by me. That includes the simulation YAML and the expected output.txt.

For the simulation YAML, Claude read several existing simulation files in the repo to learn the format, then constructed the YAML based on what a real EOS show version output looks like (with plausible but synthetic values for serial, MAC, version, etc.). The output.txt was generated by running atoms_generate.rb against that YAML.

I've addressed the CHANGELOG feedback:

  • Moved the entry to the end of the Changed section
  • Reworded to describe what show version captures (hardware identity) rather than mentioning implementation details
  • Fixed the author to @garryshtern

@robertcheramy
Copy link
Copy Markdown
Collaborator

For the simulation YAML, Claude read several existing simulation files in the repo to learn the format, then constructed the YAML based on what a real EOS show version output looks like (with plausible but synthetic values for serial, MAC, version, etc.). The output.txt was generated by running atoms_generate.rb against that YAML.

I find it difficult that the simulation data doesn't come from a real device. If a test fails in the future I must trust that it is based on real data. If you only want to integrate the show real output, make something like: https://github.com/ytti/oxidized/blob/master/spec/model/data/aoscx%23CX10000_10.16.1020_environment%23simulation.yaml

Better would be to get real data with device2yaml, it is not difficult, see https://github.com/ytti/oxidized/blob/master/docs/DeviceSimulation.md

If you include AI-Generated simulation data, please mark it as such, for example with a comment at the beginn of the file.

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.

2 participants