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

Bugfix: Default output folder created on plugin edit/generate #5533

Merged
merged 6 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Fixed cyclic depencies in generated Go code. [#2834](https://github.com/microsoft/kiota/issues/2834)
- Fixed cyclic dependencies in generated Go code. [#2834](https://github.com/microsoft/kiota/issues/2834)
- Fixed a bug where default output folder is created on plugin edit and generate commands. [#5510](https://github.com/microsoft/kiota/issues/5429)

## [1.19.0] - 2024-10-03

### Added

- Control generated type access modifier for C# via `--type-access-modifier` flag. [#4788](https://github.com/microsoft/kiota/issues/4788)
-

### Changed

Expand All @@ -40,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed registration of default serialization and deserialization classes in client constructor. [#5478](https://github.com/microsoft/kiota/pull/5478)
- Fixed incorrect type name generation in aliased scenario in TS due to broad searching of types in root namespaces. [#5404](https://github.com/microsoft/kiota/issues/5404)
- Fixed incorrect type mapping in request builders with subsequent paths with the same name. [#5462](https://github.com/microsoft/kiota/issues/5462)
- Fixed multipart generation to default Content-Types are defined for multipart [#5504](https://github.com/microsoft/kiota/issues/5504)
- Fixed multipart generation to default Content-Types are defined for multipart [#5504](https://github.com/microsoft/kiota/issues/5504)

## [1.18.0] - 2024-09-05

Expand Down
2 changes: 1 addition & 1 deletion src/kiota/Handlers/Plugin/EditHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@
Configuration.Generation.Operation = ConsumerOperation.Edit;
if (pluginAuthType.HasValue && !string.IsNullOrWhiteSpace(pluginAuthRefId))
Configuration.Generation.PluginAuthInformation = PluginAuthConfiguration.FromParameters(pluginAuthType, pluginAuthRefId);
var (loggerFactory, logger) = GetLoggerAndFactory<KiotaBuilder>(context, Configuration.Generation.OutputPath);
var (loggerFactory, logger) = GetLoggerAndFactory<KiotaBuilder>(context, $"./{DescriptionStorageService.KiotaDirectorySegment}");
using (loggerFactory)
{
await CheckForNewVersionAsync(logger, cancellationToken).ConfigureAwait(false);
logger.AppendInternalTracing();
logger.LogTrace("configuration: {configuration}", JsonSerializer.Serialize(Configuration, KiotaConfigurationJsonContext.Default.KiotaConfiguration));

Check warning on line 78 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)

Check warning on line 78 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)

try
{
Expand Down Expand Up @@ -126,10 +126,10 @@
DisplayGenerateAdvancedHint(includePatterns ?? [], excludePatterns ?? [], string.Empty, manifestPath, "plugin edit");
return 0;
}
catch (Exception ex)

Check warning on line 129 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)

Check warning on line 129 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)
{
#if DEBUG
logger.LogCritical(ex, "error editing the plugin: {exceptionMessage}", ex.Message);

Check warning on line 132 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)

Check warning on line 132 in src/kiota/Handlers/Plugin/EditHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
throw; // so debug tools go straight to the source of the exception when attached
#else
logger.LogCritical("error editing the plugin: {exceptionMessage}", ex.Message);
Expand Down
2 changes: 1 addition & 1 deletion src/kiota/Handlers/Plugin/GenerateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
string className = context.ParseResult.GetValueForOption(ClassOption) ?? string.Empty;
bool refresh = context.ParseResult.GetValueForOption(RefreshOption);
CancellationToken cancellationToken = context.BindingContext.GetService(typeof(CancellationToken)) is CancellationToken token ? token : CancellationToken.None;
var (loggerFactory, logger) = GetLoggerAndFactory<KiotaBuilder>(context, Configuration.Generation.OutputPath);
var (loggerFactory, logger) = GetLoggerAndFactory<KiotaBuilder>(context, $"./{DescriptionStorageService.KiotaDirectorySegment}");
using (loggerFactory)
{
await CheckForNewVersionAsync(logger, cancellationToken).ConfigureAwait(false);
logger.AppendInternalTracing();
logger.LogTrace("configuration: {configuration}", JsonSerializer.Serialize(Configuration, KiotaConfigurationJsonContext.Default.KiotaConfiguration));

Check warning on line 31 in src/kiota/Handlers/Plugin/GenerateHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)

Check warning on line 31 in src/kiota/Handlers/Plugin/GenerateHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Use PascalCase for named placeholders. (https://rules.sonarsource.com/csharp/RSPEC-6678)
try
{
var workspaceStorageService = new WorkspaceConfigurationStorageService(Directory.GetCurrentDirectory());
Expand Down Expand Up @@ -71,7 +71,7 @@
}
return 0;
}
catch (Exception ex)

Check warning on line 74 in src/kiota/Handlers/Plugin/GenerateHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)

Check warning on line 74 in src/kiota/Handlers/Plugin/GenerateHandler.cs

View workflow job for this annotation

GitHub Actions / Build

Either log this exception and handle it, or rethrow it with some contextual information. (https://rules.sonarsource.com/csharp/RSPEC-2139)
{
#if DEBUG
logger.LogCritical(ex, "error generating the plugin: {ExceptionMessage}", ex.Message);
Expand Down
Loading