Code Monkey home page Code Monkey logo

dotnet-sdk's People

Contributors

baywet avatar ievangelist avatar kfcampbell avatar nickfloyd avatar octokitbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dotnet-sdk's Issues

[FEAT]: Some required API parameters could be made clearer in the SDK

Describe the need

I'm assuming this might require changes in Kiota, so I don't know if this is even the correct place to file this feature request. The API specifies that tag_name is a required parameter for creating a release. Yet, this is not apparent from the ReleasesRequestBuilder.PostAsync(ReleasesPostRequestBody, [...]) method since ReleasesPostRequestBody.TagName is marked as nullable when it should probably be non-nullable and maybe even required. Alternatively, it could be promoted to a required parameter of the PostAsync() method.

SDK Version

v0.0.3

API Version

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

First impressions

Hey folks,

I just took a quick look at pulling this into an existing application of mine and I thought I'd just give you some initial feedback. I didn't get very far as it was hundreds of compiler warnings, so just tweaked a small part of it to get a feel for things.

I realise it's very early and some of it might be things you already know about, so no worries if I'm not telling you anything new.

Also this is intended to be neutral feedback on first impressions, don't take it as positive or negative, just "huh, that's different" observations.

  • It doesn't currently build - there's bits to do with Actions, Packages and Codespaces that don't compile. For now I just deleted those parts as I didn't need to use them in my app anyway.
  • A lot of the member names aren't very ".NET"-y with things like ALLCAPS or have underscores in them. Maybe for a native .NET experience they match the API too closely and look out-of-place for the typical .NET library API surface and need some pre-processing being being emitted as code?
  • There's a lot of namespaces and the sub-namespaces often repeat the parent (e.g. Foo.Item.Item.Bar)
  • There's lots of dictionaries/indexers being used to index/access into things. Might this have performance implications at scale if lots of dictionaries are being allocated to index through the API to be able to do an HTTP call? This also at first glance makes it look like you might have to check the thing you're indexing exists in advance like with a normal Dictionary<K, V> type, rather than it just being deferred execution collecting values until you get to making the actual request.
  • The indexer parameters are all called position. Intellisense when using the API would be easier to reason about if they had the appropriate names (owner, repo, number) etc.
  • Some enums have been dropped (or at least I couldn't find them) that might make it hard-er to migrate an existing code base over. The one I hit was RepositoryVisbility which in Octokit encapsulates the possible public, internal and private values.

Here's an example of some of the above in a single snippet of code using the generated API instead of Octokit.net:

using GitHub.Octokit;

// Really really long and repetitive namespace
using GitHub.Octokit.Repos.Item.Item.Pulls.Item.Reviews;

OctokitClient client = CreateClient(...);

var review = new ReviewsPostRequestBody()
{
    Event = ReviewsPostRequestBody_event.APPROVE, // Underscore and all caps type and member name
};

// Lots of indexers
await client.Repos[owner][name].Pulls[number].Reviews.PostAsync(review);

The Octokit equivalent of the above was:

using Octokit;

IGitHubClient client = CreateClient(...);

var review = new PullRequestReviewCreate()
{
    Event = PullRequestReviewEvent.Approve
};

await client.PullRequest.Review.Create(owner, name, number, review);

I hope the observations are useful.

[BUG]: Fetching check runs for a commit results in a `FormatException`

What happened?

Fetching check runs for a commit results in a FormatException.

Steps to reproduce:

var cli = new GitHubClient(RequestAdapter.Create(new AnonymousAuthentificationProvider()));
var runs = await cli.Repos["discord-net"]["Discord.Net"].Commits["ef9b79672bbe4edd8bf68a809b947bb3cc501935"].CheckRuns.GetAsync();

Stack Trace:

System.FormatException: "One of the identified items was in an invalid format."
   in System.Text.Json.ThrowHelper.ThrowFormatException()
   in System.Text.Json.JsonElement.GetInt32()
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.GetIntValue()
   in GitHub.Models.CheckRun.<GetFieldDeserializers>b__74_9(IParseNode n)
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.AssignFieldValues[T](T item)
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.GetObjectValue[T](ParsableFactory`1 factory)
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.<GetCollectionOfObjectValues>d__17`1.MoveNext()
   in System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   in System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   in GitHub.Repos.Item.Item.Commits.Item.CheckRuns.CheckRunsGetResponse.<GetFieldDeserializers>b__14_0(IParseNode n)
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.AssignFieldValues[T](T item)
   in Microsoft.Kiota.Serialization.Json.JsonParseNode.GetObjectValue[T](ParsableFactory`1 factory)
   in Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__20`1.MoveNext()
   in Microsoft.Kiota.Http.HttpClientLibrary.HttpClientRequestAdapter.<SendAsync>d__20`1.MoveNext()
   in GitHub.Repos.Item.Item.Commits.Item.CheckRuns.CheckRunsRequestBuilder.<GetAsync>d__2.MoveNext()

Versions

octokit/dotnet-sdk v0.0.6
.NET 8

Code of Conduct

  • I agree to follow this project's Code of Conduct

[FEAT]: Friendly API for uploading release assets

Describe the need

I might have missed it, but there doesn't appear to be a friendly API for uploading release assets. In Octokit, this was done like so:

var releaseApi = ghc.Repository.Release;
var release = await releaseApi.Get(...);
await releaseApi.UploadAsset(release, new ReleaseAssetUpload(zipFileName, MediaTypeNames.Application.Zip, stream, timeout));

It would be nice if Octokit.NET.SDK had something similar rather than requiring me to make a manual request using the Release.UploadUrl.

SDK Version

v0.0.3

API Version

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

How can I set a request timeout?

Hi,

With Octokit, I could do:

var ghc = new GitHubClient(...);
ghc.SetRequestTimeout(TimeSpan.FromHours(1)); // Uploading fairly large release assets...

What's the equivalent in Octokit.NET.SDK? ๐Ÿค”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.