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

[BUG]: ArgumentException when parsing Check(Run/Suite)EventPayload for Enterprise-owned app #2998

Open
1 task done
omsmith opened this issue Feb 4, 2025 · 1 comment · May be fixed by #2999
Open
1 task done

[BUG]: ArgumentException when parsing Check(Run/Suite)EventPayload for Enterprise-owned app #2998

omsmith opened this issue Feb 4, 2025 · 1 comment · May be fixed by #2999
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@omsmith
Copy link

omsmith commented Feb 4, 2025

What happened?

Parsing a CheckRunEventPayload for an Enterprise-owned app results in an ArgumentException.

SimpleJsonSerializer serializer = new();
var payload = serializer .Deserialize<CheckRunEventPayload>( json );

Versions

Octokit.net 14.0.0, net7.0

Relevant log output

System.ArgumentException: Requested value 'enterprise' was not found.
at System.Enum.TryParseByName(RuntimeType enumType, ReadOnlySpan`1 value, Boolean ignoreCase, Boolean throwOnFailure, UInt64& result)
at System.Enum.TryParseInt32Enum(RuntimeType enumType, ReadOnlySpan`1 value, Int32 minInclusive, Int32 maxInclusive, Boolean ignoreCase, Boolean throwOnFailure, TypeCode type, Int32& result)
at System.Enum.TryParse(Type enumType, ReadOnlySpan`1 value, Boolean ignoreCase, Boolean throwOnFailure, Object& result)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.<>c__DisplayClass7_0.<DeserializeEnumHelper>b__1(Object v) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 137
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeEnumHelper(String value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 137
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 160
at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 1494
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 205
at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 1494
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 205
at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 1494
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 205
at Octokit.PocoJsonSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 1494
at Octokit.Internal.SimpleJsonSerializer.GitHubSerializerStrategy.DeserializeObject(Object value, Type type) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 205
at Octokit.SimpleJson.DeserializeObject(String json, Type type, IJsonSerializerStrategy jsonSerializerStrategy) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 590
at Octokit.SimpleJson.DeserializeObject[T](String json, IJsonSerializerStrategy jsonSerializerStrategy) in /home/runner/work/octokit.net/octokit.net/Octokit/SimpleJson.cs:line 602
at Octokit.Internal.SimpleJsonSerializer.Deserialize[T](String json) in /home/runner/work/octokit.net/octokit.net/Octokit/Http/SimpleJsonSerializer.cs:line 22

Code of Conduct

  • I agree to follow this project's Code of Conduct
@omsmith omsmith added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Feb 4, 2025
@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Feb 4, 2025
@omsmith omsmith linked a pull request Feb 4, 2025 that will close this issue
4 tasks
@omsmith
Copy link
Author

omsmith commented Feb 5, 2025

Additional note, this ArgumentException also occurs when creating/updating a Check Run (e.g. client.Check.Run.Create( ... )), since it attempts to parse the response body into a CheckRun object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Status: 🆕 Triage
Development

Successfully merging a pull request may close this issue.

1 participant