Skip to content

fix missing aot model SourceGenerationContext #1636

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

Merged
merged 2 commits into from
Jun 3, 2025

Conversation

tg123
Copy link
Member

@tg123 tg123 commented May 30, 2025

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 30, 2025
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 30, 2025
@tg123 tg123 requested a review from Copilot May 30, 2025 19:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the missing AOT model SourceGenerationContext by introducing a dedicated template and generator while updating tests and dependency registrations. Key changes include:

  • Adding a new test method (VersionTestAsync) to validate the client's version retrieval.
  • Introducing a new SourceGenerationContext template and generator.
  • Removing duplicate SourceGenerationContext code from ModelExtensions.cs.template and updating generator registrations.

Reviewed Changes

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

Show a summary per file
File Description
tests/E2E.Aot.Tests/MinikubeTests.cs Added a new async test to verify version retrieval.
src/LibKubernetesGenerator/templates/SourceGenerationContext.cs.template Created a new AOT SourceGenerationContext template.
src/LibKubernetesGenerator/templates/ModelExtensions.cs.template Removed duplicate SourceGenerationContext generation code.
src/LibKubernetesGenerator/SourceGenerationContextGenerator.cs Added a generator for rendering the new SourceGenerationContext template.
src/LibKubernetesGenerator/KubernetesClientSourceGenerator.cs Registered the new SourceGenerationContextGenerator in the dependency injection container.
Comments suppressed due to low confidence (3)

tests/E2E.Aot.Tests/MinikubeTests.cs:379

  • [nitpick] The 'VersionTestAsync' method currently only checks for a non-null version. Consider asserting specific properties or format of the version to strengthen test coverage.
Assert.NotNull(version);

src/LibKubernetesGenerator/templates/ModelExtensions.cs.template:15

  • [nitpick] The removal of the SourceGenerationContext generation block helps reduce duplication. Ensure that the new SourceGenerationContext template and its generator fully cover the intended behavior.
#if NET8_0_OR_GREATER

src/LibKubernetesGenerator/KubernetesClientSourceGenerator.cs:62

  • [nitpick] Verify that introducing the SourceGenerationContextGenerator registration does not affect the initialization order or dependencies among the generators.
builder.RegisterType<SourceGenerationContextGenerator>();

@brendandburns
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 3, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns, tg123

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [brendandburns,tg123]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 8d0547b into kubernetes-client:master Jun 3, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants