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

add support for GitHub / Azure Artefacts #602

Merged
merged 5 commits into from
Nov 12, 2023

Conversation

JoC0de
Copy link
Collaborator

@JoC0de JoC0de commented Nov 2, 2023

  • allow fetching updates using registrationsBaseUrl
  • getting single NuGet packages using registrationsBaseUrl
  • add the new settings to Settings-UI

fixes #598
and fixes #589

…ates and getting single NuGet packages using registrationsBaseUrl
@JoC0de JoC0de self-assigned this Nov 2, 2023
@JoC0de JoC0de requested a review from igor84 November 2, 2023 23:02
searchQueryBuilder.Append(' ');
}

searchQueryBuilder.Append($"packageid:{packagesToFetch[i].Id}");
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you are using string interpolation here then perhaps a cleaner solution instead of StringBuilder is to just build a List and then use string.Join(" ", list).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We would need:

var query = string.Join(' ', packagesToFetch.Skip(i).Take(UpdateSearchBatchSize).Select(package => $"{package.Id}_"));
i += UpdateSearchBatchSize;

As there is no Chunk method in older C# we need the index. Not sure if the Unity implementation of the Skip already has optimization for List. Do you think it would make the code more readable, with the Skip / Take?

Another think is we could use AppendFormat as none .Net Core doesn't has the Append overload that takes a AppendInterpolatedStringHandler.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I just thought to replace StringBuilder with List and ToString with string.join leaving everything else the same.

src/NuGetForUnity/Editor/Ui/NugetPreferences.cs Outdated Show resolved Hide resolved
@JoC0de JoC0de merged commit 65f9602 into GlitchEnzo:master Nov 12, 2023
8 checks passed
@JoC0de JoC0de deleted the feature/github-packages-support branch November 12, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants