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

adopt newer source generator #1417

Merged
merged 9 commits into from Oct 10, 2023
Merged

Conversation

tg123
Copy link
Member

@tg123 tg123 commented Oct 1, 2023

use new https://github.com/dotnet/roslyn/blob/main/docs/features/incremental-generators.md to generate client code

now generated model code could work together with json source generator (aot requirement)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 1, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@2899a13). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff            @@
##             master    #1417   +/-   ##
=========================================
  Coverage          ?   70.50%           
=========================================
  Files             ?       89           
  Lines             ?     2648           
  Branches          ?        0           
=========================================
  Hits              ?     1867           
  Misses            ?      781           
  Partials          ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@brendandburns
Copy link
Contributor

Generally looks good, some comments on some dead code/config

@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 Oct 10, 2023
@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 0d718cb into kubernetes-client:master Oct 10, 2023
14 checks passed
@tg123 tg123 deleted the aot branch October 13, 2023 09:27
@guillaume-chervet
Copy link

hi @tg123 ,

When i use trimming with latest version I obtain at runtime:
Starting in namespace ramiv2-dev-axa-fr
Unhandled exception. System.AggregateException: One or more errors occurred. (Reflection-based serialization has been disabled for this application. Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' property.)
---> System.InvalidOperationException: Reflection-based serialization has been disabled for this application. Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' property.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_JsonSerializerIsReflectionDisabled()
at System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer()
at System.Text.Json.JsonSerializerOptions.MakeReadOnly(Boolean)
at System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions, Type)
at System.Text.Json.JsonSerializer.GetTypeInfoT
at System.Text.Json.JsonSerializer.Deserialize[TValue](Stream , JsonSerializerOptions )
at k8s.KubernetesJson.Deserialize[TValue](Stream json, JsonSerializerOptions jsonSerializerOptions)
at k8s.Kubernetes.CreateResultAsync[T](HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, Nullable1 watch, CancellationToken cancellationToken) at k8s.AbstractKubernetes.ICoreV1Operations_ListNamespacedPodWithHttpMessagesAsync[T](String namespaceParameter, Nullable1 allowWatchBookmarks, String continueParameter, String fieldSelector, String labelSelector, Nullable1 limit, String resourceVersion, String resourceVersionMatch, Nullable1 sendInitialEvents, Nullable1 timeoutSeconds, Nullable1 watch, Nullable1 pretty, IReadOnlyDictionary2 customHeaders, CancellationToken cancellationToken)
at k8s.AbstractKubernetes.k8s.ICoreV1Operations.ListNamespacedPodWithHttpMessagesAsync(String namespaceParameter, Nullable1 allowWatchBookmarks, String continueParameter, String fieldSelector, String labelSelector, Nullable1 limit, String resourceVersion, String resourceVersionMatch, Nullable1 sendInitialEvents, Nullable1 timeoutSeconds, Nullable1 watch, Nullable1 pretty, IReadOnlyDictionary2 customHeaders, CancellationToken cancellationToken) at k8s.CoreV1OperationsExtensions.ListNamespacedPodAsync(ICoreV1Operations operations, String namespaceParameter, Nullable1 allowWatchBookmarks, String continueParameter, String fieldSelector, String labelSelector, Nullable1 limit, String resourceVersion, String resourceVersionMatch, Nullable1 sendInitialEvents, Nullable1 timeoutSeconds, Nullable1 watch, Nullable`1 pretty, CancellationToken cancellationToken)
at SlimFaas.Kubernetes.KubernetesService.ListFunctionsAsync(String kubeNamespace)
at SlimFaas.ReplicasService.SyncDeploymentsAsync(String kubeNamespace)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)
at System.Threading.Tasks.Task.Wait(Int32, CancellationToken)
at System.Threading.Tasks.Task.Wait()
at Program.

$(String[] args)

@tg123
Copy link
Member Author

tg123 commented Nov 27, 2023

@guillaume-chervet aot is not fully ready, i am still working on it.
reflection is still required

@guillaume-chervet
Copy link

I have that with trimming mode in .net8.0.

@guillaume-chervet
Copy link

guillaume-chervet commented Nov 27, 2023

Is it possible to annotate method with DynamicallyAccessedMembers attribute to make library buildable with trimming activated?
I do not find a solution @tg123

@IvanJosipovic
Copy link
Contributor

I think merging #1311 will unblock folks until the final solution is done.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants