Skip to content

Update to .NET 10, adapt code style to Steeltoe conventions#22

Open
bart-vmware wants to merge 11 commits into
mainfrom
update-net10
Open

Update to .NET 10, adapt code style to Steeltoe conventions#22
bart-vmware wants to merge 11 commits into
mainfrom
update-net10

Conversation

@bart-vmware

@bart-vmware bart-vmware commented Jun 17, 2026

Copy link
Copy Markdown
Member

See the commit messages for details.

Important

This requires a change in Azure: add an environment variable WEBSITES_PORT with value 8080.

@github-actions

Copy link
Copy Markdown

Preview link: https://netcoretoolservice-pr-22.azurewebsites.net/api/new

  • Your changes have been deployed to the preview site. The preview site will update as you add more commits to this branch.
  • The preview link is shareable, but will be deleted when the pull request is merged or closed.

This is an automated message.

@bart-vmware bart-vmware marked this pull request as ready for review June 17, 2026 14:16
@bart-vmware bart-vmware requested a review from TimHess as a code owner June 17, 2026 14:16
using Steeltoe.NetCoreToolService.SteeltoeUtils.Diagnostics;
using Steeltoe.NetCoreToolService.SteeltoeUtils.IO;

#pragma warning disable S2360 // Optional parameters should not be used

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's only one case of this condition in the file, should the exclusion be scoped to that specific instance instead of being file-wide?


if (nvp[0] == "output")
{
output = nvp[1];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While it is a pre-existing condition and probably not too much of a risk, we're using unverified input for the output path here, which could result in unexpected locations for the output. We might want to check for path separators before passing the value along to --output so that we can't end up with a smattering of files in the container that won't get cleaned up.

throw new CommandException($"'{command}' failed to start; no details available");
}
}
catch (Exception exception)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
catch (Exception exception)
catch (Exception exception) when (e is not CommandException)

ArgumentNullException.ThrowIfNull(nuGetId);

private readonly ILogger<NewController> _logger;
await _commandExecutor.ExecuteAsync($"{NetCoreTool.Command} new uninstall {nuGetId}", null, -1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you sure about using an infinite timeout for all of these dotnet command calls?


internal static partial class AboutLogger
{
[LoggerMessage(LogLevel.Debug, "{Program}, version {Version} [{Commit}]")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would be reasonable to have this continue to log at Info, it should only run once at startup


// Configure the HTTP request pipeline.

app.UseAuthorization();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not to say we shouldn't have auth in this service, but as there's none configured we could just remove this line

[
"\r",
"\n",
"\r\n"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think the \r\n entry is currently adding any value here... consider reversing the order of the list entries or dropping the last one

{
using var buffer = new MemoryStream();
using (var archive = new ZipArchive(buffer, ZipArchiveMode.Create, true))
ZipArchiveEntry entry = archive.CreateEntry($"{Path.GetRelativePath(rootPath, path)}{Path.DirectorySeparatorChar}");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know you didn't change this, but the zip spec indicates that only forward slashes are allowed, so what we have now is technically incorrect, at least when running on Windows (but doesn't show up in tests because we look for Path.DirectorySeparatorChar there too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants