ci: Update release notes tracking issue (#22102)

Adds a GitHub actions workflow to update an issue with the current
release notes every time changesets are added or changed on the main
branch. This will provide a continually updated snapshot of what the
release notes will look like when we release.

I also updated some changeset content to better work with the release
note layout. There will be additional changes made in #22067.

---------

Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: jzaffiro <110866475+jzaffiro@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
This commit is contained in:
Tyler Butler 2024-08-06 10:21:26 -07:00 коммит произвёл GitHub
Родитель f348d073a8
Коммит 7db4f5c917
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
10 изменённых файлов: 157 добавлений и 13 удалений

Просмотреть файл

@ -2,22 +2,27 @@
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
section: tree
highlight: true
---
Allow `Record` typed object to be used to construct MapNodes.
✨ New! `Record`-typed objects can now be used to construct MapNodes
It is now allowed to construct MapNodes from `Record` typed objects, similar to how maps are expressed in JSON.
You can now construct MapNodes from `Record` typed objects, similar to how maps are expressed in JSON.
Before this change, an `Iterable<string, Child>` was required, but now an object like `{key1: Child1, key2: Child2}` is allowed.
Full example using this new API:
```typescript
class Schema extends schemaFactory.map("ExampleMap", schemaFactory.number) {}
const fromRecord = new Schema({ x: 5 });
```
This new feature makes it possible for schemas to construct a tree entirely from JSON compatible objects using their constructors,
This new feature makes it possible for schemas to construct a tree entirely from JSON-compatible objects using their constructors,
as long as they do not require unhydrated nodes to differentiate ambiguous unions,
or IFluidHandles (which themselevs are not JSON compatible).
or IFluidHandles (which themselves are not JSON compatible).
Due to limitations of TypeScript and recursive types,
recursive maps do not advertise support for this feature in their typing,

Просмотреть файл

@ -2,12 +2,16 @@
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
section: tree
---
Add `ITreeConfigurationOptions.preventAmbiguity`
The new `ITreeConfigurationOptions.preventAmbiguity` flag can be set to true to enable checking of some additional rules when constructing the `TreeViewConfiguration`.
This example shows an ambiguous schema:
```typescript
const schemaFactory = new SchemaFactory("com.example");
class Feet extends schemaFactory.object("Feet", { length: schemaFactory.number }) {}
@ -21,7 +25,6 @@ const view = tree.viewWith(config);
// This is invalid since it is ambiguous which type of node is being constructed.
// The error thrown above when constructing the TreeViewConfiguration is because of this ambiguous case:
view.initialize({ length: 5 });
```
See the documentation on `ITreeConfigurationOptions.preventAmbiguity` for a more complete example and more details.

Просмотреть файл

@ -1,7 +1,12 @@
---
"@fluidframework/container-loader": minor
---
---
section: deprecation
---
Deprecated summarizeProtocolTree and it's corresponding duplicate ILoaderOptions definition from container layer.
container-loader: summarizeProtocolTree and its corresponding duplicate ILoaderOptions definition is deprecated
summarizeProtocolTree property in ILoaderOptions was added to test single-commit summaries during the initial implementation phase. The flag is no longer required and should no longer be used, so marked it as deprecated. If a driver needs to enable or disable single-commit summaries, it can do so via IDocumentServicePolicies.
The `summarizeProtocolTree` property in ILoaderOptions was added to test single-commit summaries during the initial
implementation phase. The flag is no longer required and should no longer be used, and is now marked deprecated. If a
driver needs to enable or disable single-commit summaries, it can do so via `IDocumentServicePolicies`.

Просмотреть файл

@ -2,8 +2,12 @@
"@fluidframework/tree": minor
"fluid-framework": minor
---
---
section: tree
highlight: true
---
Allow constructing ArrayNodes from Maps and MapNodes from arrays when unambiguous.
✨ New! When unambiguous, ArrayNodes can now be constructed from Maps and MapNodes from arrays
Since the types for ArrayNodes and MapNodes indicate they can be constructed from iterables,
it should work, even if those iterables are themselves arrays or maps.

Просмотреть файл

@ -2,6 +2,9 @@
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
section: tree
---
Implicit TreeNode construction improvements

Просмотреть файл

@ -2,6 +2,9 @@
"fluid-framework": minor
"@fluidframework/tree": minor
---
---
section: tree
---
Enforce use of TreeViewConfiguration's constructor

Просмотреть файл

@ -2,11 +2,14 @@
"fluid-framework": minor
"@fluidframework/runtime-utils": minor
---
---
section: feature
---
Add `isFluidHandle` to check if an object is an `IFluidHandle`.
New `isFluidHandle` type guard to check if an object is an `IFluidHandle`
`isFluidHandle` is now exported and can be used to detect which objects are `IFluidHandle`s.
Since `IFluidHandle` often needs special handling (for example when serializing since its not JSON compatible),
having a dedicated detection function for it is handy.
The `isFluidHandle` type guard function is now exported and can be used to detect which objects are `IFluidHandle`s.
Since `IFluidHandle` often needs special handling (for example when serializing since it's not JSON compatible),
having a dedicated detection function for it is useful.
Doing this detection was possible previously using the `tree` package's schema system via `Tree.is(value, new SchemaFactory("").handle)`,
but can now be done with just `isFluidHandle(value)`.

Просмотреть файл

@ -1,5 +1,8 @@
---
"@fluidframework/tree": patch
"@fluidframework/tree": minor
---
---
section: tree
---
Fix document-corrupting bug when rebasing over move compositions.

6
.github/workflows/data/release-notes-issue-intro.md поставляемый Normal file
Просмотреть файл

@ -0,0 +1,6 @@
This issue is automatically updated with a preview of the release notes for the upcoming Fluid Framework release.
> [!NOTE]
> The table of contents links do not work in this preview, but they will work when the release notes are published.
---

109
.github/workflows/release-notes-issue.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,109 @@
# release-notes-issue.yml
# Updates an issue that tracks release notes with the generated release notes.
# The issue to update is set in the RELEASE_NOTES_ISSUE secret.
name: "Update release notes issue"
on:
push:
branches:
- main
paths:
- ".changeset/**"
# Allow manually triggering this workflow from the web UI
workflow_dispatch:
# This makes the RELEASE_NOTES_ISSUE variable set in the GitHub UI available as an environment variable.
# It's available to all jobs/steps in the workflow.
env:
ISSUE: ${{ vars.RELEASE_NOTES_ISSUE }}
permissions:
issues: write
jobs:
update-issue:
name: Update release notes
runs-on: ubuntu-latest
steps:
# Check out the repo and set up node and pnpm.
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # ratchet:actions/checkout@v4
with:
fetch-depth: "100"
persist-credentials: false
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # ratchet:pnpm/action-setup@v4
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # ratchet:actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
# Get the version of the client release group by reading the root package.json and set it as an output variable.
# This way we can use the version in subsequent steps.
- name: Set version output variable
id: setVersion
run: |
echo "VERSION=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT"
# Install the in-repo build-tools.
- name: Install Fluid build tools
continue-on-error: true
run: |
cd build-tools
pnpm install --frozen-lockfile
pnpm run build:compile
# We want flub available to call, so we run npm link in the build-cli package, which creates shims that are avilable on the PATH
# Use npm link instead of pnpm link because it handles bins better
cd packages/build-cli
npm link
- name: Check build-tools installation
run: |
# Info for debugging
which flub
flub --help
flub commands
# Generates the release notes based on the changesets in the repo. Changes that don't map to known sections WILL
# be included.
- name: Generate release notes file
run: |
flub generate releaseNotes -g client -t minor --includeUnknown --out RELEASE_NOTES.md -v
# Read the release notes file that we just generated into an output variable.
- name: Read release notes file
id: relNotes
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # ratchet:juliangruber/read-file-action@v1
with:
path: ./RELEASE_NOTES.md
# Read the issue intro from a data file and put it in an output variable.
- name: Read issue intro file
id: intro
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # ratchet:juliangruber/read-file-action@v1
with:
path: ${{ github.workspace }}/.github/workflows/data/release-notes-issue-intro.md
# Replace the issue body with the intro; we'll append the new release notes in the next step.
- name: Replace issue body with intro
uses: julien-deramond/update-issue-body@a7fae45395cac5a23318d38f7b09a58650dfe84f # ratchet:julien-deramond/update-issue-body@v1
with:
issue-number: ${{ env.ISSUE }}
body: ${{ steps.intro.outputs.content }}
edit-mode: replace
# Append the release notes we generated to the issue body.
- name: Append release notes to issue body
uses: julien-deramond/update-issue-body@a7fae45395cac5a23318d38f7b09a58650dfe84f # ratchet:julien-deramond/update-issue-body@v1
with:
issue-number: ${{ env.ISSUE }}
body: ${{ steps.relNotes.outputs.content }}
edit-mode: append
# Update the issue title with the (possibly new) version
- name: Update issue title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
NEW_TITLE="Upcoming Release: FluidFramework v${{ steps.setVersion.outputs.VERSION }}"
gh issue edit ${{ env.ISSUE }} --title "$NEW_TITLE"