Skip to content

Conversation

@kinyoklion
Copy link
Member

No description provided.

@shortcut-integration
Copy link

@kinyoklion kinyoklion marked this pull request as ready for review September 21, 2022 21:58
version: 2

repo:
public: openfeature-dotnet-server
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to specify repo at all if there's only one repo. Its only purpose is for setting up a public/private relationship.

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool. Will remove that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

template:
name: dotnet6-linux
env:
LD_RELEASE_DOCS_ASSEMBLIES: LaunchDarkly.OpenFeature.ServerProvider
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need to set LD_RELEASE_DOCS_ASSEMBLIES unless you need to document something in addition to, or other than, the assembly you're building.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed

<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>LaunchDarkly.OpenFeature.ServerProvider.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you say more about the reason for doing this instead of using AssemblyInfo.cs?

Besides being (IMO) somewhat harder to read due to the _Parameter1 thing, I think there's a probably unintentional change in behavior here: now it is always setting this property, instead of setting it only in debug builds. In our other projects, we only set InternalsVisibleTo in debug builds. Not only is there no good reason to have it in the release build we publish, but also, I think it may actually make a release build fail because, if we are signing the LaunchDarkly.OpenFeature.ServerProvider assembly (as we normally do for all of our release builds), then it will expect LaunchDarkly.OpenFeature.ServerProvider.Tests to be signed too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will see if I can set it in debug. Doing something like Condition="'$(Configuration)' == 'Debug'" or inverted != Release.

I was moving it because it seemed like assemblyinfo was not really the way people were doing much anymore. Once they added automatic generation at build time of the assemblyinfo as the default.

So, just trying to be modern. But if you feel strongly, I really could not care, and I can move it back.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am also kind of curious what the strong name ecosystem is like now, being as it seems to be changing.
https://learn.microsoft.com/en-us/dotnet/standard/assembly/strong-named

For .NET Core and .NET 5+, strong-named assemblies do not provide material benefits. The runtime never validates the strong-name signature, nor does it use the strong-name for assembly binding.

If you are an open-source developer and you want the identity benefits of a strong-named assembly for better compatibility with .NET Framework, consider checking in the private key associated with an assembly to your source control system.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not to say we don't. Just interesting documentation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made the ItemGroup conditional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like there is a nicer method: dotnet/sdk#3439

That would limit to building with .Net 5 and newer.

Copy link
Member Author

Choose a reason for hiding this comment

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

You could still target net471. Do we have any stance on the build tools supported?

  <ItemGroup Condition="'$(Configuration)'!='Release'">
    <InternalsVisibleTo Include="LaunchDarkly.OpenFeature.ServerProvider.Tests" />
  </ItemGroup>

Sure looks a lot nicer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, "build tools supported" in this case would mean the build tools used to build this library, right? I think developers could still consume the NuGet package we built if they were, for instance, using .NET Core 3.1 tools to build their app and using the .NET Standard 2.0 version of our library. I don't think our platform support/EOL policy is necessarily meant to apply to building our projects from scratch with older tools... although that's a bit of a gray area that we haven't explicitly addressed, so I'll bring it up to the team for discussion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated with the cleaner version.

Copy link
Contributor

Choose a reason for hiding this comment

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

As for whether it's worthwhile to do strong-naming, that's been an ongoing and inconclusive discussion for a long time. It never made any difference in .NET Core, and it still doesn't, and .NET 5+ is equivalent to .NET Core in that regard. It was a thing in .NET Framework, and still is; whether it's still a thing that any of our customers are using, we don't know. But if they are using it for any reason, then it's always possible that they have a build-time policy forbidding any non-strong-named dependencies, so for us to stop doing this could be a breaking change (again, only for .NET Framework).

Copy link
Contributor

@eli-darkly eli-darkly left a comment

Choose a reason for hiding this comment

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

See comments.

@kinyoklion kinyoklion merged commit 5e1ebfd into main Sep 23, 2022
@kinyoklion kinyoklion deleted the rlamb/sc-169461/add-releaser-config branch September 23, 2022 15:52
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.

3 participants