Rewrite gocmlclient with layered API/services architecture and comprehensive tests#11
Merged
Conversation
- Enhance RetryMiddleware to avoid re-reading req.Body and support context cancellation. - Implement body cloning for safe retry attempts; drain response for connection reuse. - Update User model to improve opt-in handling with string enums, ensuring backward compatibility. - Introduce new integration tests for environment loading and topology validation.
- prefer schema /labs/{id}/{start|stop|wipe} with legacy fallback on 404
- align LabService.Labs query params with OpenAPI (show_all)
- update lab service unit tests to exercise schema-first behavior
- Modify envBool signature and update default behavior for IT - Adjust Node.Create fields to remove CPUs from tests - Change JSON tags on models for consistency and presence - Wire linkService with Interface and Node services for improved integration
- strengthen group IT coverage for members and associations - improve temp lab and user creation logic in tests - tidy UserUpdatePassword signature for clarity
- add exclude_configurations option for deterministic payloads - include client identification headers for requests with body - remove vendored dependencies to simplify the project structure
- new helper ApplyClientIdentityHeaders to set headers - shift client ID generation to per-client, add version support - update API client and auth provider to store and apply headers - introduce version stamp via internal/version package
- add PyAtsCredentials struct for authentication - migrate legacy fields into NodeOperational - support object configuration shape in UnmarshalJSON - add tests for configuration integrity and round-trip presence
- LabImport now implements UnmarshalJSON to handle schema with warnings=null - Added tests for warnings null and warnings array scenarios - Removed stale progress.md document from the repo
- add Timeout and Features map to SystemInformation - introduce MACAddress field to Interface - make SchemaVersion and Description optional in ImageDefinition - replace DiskImage1 with pointer and add new fields - add new tests for feature unmarshal and DiskImage1 access - update tests to match new ImageDefinition fields
- introduce new models for Annotation shapes - include services for managing annotations - integrate Annotation and SmartAnnotation services in Client - enhance README with usage examples and formatting - add unit and integration tests for new features - include minor service interface updates and package comments
- BREAKING changes: compatibility layer removed; specific tests adjusted. Updated README to reflect no backward compatibility and Go 1.25 requirement. - Added NodeStaging support for lab models and new Makefile integration target for testing.
- refactor logging with central wrapper and default settings - add CLI for version control with environment and flags support - update CI workflows and Makefile to exclude cmd packages - add and adjust various tests including annotation models
- add CODE_OF_CONDUCT.md and CONTRIBUTING.md for contributors - update LICENSE with new copyright year range 2022-2026 - minor formatting updates in README.md (line breaks and indentation)
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.
What
Near-complete rewrite of gocmlclient into a clean, testable, package-oriented library with explicit models, a structured API layer, and service-specific modules.
Highlights
pkg/client: public client + options (stable surface)internal/api: HTTP client, middleware, request/response handling, statsinternal/auth: auth manager/providers/storage/transportinternal/services: per-domain services (lab/node/link/interface/group/user/extconn/imagedef/system/annotations)pkg/models+pkg/errors: typed models and consistent error handlingintegration/suite for end-to-end coverage (labs, nodes, links, interfaces, groups, users, annotations, system, smoke, topology)internal/httputil/headers.go)cmd/dtestandcmd/cml-versiongo.mod/go.sum)Breaking/behavior notes
lab.go,node.go,link.go,auth.golayout); consumers should migrate topkg/client+ typed services/models.Test
go test ./..../integration(where environment supports it)