-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Move Config-related code to internal/config #459
Conversation
@@ -1228,21 +1226,3 @@ func getCloudRouterUpdateRequest(conn v4.CloudRouter, d *schema.ResourceData) (v | |||
} | |||
return changeOps, nil | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is needed in Config for some user-agent magic, so I moved it to internal/fabric_utils
Could you run The TF project imports should be in the group of non-native packages or a third group dedicated to local packages (which is what the above command will do). |
3d123b6
to
3fa9c60
Compare
Done! |
Could we move |
3fa9c60
to
95578ce
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #459 +/- ##
==========================================
- Coverage 60.11% 59.46% -0.66%
==========================================
Files 99 98 -1
Lines 20045 19880 -165
==========================================
- Hits 12051 11822 -229
- Misses 7691 7764 +73
+ Partials 303 294 -9 ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,24 @@ | |||
package fabric_utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the package name should avoid utils
Without looking at how this is used.. fabric/correlation ?
If this is only used in one or two files, especially for testing, I'd be tempted to make this a private helper adjacent to the code that needs it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be more fabric utils when we migrate further:
fabric_mapping_helper.go
fabric_mapping_service_profile_helper.go
fabric_port_mapping_helper.go
The CorrelationId code was in fabric_mapping_helper.go IIRC. I didn't think about it too much and moved it to fabric_utils originally. However it seems that CorrelationId is not used anywhere but in Config. So I moved it straight to Config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move that CorrelationId code into Config but I would create a helper
folder under internal
, you can add those mapping helpers you mention there and we will also need that also to avoid import cycles #406 (comment) so it should look like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helper
(like utils
) is too generic of a name
95578ce
to
af00a06
Compare
af00a06
to
36a8da0
Compare
There were an unusually high number of E2E tests that failed in CI for this build, but none look to be related to this change |
This PR moves Config struct and related code to
internal/config
. It's part of breakdown of the refactor tointernal/
.Part of #106