Skip to content
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

Improve function factories #4558

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

theunrepentantgeek
Copy link
Member

@theunrepentantgeek theunrepentantgeek commented Feb 4, 2025

What this PR does

Minor quality-of-life improvement for the NewResourceFunction() and NewObjectFunction() methods, making code easier to read by removing boilerplate.

How does this PR make you feel?

gif

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 16 changed files in this pull request and generated no comments.

Files not reviewed (11)
  • v2/tools/generator/internal/functions/object_function.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/resource_function.go: Evaluated as low risk
  • v2/tools/generator/internal/armconversion/arm_spec_interface.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/kubernetes_admissions_validator.go: Evaluated as low risk
  • v2/tools/generator/internal/codegen/pipeline/add_status_conditions.go: Evaluated as low risk
  • v2/tools/generator/internal/codegen/pipeline/inject_property_assignment_functions.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/kubernetes_admissions_defaulter.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/kubernetes_config_exporter_function.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/dynamic_exports.go: Evaluated as low risk
  • v2/tools/generator/internal/interfaces/kubernetes_resource_interface.go: Evaluated as low risk
  • v2/tools/generator/internal/functions/get_resource_type_function.go: Evaluated as low risk
Comments suppressed due to low confidence (1)

v2/tools/generator/internal/functions/new_empty_arm_value_function.go:25

  • The NewObjectFunction call should include the package reference as a variadic argument, but the existing code already handles this correctly. No changes are needed here.
newEmptyARMValueBody(armType),
@theunrepentantgeek theunrepentantgeek force-pushed the improve/function-factories branch from 3f8b56e to c4634fc Compare February 4, 2025 20:43
@theunrepentantgeek theunrepentantgeek self-assigned this Feb 4, 2025
@theunrepentantgeek theunrepentantgeek added this to the v2.13.0 milestone Feb 4, 2025
@theunrepentantgeek theunrepentantgeek changed the title Improve resource factories Improve function factories Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant