Skip to content

fwserver: add ListResource method #1153

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

Closed

Conversation

bbasata
Copy link
Contributor

@bbasata bbasata commented May 29, 2025

Description

To merge after #1152. This pull request adds a ListResource implementation to the protocol-independent framework server.

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

@bbasata bbasata added this to the v1.16.0 milestone May 29, 2025
@bbasata bbasata force-pushed the add-list-to-fwserver-part-iii branch from 4640688 to b7fea91 Compare May 29, 2025 03:29
@bbasata bbasata force-pushed the add-list-to-fwserver-part-ii branch from 1da956e to 70aac24 Compare May 29, 2025 16:37
@bbasata bbasata force-pushed the add-list-to-fwserver-part-iii branch from b7fea91 to b941cae Compare May 29, 2025 16:39
@bbasata bbasata force-pushed the add-list-to-fwserver-part-ii branch from 70aac24 to d6776b3 Compare May 29, 2025 17:03
@bbasata bbasata force-pushed the add-list-to-fwserver-part-iii branch from b941cae to 73392ce Compare May 29, 2025 17:05
@bbasata bbasata force-pushed the add-list-to-fwserver-part-ii branch 5 times, most recently from be455ea to 7691bb8 Compare June 3, 2025 19:33
@bbasata bbasata force-pushed the add-list-to-fwserver-part-iii branch 2 times, most recently from 49f3d27 to 53f6a7c Compare June 3, 2025 20:53
@bbasata bbasata force-pushed the add-list-to-fwserver-part-iii branch from 84bb222 to 78fc148 Compare June 3, 2025 21:16
@bbasata bbasata marked this pull request as ready for review June 3, 2025 21:27
@bbasata bbasata requested a review from a team as a code owner June 3, 2025 21:27
// processListResult validates the content of a list.ListResult and returns a
// ListResult
func processListResult(req list.ListRequest, result list.ListResult) ListResult {
if result.Identity == nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: needs tests

}
}

if req.IncludeResource && result.Resource == nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: needs tests

type ListResourceStream struct {
// Results is a function that emits ListResult values via its push
// function argument.
Results iter.Seq[ListResult]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

💭 A follow-up enhancement: what if a (List) Resource uses its data model instead of ListResult here? and Framework uses fwschemadata to transform the data model into a ListResult Terraform value?

Suggested change
Results iter.Seq[ListResult]
Results iter.Seq[any-ish]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what if a (List) Resource uses its data model

... and also, what if a List Resource "encapsulates" an SDKv2 managed resource, so it has no existing data model? is this still useful?

@bbasata
Copy link
Contributor Author

bbasata commented Jun 5, 2025

Closing in favor of #1157.

@bbasata bbasata closed this Jun 5, 2025
@bbasata bbasata deleted the add-list-to-fwserver-part-iii branch June 5, 2025 14:13
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.

1 participant