Client generation error with NJsonSchema 11 Preview with NetTopologySuite geometries

I'm in the process of upgrading a .NET 7 based solution which uses Nswag assembly scanning to .NET 8 with the .csproj approach.
I get an error with our use of NetTopologySuite geometries on the upgraded solution:
dotnet "C:\Users\pm\.nuget\packages\nswag.msbuild\14.0.0-preview012\buildTransitive\../tools/Net80/dotnet-nswag.dll" run nswag.json /variables:Configuration=Debug
NSwag command line tool for .NET Core Net80, toolchain v<IP_ADDRESS> (NJsonSchema v<IP_ADDRESS> (Newtonsoft.Json v<IP_ADDRESS>))
Visit http://NSwag.org for more information.
NSwag bin directory: C:\Users\pm\.nuget\packages\nswag.msbuild\14.0.0-preview012\tools\Net80

Executing file 'nswag.json' with variables 'Configuration=Debug'...
Launcher directory: C:\Users\pm\.nuget\packages\nswag.msbuild\14.0.0-preview012\tools\Net80
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidOperationException: The JSON property 'item' is defined multiple times on type 'NetTopologySuite.Geometries.Coordinate'.
   at NJsonSchema.Generation.SystemTextJsonReflectionService.GenerateProperties(JsonSchema schema, ContextualType contextualType, SystemTextJsonSchemaGeneratorSettings settings, JsonSchemaGenerator schemaGenerator, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.ReflectionServiceBase`1.NJsonSchema.Generation.IReflectionService.GenerateProperties(JsonSchema schema, ContextualType contextualType, JsonSchemaGeneratorSettings settings, JsonSchemaGenerator schemaGenerator, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateObject(JsonSchema schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateObject(JsonSchema schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](TSchemaType schema, ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](Type type, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate(Type type, JsonSchemaResolver schemaResolver)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateObject(JsonSchema schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](TSchemaType schema, ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateArray[TSchemaType](TSchemaType schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](TSchemaType schema, ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NJsonSchema.Generation.JsonSchemaGenerator.AddProperty(JsonSchema parentSchema, ContextualAccessorInfo property, JsonTypeDescription propertyTypeDescription, String propertyName, Attribute requiredAttribute, Boolean hasRequiredAttribute, Boolean isNullable, Object defaultValue, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.SystemTextJsonReflectionService.GenerateProperties(JsonSchema schema, ContextualType contextualType, SystemTextJsonSchemaGeneratorSettings settings, JsonSchemaGenerator schemaGenerator, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.ReflectionServiceBase`1.NJsonSchema.Generation.IReflectionService.GenerateProperties(JsonSchema schema, ContextualType contextualType, JsonSchemaGeneratorSettings settings, JsonSchemaGenerator schemaGenerator, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateInheritance(ContextualType type, JsonSchema schema, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateObject(JsonSchema schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateObject(JsonSchema schema, JsonTypeDescription typeDescription, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](TSchemaType schema, ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.Generate[TSchemaType](ContextualType contextualType, JsonSchemaResolver schemaResolver)
   at NJsonSchema.Generation.JsonSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NSwag.Generation.OpenApiSchemaGenerator.GenerateWithReferenceAndNullability[TSchemaType](ContextualType contextualType, Boolean isNullable, JsonSchemaResolver schemaResolver, Action`2 transformation)
   at NSwag.Generation.AspNetCore.Processors.OperationResponseProcessor.Process(OperationProcessorContext operationProcessorContext)
   at NSwag.Generation.AspNetCore.AspNetCoreOpenApiDocumentGenerator.RunOperationProcessors(OpenApiDocument document, ApiDescription apiDescription, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, List`1 allOperations, OpenApiDocumentGenerator generator, OpenApiSchemaResolver schemaResolver)
   at NSwag.Generation.AspNetCore.AspNetCoreOpenApiDocumentGenerator.AddOperationDescriptionsToDocument(OpenApiDocument document, Type controllerType, List`1 operations, OpenApiDocumentGenerator swaggerGenerator, OpenApiSchemaResolver schemaResolver)
   at NSwag.Generation.AspNetCore.AspNetCoreOpenApiDocumentGenerator.GenerateApiGroups(OpenApiDocumentGenerator generator, OpenApiDocument document, IGrouping`2[] apiGroups, OpenApiSchemaResolver schemaResolver)
   at NSwag.Generation.AspNetCore.AspNetCoreOpenApiDocumentGenerator.GenerateAsync(ApiDescriptionGroupCollection apiDescriptionGroups)
   at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.GenerateDocumentWithDocumentProviderAsync(IServiceProvider serviceProvider) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 245
   at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.GenerateDocumentAsync(IServiceProvider serviceProvider, String currentWorkingDirectory) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 239
   at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiGeneratorCommandEntryPoint.Process(String commandContent, String outputFile, String applicationName) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs:line 29
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at NSwag.AspNetCore.Launcher.Program.Main(String[] args) in /_/src/NSwag.AspNetCore.Launcher/Program.cs:line 132
System.InvalidOperationException: Swagger generation failed with non-zero exit code '1'.
   at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 195
   at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in /_/src/NSwag.Commands/NSwagDocumentBase.cs:line 270
   at NSwag.Commands.NSwagDocument.ExecuteAsync() in /_/src/NSwag.Commands/NSwagDocument.cs:line 67
   at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in /_/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 76
   at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in /_/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 33
   at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
   at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
   at NSwag.Commands.NSwagCommandProcessor.ProcessAsync(String[] args) in /_/src/NSwag.Commands/NSwagCommandProcessor.cs:line 62

For testing purposes, i switched the .NET 7 version over to the .csproj approach where it worked.
I prepared a minimal sample repository with 2 projects (MsBuild AfterBuildTarget):
https://github.com/rootix/NJsonSchemaIssue

Net70NJsonSchema10 happily generates the api.ts (ignore the missing Point type, we import it in extensions on the client code)
Net80NJsonSchema11 throws the mentioned exception

Everything except the updated .NET version and the updated Packages (Nswag 14 Preview 12) is the same.
Am i missing something? I tried to add "Coordinate" to the ExcludedTypeNames, but with no luck. And it worked in the older version anyway.
Thanks for the help!

Using the AddOpenApiDocument call to set a flat hierarchy solves the first issue and allows compilation again.
namespace Net80NJsonSchema11;

using System.Text.Json;
using NJsonSchema;
using NJsonSchema.Generation;

public class Program
{
    public static void Main(string[] args)
    {
        var builder = WebApplication.CreateBuilder(args);
        builder.Services.AddEndpointsApiExplorer();
        builder.Services.AddOpenApiDocument(c =>
        {
            c.SchemaSettings = new SystemTextJsonSchemaGeneratorSettings
            {
                SchemaType = SchemaType.OpenApi3,
                FlattenInheritanceHierarchy = true,
            };
        });
        builder.Services.AddControllers().AddJsonOptions(o => o.JsonSerializerOptions.Converters.Add(new NetTopologySuite.IO.Converters.GeoJsonConverterFactory()));
        // builder.Services.AddSwaggerDocument();

        var app = builder.Build();
        app.MapControllers();

        app.Run();
    }
}

If you exclude further types, e.g "excludedTypeNames" in nswag.json:        "LazyOfPrecisionModel",  "SortIndexValue"
the generated api.ts is basically the same as with sdk 7.
But in both version (7 / 8) the OpenApi definition while using NetTopologySuite NetTopologySuite is misleading or wrong, hence the reason why you exclude types or I use for very restricted use cases ITypeMapper.

Thanks for your investigation! The generation works indeed on my way more complex case.
But i can't handle the flat hierarchy in our project. I have different types where inheritance is essential in the client code and additionally i use the JsonInheritanceConverter which completly breaks by setting this flag. There is no discriminator or mapping code for child classes anymore.
I understand that NetTopology is not serializable. That is the reason why they provide a GeoJson package for conversion (Newtonsoft and System.Text.Json) that we use on the API at runtime. I saw that you configured the SchemaSettings with SystemTextJsonSchemaGeneratorSettings where i can define custom json serializer options and had hope that i can register the geometry factory there to make them serializable. But i still get the same Exception as reported.
Since this worked with NJsonSchema 10 (or because of .NET 7?), is this now a problem that can be solved in NJsonSchema 11 to get it wo work again or am i out of luck here?

For a restricted subset of GeoJson I found the use of ITypeMapper the most convenient solution. In your example add the typemapper for Point at startup. FlattenInheritanceHierarchy is no longer necessary.
namespace Net80NJsonSchema11;
public class Program
{
    public static void Main(string[] args)
    {
        var builder = WebApplication.CreateBuilder(args);
        builder.Services.AddOpenApiDocument(c =>
        {
            c.SchemaSettings.TypeMappers.Add(new PointTypeMapper());
        });
        builder.Services.AddControllers().AddJsonOptions(o => o.JsonSerializerOptions.Converters.Add(new NetTopologySuite.IO.Converters.GeoJsonConverterFactory()));

        var app = builder.Build();
        app.UseOpenApi();
        app.MapControllers();
        app.UseSwaggerUi(options =>
        {
            options.Path = "/openapi";
        });

        app.Run();
    }
}

Typemapper for GeoJson Point type
using NetTopologySuite.Geometries;
using NJsonSchema;
using NJsonSchema.Generation.TypeMappers;

namespace Net80NJsonSchema11;

// see also for specification https://app.swaggerhub.com/apis/OlivierMartineau/GeoJSON/1.0.0#
class PointTypeMapper : ITypeMapper
{
    public void GenerateSchema(JsonSchema schema, TypeMapperContext context)
    {
        if (context.Type == typeof(Point))
        {
            var hasSchema = context.JsonSchemaResolver.HasSchema(typeof(Point), false);
            schema.Type = JsonObjectType.Object;
            schema.Description = "GeoJSON Point";
            schema.Properties.Add("type", new JsonSchemaProperty
            {
                Type = JsonObjectType.String,
                IsRequired = true,
                Example = "Point",
            });
            schema.Properties.Add("coordinates", new JsonSchemaProperty
            {
                Type = JsonObjectType.Array,
                Item = new JsonSchema
                {
                    Type = JsonObjectType.Number
                },
                IsRequired = true,
                Example = new double[] { 8.541694, 47.376888 },
                MinItems = 2,
                MaxItems = 3,
                Description = "A position is an array of numbers. There MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element."
            });
            if (!hasSchema)
            {
                context.JsonSchemaResolver.AddSchema(typeof(Point), false, schema);
            }

        }
    }

    public Type MappedType => typeof(Point);
    public bool UseReference => true;
}

The excludedTypeNames are no longer necessary. This approach gives you a correct JSON (by  o.JsonSerializerOptions.Converters.Add(new NetTopologySuite.IO.Converters.GeoJsonConverterFactory())) and a API definition which is for this usecase correct.

Thanks @RobSlgm for your your example! I wrote type mappers for almost the complete spec even if i still have to exclude them on the client side since the use of geojson.js (And despite the generated open api spec looks the same as the reference, the client is generated differently, but this is another problem). But it makes the Swagger UI more useful.
I got things working for me and this issue is therefore resolved. I'm not sure whether something with the reflection stuff is broken or if this is an intended / not relevant behaviour tho.


Add a more complete example

Something along these lines. Will tweak a bit more.
Closes #8.

Heh, I didn't actually realise insert picks up all changes! Good to know. I'm gonna experiment more with my Bevy-based Twitch overlay and then come back to this example today or tomorrow. In a way it'd be nice to demonstrate different behaviours for each table, rather than something which really could be a generic function!


What SQL Server / EF datatype required to sync 'object' from the local store

I've edited this, but I guess the question remains - does object map to a varbinary(max) data type in SQL Server?  What is type object in the store intended to represent?
My unedited question was how to store a JavaScript object in the database... duh... string (varchar(max)) and then I'll use JSON.parse() to cast it as a JavaScript object.

I'll save it as a string, and use


OpenSgid layers not printing from ArcPro 2.9.2

Im on windows 10 virtual machine on a macbook....if I print or export (pdf / png) a map containing opensgid layer, only a couple of layers draw on the resulting page/graphic.

@bert-granberg This sounds like it might be better handled be esri support. But to help narrow things down for the purpose of the OpenSGID and this issue, would you try a few things to help narrow the problem?

To see if this is a Pro issue, try printing from ArcMap.
To see if this is an OpenSGID issue, try printing from another PostGIS database. I'm not aware of any at the moment but maybe someone else know?

I'm curious to hear how this works for you.
Thanks in advance

Hey @bert-granberg I wanted to check in and see if you have any updates for this issue.
As a side note, @ZachBeck has noticed a very similar issue with all local data. The suggestion was to rebuild the spatial index. This may be a pro 2.9.2 issue.

Sorry, I got pulled away on a variety of other topics...will try to do the
tests later this week.
On Mon, Mar 28, 2022 at 4:13 PM steveoh @.***> wrote:

Hey @bert-granberg https://github.com/bert-granberg I wanted to check
in and see if you have any updates for this issue.
As a side note, @ZachBeck https://github.com/ZachBeck has noticed a
very similar issue with all local data. The suggestion was to rebuild the
spatial index. This may be a pro 2.9.2 issue.
—
Reply to this email directly, view it on GitHub
https://github.com/agrc/open-sgid/issues/28#issuecomment-1081205578, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ADDXGGTNLE7OJHSO75TZ3SLVCIVIFANCNFSM5RMDAZLQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

--

Bertrand Granberg
@.***

@bert-granberg I'm going to close this in a few days if there is no activity.


On android Path is null

Hi,
Ive upgraded my project from VS2017 to VS2019 and now i am experiencing 2 types of crashes when stopping the recorder.
1 - Path is null (Auto path (string) in the on recorder stopped event is null) also getting the path from the recorder object is null
2 - Path access violation error
Sometimes it works but most of the time i get one of the above errors. (I will post some in depth error messaging later today) The issue seems to be coming from the upgrade of mscorlib 2.0.50 to <IP_ADDRESS>
Does anyone have this issue and know what to do about it?

Can be closed. After clearing all projects and rebuilding the problem was gone.


[OIDC FED DRAFT19] Changes

[x] list entity became entity_type (following national SPID/CIE specs) https://github.com/italia/spid-cie-oidc-django/commit/477d4228f734c0ef5aa6eea46cef42d81dbf822e
[x] list is_leaf is deprecated https://github.com/italia/spid-cie-oidc-django/commit/477d4228f734c0ef5aa6eea46cef42d81dbf822e
[x] trust_chain claim in resolve entity response https://github.com/italia/spid-cie-oidc-django/commit/7e006b4d6026395c2c1a0e5dba9e8d63e0c8c817

Closed with release v0.7.2


Running
./bonsai2_slowdust -i model3_child_compact.tipsy

I get following segmentation fault:
Unknown ENV_VARIABLE:   -- Falling to basic forking method after MPI_Init, unsafe!
Proc id: 0 @ Default , total processes: 1 (mpiInit)
[INIT]	Used settings:
[INIT]	Input  filename model3_child_compact.tipsy
[INIT]	Bonsai filename
[INIT]	Log filename gpuLog.log
[INIT]	Theta: 		0.75		eps: 		0.05
[INIT]	Timestep: 	0.0625		tEnd: 		1
[INIT]	iterEnd:<PHONE_NUMBER>
[INIT]	Use MPI-IO: 	NO
[INIT]	snapshotFile: 	snapshot_	snapshotIter: 	-1
[INIT]	Input file: 	model3_child_compact.tipsy		devID: 		0
[INIT]	Remove dist: 	-1
[INIT]	Rebuild tree every 1 timestep
[INIT]	Runtime logging is DISABLED
[INIT]	Direct gravitation is DISABLED
[INIT]	Tglow = 0
[INIT]	dTglow = 1
[INIT]	stereo = 0
[INIT]	Code is built WITHOUT MPI Support
File version: 32550
Proc: 0 Bootup times: Tree/MPI: 1.96776 Threads/log: 7.41482e-05 IC-model: 0
Unable to open file `../images/Carina_cross.ppm'
Loaded `../images/deepfield1_1k.ppm', 1024 x 1024
Loaded `../images/deepfield2_1k.ppm', 1024 x 1024
Loaded `../images/deepfield3_1k.ppm', 1024 x 1024
Loaded `../images/deepfield4_1k.ppm', 1024 x 1024
Loaded `../images/deepfield5_1k.ppm', 1024 x 1024
Loaded `../images/deepfield6_1k.ppm', 1024 x 1024
Errors during OpenGL init: cannot set while device is active in this process  /home/doserbd/git/Bonsai.treecode/runtime/renderer/SmokeRenderer.cpp:191
Vendor: NVIDIA Corporation
Renderer: GeForce GTX 750 Ti/PCIe/SSE2
image size: 1920 1200
downsampled size: 960 600
Couldn't open camera file 'cameras.txt'
image size: 1920 1200
downsampled size: 960 600
image size: 1920 1176
downsampled size: 960 588
Segmentation fault (core dumped)

Any help appreciated.

This likely means that you do not have enough stack space.  Try setting it to unlimited and run again:
$ ulimit -s unlimited
$ ./bonsai2_slowdust ...

Works perfect. Thanks for your fast and great help.


Specify the behaviour when overwriting files, symlinks or directories

See original issue on GitLab
In GitLab by [Gitlab user @jmacarthur] on Jul 17, 2018, 14:57
Background
When layering one artifact on top of another, we will find some directory entries which are the same in the existing directory tree as in the new tree. In most cases, the entry in the old world disappears and is replaced by the new one, except:

Overwriting a directory with another directory should cause a merge, not a replacement
Overwriting a symlink to a directory with another directory should cause a merge at the symlink's target.

These are probably obvious, but I think they should be explicitly stated.
The third case:

Overwriting a file with a directory

Currently causes a crash in BuildStream. Should this be a straight replacement? We definitely need a test for it.
Task description

[ ] Figure out the specification
[ ] Add the rules to the documentation
[ ] Add a test for these rules

Acceptance Criteria

Rules are explicitly stated in the documentation

Tests now cover all cases of replacing X with Y, where X and Y can be:

An ordinary file
A symlink to file
A symlink to directory
A broken symlink
A directory

In GitLab by [Gitlab user @juergbi] on Aug 13, 2018, 09:48
mentioned in merge request !481

In GitLab by [Gitlab user @jmacarthur] on Oct 3, 2018, 09:32
Now up at https://wiki.gnome.org/Projects/BuildStream/ImportRules - any edits welcom.

In GitLab by [Gitlab user @jmacarthur] on Oct 3, 2018, 09:32
closed


Metrics 2.0 - Deprecate @Counted

DO NOT MERGE - This is meant for the MicroProfile Metrics community to discuss potential changes to the spec and tck.

@pilhuhn Hi, are you planning to continue with this PR ?

@sberyozkin Probably not. But I want to first @jmartisk have a look if he can (re) use anything of this for the new "real" implementation in SmallRye.
But then I guess you can close it and he can look at the closed one.

Thanks; I'll look and perhaps use some inspiration from it. If this should be closed then so be it.

@pilhuhn @jmartisk thanks, no problems at all with keeping it open for now. We can close it in a couple of months or so :-) and indeed if needed the closed one will always be here

Hi @pilhuhn @jmartisk, it has been nearly 3 months since the last time we discussed the option of keeping this PR open, so if won't object I will close it, in the next day or two. It can be reopened at any time...thanks

Yeah this can be closed, it was pretty much replaced by https://github.com/smallrye/smallrye-metrics/pull/41 in SmallRye

Thanks :-)


Resample transform

Create a ResampleTransform that - similar to the MatchSamplingRate adjustes the sampling rate of one/multiple time series features to a given value.
This transformation could be used as a "decimate" to reduce the sample rate or as an interpolate to increase the sample rate.

Done in #122.


Cursor not disappearing when song is selected.

When the map starts the cursor just stays on the screen. not very major but it kills the ocd

As something to note, Rush doesn't provide a cursor to replace the default cursor, so unconditionally accepting positional input will lead to the cursor always being invisible. This could pose a UX problem for mouse users, since it is significantly harder to tell where the cursor is, when compared to only disappearing in certain areas, preventing/slowing them from clicking the pause button in the bottom right.
Mania, ctb, and taiko only hides the default cursor within the playfield boundaries, which is likely due to the above consideration. (osu has a custom cursor)

I think what we have is consistent with all other rulesets as mentioned above, therefore I don't believe this to be an issue we should resolve here.

Closing as this is an intended behavior.
If it really bugs you, you could move the cursor to within the playfield to make it disappear.


[Improvement] Add more logs about data flush

What changes were proposed in this pull request?

Exposing more info for DataFlushEvent when logging
Add logs when storage selected is null

Why are the changes needed?

I found sometimes some events are flushed failed but have no related logs, maybe this is caused by the null storage selected. So let's add some logs firstly.

Does this PR introduce any user-facing change?
No
How was this patch tested?
Don't need

Minor improvement. PTAL @advancedxy

Codecov Report

Merging #482 (accfa3a) into master (f4048fc) will decrease coverage by 2.36%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #482      +/-   ##
============================================
- Coverage     61.76%   59.40%   -2.37%
+ Complexity     1704     1570     -134
============================================
  Files           200      193       -7
  Lines         10305    10188     -117
  Branches       1024      901     -123
============================================
- Hits           6365     6052     -313
- Misses         3589     3755     +166
- Partials        351      381      +30

Impacted Files
Coverage Δ

...g/apache/uniffle/server/ShuffleDataFlushEvent.java
83.67% <100.00%> (+0.34%)
:arrow_up:

...org/apache/uniffle/server/ShuffleFlushManager.java
84.04% <100.00%> (+0.08%)
:arrow_up:

...storage/handler/impl/DataSkippableReadHandler.java
83.78% <0.00%> (-2.71%)
:arrow_down:

...rg/apache/hadoop/mapred/RssMapOutputCollector.java

...pache/hadoop/mapreduce/task/reduce/RssShuffle.java

.../hadoop/mapreduce/task/reduce/RssBypassWriter.java

...preduce/task/reduce/RssRemoteMergeManagerImpl.java

...apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java

...pache/hadoop/mapreduce/task/reduce/RssFetcher.java

.../hadoop/mapreduce/task/reduce/RssEventFetcher.java

... and 12 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


MiniMegaHub Serial

Communication between the MiniMega Hub and other modules seems to have mixed results. The Motor Control Module generally can communicate messages back and forth, but at certain times, the Serial.println will spit out garbage from the Mega and I can't seem to grab command values correctly from the rf module. (The input gets scrambled due to buffer overflows from the Usb library I believe)

When using Serial3 on the MegaMiniHub, the program will flash to the Arduino, but won't be read back (IDE declares it unsuccessful)

When using Serial1 instead of Serial3, the program flashes fine, but Serial0 (declared just Serial in program) baud rate is changed to whatever Serial1 is using.

Turns out that this was related to the Serial chip used on the MiniMega Hub. Switched Arduinos and the Serial works much better.


supertux 0.4.0

homepage now pointing to our domain
support for building 0.1.3 removed, 0.4.0 is new stable
removed inreplace ..., which is said to be not needed anymore (however should be tested since I don't have a Mavericks machine)

Thanks so much! Merged in 1ded6b840281c9ec311a2b2ab9676c35e9c57b49.


Build Workflow dynamically while calling other servers

Summary
Argo controller need the ability to talk with another server
Motivation
For the workflow template, we would like to store it like a DB, and this template would be easier to manage. As a result, we hope Argo can talk with the DB to get the template information, then build a workflow. Similarly, we would like Argo to talk with our server to check user information in the workflow Yaml. however, these have to be done via outside the certification server. As a result, we hope Argo can provide the hook to other servers while keeping the framework safe and clean.
Proposal
How do you think this should be implemented?
Hope to learn advice from you.

Message from the maintainers:
If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

See #2847

@alexec thanks Alex, I would like to see how to do it.

This can be done by dynamically creating Workflows with the Workflow-of-Workflows pattern


set root log level from zappa log_level

Description
Per ticket #1336, this P/R reverts part of PR #1277 to restore Zappa's prior functionality of setting the root log level.
PR #1277 (inadvertently?) broke cloudwatch logging for many users who use logging.info("") via Zappa's log_level = "INFO" or "DEBUG".  Previously (before PR #1277 and 0.59.0), Zappa would set the root logger with Zappa's log_level.   After 0.59.0, this functionality was removed via PR #1277.
This P/R restores the old log_level functionality, while still preserving the goal of PR #1277 to have separate loggers.
This P/R also adds unit tests to confirm logging is working as expected for the future.  This P/R was tested locally on Python 3.8, 3.9, 3.10, 3.11, and 3.12, and in real AWS Lambda per the contributor guidelines.
GitHub Issues
See #1336

Hi Zappa Maintainers - any interest in merging this P/R to fix an issue introduced in 0.59.0?

coverage: 74.662% (+0.01%) from 74.648%
when pulling 96792a26094ac091d44661c55ff6964c7d545826 on ceturc:set-root-log-level
into b00312d35a1ff57923053e5e8e60857e1f0d6912 on zappa:master.


Issue 13110 - Allow -run as the last argument

https://issues.dlang.org/show_bug.cgi?id=13110
Not sure about the test.

Will close this as it doesn't seem to be useful enough.


fix(conf) set nginx_user to 'kong kong' if it exists

If we install and run Kong with everything default, whenever Kong tries
to write something to the Kong prefix, things will break and we will get
a permission denied error.
This applies to:

DP nodes trying to write the config.json.gz file to the Kong prefix

go pluginserver trying to write the go.lua file write to the Kong prefix

Lua plugins trying to write files to the Kong prefix

And other cases. This is because, by default, the Kong prefix is owned
by root. When we do a apt-get install or yum install, the
/usr/local/kong/ prefix is owned by root by default. After that, if we
do a kong start without changing our $USER, the nginx master process
will be run as root and the nginx workers processes will be run as
nobody. It means that if we do everything default, the nginx workers
processes can’t write anything to the Kong prefix and we’ll get the
permission denied errors.
There are a few immediate workarounds for this:

add the user nginx_user to the root group; or

change the file system permissions to allow the nginx_user the
ability to write the cache file to /usr/local/kong with something like
chown $nginx_user:$nginx_user /usr/local/kong/cache_config.gz; chmod 750 /usr/local/kong/config.cache.json.gz); or

allow every user to write to /usr/local/kong with something like
chmod -R 755 /usr/local/kong (this is what was done in the ticket)

All of these workarounds are dangerous and hacky and we don’t document
any of these as recommended fixes. We should fix the root cause of the
issue. Here are the possibilities:

write files somewhere where any user has permissions, like /tmp. Maybe
even create a kong_prefix/tmp folder where it's explicitly said that
anyone has permissions over it (suggested by lluis).

set nginx_user to kong by default (instead of nobody). This will
require the non-root capability that we’re currently working on at
kong-build-tools: https://github.com/Kong/kong-build-tools/pull/339
(it will create a kong user and then chown and chmod the files and
directories owned by the kong package permissions to the kong user)

Out of those two I went with 2). I think 1) is a hack, we’d need to
repeat it everywhere we write files in the Kong prefix (Kong codebase,
Lua plugins, Go pluginserver, etc). It is also dangerous. IMO 2) is a
more general solution. Since nginx worker processes will be owned by
the kong user, things that try to write to the Kong prefix won't fail (the
/usr/local/kong prefix will be owned by the kong user by default upon
package installation after https://github.com/Kong/kong-build-tools/pull/339 is merged).
The idea of this PR is to fix the permission denied errors when running
Kong with the default settings without causing any breaking changes
(if the kong user does not exist, the user will be dropped to nobody
as it was before). If nginx_user is set to something else other than
nobody (default), we won't change anything.
I'm not sure where would be the ideal place to implement 2), my first
attempt is here in this commit with changes to the file
kong/conf_loader/init.lua.

I think we can also do something like this: https://github.com/Kong/kong/pull/6422 but the drawback is that it's more aggressive (it assumes that the kong will always exist).

Unless I'm reading it incorrectly, the behavior described in this PR is a breaking change with regard to how the default settings of nginx_user work, and thus, even if we decide that this would be the right thing to do, it could only be done in Kong 3.0. Is that the case or am I misreading the proposed behavior change?

Unless I'm reading it incorrectly, the behavior described in this PR is a breaking change with regard to how the default settings of nginx_user work, and thus, even if we decide that this would be the right thing to do, it could only be done in Kong 3.0. Is that the case or am I misreading the proposed behavior change?

Here in this PR the proposed behavior change is setting nginx_user = kong kong by default if and only if:

the kong user and kong group exist;
nginx_user is set to nobody nobody (the default today)

Goal is to fix the Permission denieds when running Kong with default settings.
I guess it's ok to wait for Kong 3.0 if this is considered to be a breaking change. But how would we fix the Permission denieds until Kong 3.0?
The PR https://github.com/Kong/kong/pull/6422 assumes that the kong user and group will always exist and doesn't care if nginx_user is set to something else than nobody, so that should be more of a breaking change, no?

@hishamhm @hutchic @dndx any updates?

@murillopaula We've created a task to look closer at this. Thanks for both proposals!

Hi @dndx ready for another review.
Sorry about the force-pushes. I wanted to change the commit msg and rebase against master.

@dndx thanks for your help and for being the reviewer. When merging, please do a squash and merge.