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

Release notes plan #9431

Open
richlander opened this issue Jul 25, 2024 · 7 comments
Open

Release notes plan #9431

richlander opened this issue Jul 25, 2024 · 7 comments

Comments

@richlander
Copy link
Member

I'm working on updating our approach to release notes, in particular standardizing on JSON (as the primary format) and providing nice reading experiences with generated markdown (that are easy to adapt).

Relevant PRs and issues:

The process of writing a few JSON and markdown processing/generating tools has helped to inform the plan.

The fundamental question is determining which files are the source for others which are generated. This is obvious for JSON -> markdown generation but less obvious for JSON -> JSON generation.

More broadly, we want to ensure that some files are r/w and others are r/o and that the the r/o files ideally have just one source of data.

This plan isn't very novel. The intent is to document the plan and set expectations.

Details

Our initial efforts with JSON release notes started with releases.json. It's been our workhorse format for a decade now. There is a lot of value to "all release notes for a major release in a single file" as a model. It is also ideal as a source for content generation. We should continue with releases.json as our primary r/w file, using it to generate the other release-specific files.

- `releases.json` -- source
- `release-index.json` -- generated
- `patch-releases-index.json` -- generated
- `release.json` -- generated
- `supported-os.json` -- source
- `os-packages.json` -- source

This means that we'll transition to treating the generated files as r/o and not accept PRs for them (other than via re-running the content generation tool).

There is still a plan to add a cves.json file. I haven't done enough thinking on that yet. I'll get to that after implementing this plan.

I've been developing some tools for this project. They are currently in a personal repo at richlander/distroessed. We should decide where they should go. In theory, the dotnet/core repo is the best place for them. However, I'd like to actually do releases of the tools to make them easy to use. I'd prefer that releases on the dotnet/core repo were dedicated to actual .NET releases. I'm not sure which repo would be a better home.

@richlander
Copy link
Member Author

richlander commented Jul 25, 2024

@Falco20019 @martincostello @omajid @leecow @rbhanda @baronfel

@Falco20019
Copy link
Contributor

You could have a separate repo on dotnet for the tooling. Would make sense also for the nuget package linking to it. Then you can release it as dotnet tool for easy usage as global tool (most propably what you suggested).

@Falco20019
Copy link
Contributor

I just found a minor issue with https://github.com/dotnet/core/blob/main/release-notes/6.0/supported-os.json#L341

10-20h2-e-lts does not exist, only 10-20h2-e which is already correclty in unsupported-versions. If I don't forget it, I will do a PR.

@richlander
Copy link
Member Author

I found that added a $schema node can be a breaking change.

I did the following (in order, going back a bit):

  • Wrote tools to process the various JSON files in the repo.
  • Wrote a tool to generate schema files.
  • Ran the tools.
  • Added [JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Disallow)] to the OM and re-ran the generation tool.
  • Manually added a $schema node to some of the JSON files
  • Time passed
  • Re-ran the tools. They broke.
  • Error: Unhandled exception. System.Text.Json.JsonException: The JSON property '$schema' could not be mapped to any .NET member contained in type 'DotnetRelease.OSPackagesOverview'.
  • Commenting out the JsonUnmappedMemberHandling attribute on the root object in the OM solved the problem.

The long and short of it is the following:

  • Adding a $schema node after the fact can break consumers, if they have their own custom OM.
  • Adding a $schema node prevents the use of JsonUnmappedMemberHandling.Disallow on the root object.

If there is something I'm doing wrong, that would be good to know. I don't think this finding is a huge problem, but it should influence our use of the $schema node and how we construct the schema.

@Falco20019 @eiriktsarpalis

@Falco20019
Copy link
Contributor

Interesting finding. I would assume that JsonUnmappedMemberHandling.Disallow should not check $schema as it's a well-known node. But maybe @eiriktsarpalis can give us more insights. Maybe theres another attribute for setting the schema?

@richlander
Copy link
Member Author

My conclusion is that STJ has no allowance for schemas meaning that the schema node is just another node.

@eiriktsarpalis
Copy link
Member

eiriktsarpalis commented Aug 27, 2024

That's correct, $schema has no special meaning in the context of plain old JSON serialization. Either removing UnmappedMemberHandling or making sure that it is being mapped to a property should resolve this for you:

[JsonPropertyName("$schema")]
public Uri? Schema { get; init; }

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

No branches or pull requests

4 participants