-
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
feat: Fabric stream subscription #864
Conversation
thogarty
commented
Feb 20, 2025
- Add stream subscription resource
- Add data source by ids and data source all for subscriptions
- Add docs and examples
- Add acceptance tests for contribution
214d7f3
to
ca50b26
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #864 +/- ##
===========================================
+ Coverage 31.38% 64.95% +33.57%
===========================================
Files 217 224 +7
Lines 27667 29023 +1356
===========================================
+ Hits 8682 18851 +10169
+ Misses 18838 9275 -9563
- Partials 147 897 +750 ☔ View full report in Codecov by Sentry. |
ca50b26
to
63fb1b4
Compare
type DataSourceByIDsModel struct { | ||
ID types.String `tfsdk:"id"` |
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.
Nit / FYI: there is no need to export model types; if you start them with a lower-case letter they will only be accessible within the resource package, which reduces the risk of us incorrectly or unexpectedly tying different resource packages together.
} | ||
|
||
// Use API client to get the current state of the resource | ||
streamSubscriptions, _, err := client.StreamSubscriptionsApi.GetStreamSubscriptions(ctx, data.StreamID.ValueString()).Limit(limit).Offset(offset).Execute() |
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.
Offset and Limit are optional parameter for API request. Need to update the logic where, we will pass these attributes only when value is NotNull
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.
They are optional, but they also default to 0 and 20. Which are the defaults of the API anyway. So whether or not they are given the API result is always correct.
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 ValueInt32 will return 0 for a null
HCL value on that same model attribute.
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.
Because of Go Zero values: https://go.dev/tour/basics/12
Description: "Details of the last change on the stream resource", | ||
Computed: true, | ||
CustomType: fwtypes.NewObjectTypeOf[ChangeLogModel](ctx), | ||
PlanModifiers: []planmodifier.Object{ |
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.
Can you remove PlanModifiers for change_log attribute as it's values are going to change? Also, remove it from other attributes where it's not required.
fa03858
to
44c4ad0
Compare
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.
Approving PR but need to commit doc changes.
Getting this error: Uncommitted changes detected. Run 'make docs' and commit changes
@ctreatma , this is ready for another look from |
… to be set from plan instead of API response because API response omits it
26eca7b
to
6ae9169
Compare
@ctreatma , any issues with this PR? |
I think the only thing in here that forced devrel review was the new converter; that looks fine to me. (The rest looks fine too but will have to be reviewed by Fabric as codeowners.) |
Yes, correct. Srushti has reviewed from Fabric but we just needed the last stamp. Thank you! |
This PR is included in version 3.3.0 🎉 |