Conversation
|
Wow! Thanks for this @vooon. Really appreciate it |
|
Looks good - I think with a few fixes and a quick change to the heat test fixture, tests should pass. I think I would feel more comfortable merging this however after merging #481 - just since this is such a large change. I would be interested in your opinion too :) |
|
@Sharpz7 sorry, i was on a vacation. I'm unsure if i can fully test things like Heat or Designate, as the stacks i'm currently working on have quite a narrow use. |
|
@vooon I don't have that either, but the CI is pretty good right now. If you don't mind, I can work on this PR after I get the integration tests working (that sets up a devstack in CI so that we get better tests). Just let me know if you are okay with me pushing to this branch |
|
@Sharpz7 yes, please go ahead. Devstack setup surprisingly takes more time... |
|
Sounds good - might take me a while to get to but hopefully not too long, I think you have done a large chunk of the work already :) |
|
@Sharpz7 some updates:
|
|
@Sharpz7 well, i'm complete. Ready for review. Please run also Copilot, interesting if it'll find anything useful. |
|
Hey @vooon ! Thank you so much with this. I am stuck with a lot of academic work right now, but will review soon. As requested, I will run copilot now |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the openstack-exporter codebase by migrating from gophercloud v1 to v2, a significant refactoring effort. The migration updates the underlying OpenStack SDK library to its latest version, which involves updating import paths, API signatures, and client initialization patterns throughout the codebase. The PR also updates the Go version requirement from 1.23 to 1.24 and includes comprehensive test coverage updates with new fixtures for API discovery endpoints.
Key changes:
- Complete migration from
github.com/gophercloud/gophercloudv1 to v2 with updated import paths - Introduction of microversion handling utilities for better API version management
- Updated all service exporters to use context-aware v2 API calls with
context.Contextparameter - Refactored status mapping from array-based to map-based for better performance and maintainability
Reviewed changes
Copilot reviewed 42 out of 44 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod, go.sum | Updated Go version to 1.24 and gophercloud dependencies to v2.9.0 |
| utils/microversion.go | New utility for managing API microversions with environment variable support |
| exporters/exporter.go | Removed v1 client, added context-aware collection, improved transport configuration |
| exporters/utils.go | Refactored client creation to v2 API, added generic RemoveElements helper |
| exporters/nova.go | Added microversion setup, refactored flavor ID mapping, improved CPU topology calculation |
| exporters/neutron.go | Updated to v2 APIs, improved port fixed IP handling, added identity client helper |
| exporters/cinder.go | Simplified volume status handling, updated to context-aware v2 calls |
| exporters/*.go | All service exporters updated to accept context parameter and use v2 client |
| exporters/fixtures/* | Added API discovery fixtures for most services, updated test data |
| exporters/*_test.go | Updated test expectations to match v2 API responses |
| cache/*.go | Updated to use v2 client config, improved test assertions |
| Dockerfile, .github/workflows/ci.yaml | Updated Go version to 1.24 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hmm, this time Copilot has nice description, not just retelling PR comment :) @Sharpz7 ok, in a mean time I'm started testing it up on some of clouds. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 46 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Why: mechanical migration to gophercloud v2 APIs. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical framework migration to gophercloud v2. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical signature alignment for gophercloud v2. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: centralize microversion setup during gophercloud v2 porting. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: mechanical service client migration. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: move ironic microversion setup to the common framework helper. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: prevent project-name collisions (cardinality). Signed-off-by: Vladimir Ermakov <[email protected]>
Why: prevent project-name collisions (cardinality). Signed-off-by: Vladimir Ermakov <[email protected]>
Why: alert correlation improvement (cardinality). Signed-off-by: Vladimir Ermakov <[email protected]>
Fix openstack-exporter#519 which is proposed in openstack-exporter#520 Co-authored-by: Dejan Sanader <[email protected]> Signed-off-by: Vladimir Ermakov <[email protected]>
Why: improve troubleshooting context for baremetal. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: add operational visibility for node lifecycle. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: expose provider generation for drift diagnostics. Signed-off-by: Vladimir Ermakov <[email protected]>
Why: select available services and fail fast on auth/catalog issues. Signed-off-by: Vladimir Ermakov <[email protected]>
Signed-off-by: Vladimir Ermakov <[email protected]>
Summary: - align README metrics table and CLI flags with current behavior - add exporter build info metric entry Why: Keep documentation in sync with implementation to avoid operator confusion. Signed-off-by: Vladimir Ermakov <[email protected]>
That is a refactoring to use
gophercloud/v2.Tries to solve some of #500