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

Kkachmar/remove session start metric #21125

Merged
merged 72 commits into from
May 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
71cd392
remove session start metric
kekachmar May 15, 2024
351b466
remove session start metric from deli lambda factory
kekachmar May 16, 2024
0eed9e1
refactor(telemetry-generator): Upgrade eslint config to "recommended"…
Josmithr May 14, 2024
2f0b3fc
refactor(getKeys): Upgrade eslint config to "recommended" and fix vio…
Josmithr May 14, 2024
71c25ef
Skip document corruption if partition is closed (#21077)
shubhi1092 May 14, 2024
5d40cd0
refactor(container-runtime): Tighten up exposure of ContainerRuntime'…
chentong7 May 14, 2024
661db7c
Fix type test symbol handling (#21070)
CraigMacomber May 14, 2024
4676dd6
Make the new summary retry logic the default and remove old logic (#2…
agarwal-navin May 14, 2024
5fc4341
Use post-creation resolved URL to handle discovery pattern (#21080)
ChumpChief May 14, 2024
bd4572f
docs(devtools): Update landing page text (#21084)
alexvy86 May 15, 2024
82a77b0
docs(tree): Update undo and detach trees docs (#20754)
yann-achard-MS May 15, 2024
9cc5df0
Update build-tools and type tests (#21087)
CraigMacomber May 15, 2024
b791744
E2E ephemeral tests with manual payloads (#20874)
Toritos01 May 15, 2024
1d7f8e4
refactor(tree): Enable explicit return type rule and fix violations (…
Josmithr May 15, 2024
73608b8
Add OAuthBearer authentication support for rdkafka (#21058)
andrewstanovsky May 15, 2024
7b72f2f
Offline: Minor refactoring of stashedOps.spec.ts (#21052)
markfields May 15, 2024
97a3796
Test Update to Arrow application to v4 for secretless auth (#21075)
RishhiB May 15, 2024
8743024
Use node's bundled CA on windows (#21096)
Abe27342 May 15, 2024
194b459
feat(tree): Schema validation (#21011)
alexvy86 May 15, 2024
65ce3f4
Use public client auth for odsp e2e flows (#21091)
Abe27342 May 15, 2024
98a60d3
refactor(devtools): Abstracted all Menu-related logic to its own fil…
WayneFerrao May 15, 2024
f91e27a
update remaining arrow app service connections (#21103)
RishhiB May 16, 2024
d95d28b
fix(tree): throw UsageError on invalid move (#21100)
yann-achard-MS May 16, 2024
d72c472
Change ARROW property name (#21104)
sonalideshpandemsft May 16, 2024
98c021e
Respect the odspEndpoint argument if supplied in e2e tests. (#21105)
jatgarg May 16, 2024
ac893e8
Better telemetry for disconnect events: record pendingClientId (#21093)
vladsud May 16, 2024
ada535a
feat(azure-end-to-end-tests): Expand AzureClient e2e tests (#21041)
scottn12 May 16, 2024
e826516
refactor(id-compressor): Cleanup compressor usage in runtime (#21082)
taylorsw04 May 16, 2024
fc7eb6c
[GC] Remove the option to disable GC mark phase (#21101)
agarwal-navin May 16, 2024
041f1bc
fix(build-tools): fluid-build-tasks-eslint deps (#21089)
jason-ha May 16, 2024
9bb886a
Remove plumbing of app secret for odspdf stress (#21113)
Abe27342 May 16, 2024
9739210
Add performance events for test-service-load client election (#21086)
kian-thompson May 16, 2024
854edc5
fix(build): Add ci:test:azureclient:tinylicious:coverage command (#21…
scottn12 May 16, 2024
b459053
refactor(tree): prepare for new sequence field changeset format (#21120)
yann-achard-MS May 16, 2024
915f236
fix(azure-end-to-end-tests): Include AzureClient e2e tests in ci:test…
scottn12 May 16, 2024
ed3cd6c
docs(tree): Add example PRs for making backward-compatible format cha…
Abe27342 May 16, 2024
5fb50af
[Summarization] Added type for the error thrown during summarization …
agarwal-navin May 16, 2024
157701c
Add readme to Example folder (#21119)
nmsimons May 16, 2024
92a063c
Remove format validation from summary load benchmark (#21127)
CraigMacomber May 16, 2024
be2e441
fix(e2e-tests): Improve handling of use-openssl-ca when running r11s …
alexvy86 May 17, 2024
dec8ded
Offline: Add negative tests to illustrate gap in capability around id…
markfields May 17, 2024
3731a41
Reduce session grace period for ephemeral containers when cluster is …
yunho-microsoft May 17, 2024
462aad6
Type Erase Shared object kinds (#21081)
CraigMacomber May 17, 2024
547c348
refactor(tree): throw usage errors on invalid revertible usage (#21137)
yann-achard-MS May 17, 2024
538b7e7
refactor(tree): lineage-free format for sequence field changesets (#2…
yann-achard-MS May 17, 2024
10ab7ff
Normalize imports (#21140)
CraigMacomber May 17, 2024
98a3ee6
refactor(tree): Enable `no-explicit-any` eslint rule and fix violatio…
Josmithr May 17, 2024
19f3c49
Add ISharedSegmentSequence (#21067)
CraigMacomber May 17, 2024
9f5e052
fix(devtools): Fixed accessibility issues in navigating Menu, Data vi…
WayneFerrao May 17, 2024
5e19c3c
[Service load test] Force some connections to be write mode for Tinyl…
kian-thompson May 17, 2024
25d649e
Remove several types from `@public` scope (#21142)
CraigMacomber May 17, 2024
340c7e5
Upload manifest file for release branch (#21143)
sonalideshpandemsft May 17, 2024
f8ce370
test(tree): Snapshot test all SharedTreeWriteFormat options (#20644)
Abe27342 May 17, 2024
b93cf3f
tools(changelog-generator-wrapper): Upgrade eslint config to "recomme…
Josmithr May 18, 2024
fb0782d
Fix undefined command name error in Redis Client (#21158)
Toritos01 May 20, 2024
5d887cd
Delete yaml file for Fluid AFR and Reliability tests (#21145)
WillieHabi May 20, 2024
3e0594a
Cleanup `fluid-framework` legacy exports (#21153)
CraigMacomber May 20, 2024
7b9e364
docs(client): comment on f-f API organization (#21149)
jason-ha May 20, 2024
ba65958
refactor(lambdas): Upgrade eslint config to "recommended" and fix vio…
Josmithr May 20, 2024
1db3bd1
Update client to TypeScript 5.3.3 (#20994)
CraigMacomber May 20, 2024
fee8837
Make handle parsing/decoding functions idempotent (#21102)
markfields May 20, 2024
e2c64ed
Tree: Fix TreeViewEvents.afterBatch (#21162)
CraigMacomber May 20, 2024
935e77e
fixing Redis client command name bug in historian (#21163)
Toritos01 May 20, 2024
f8aef74
Fix parsing of GroupId in snapshotTree in odsp driver (#21164)
jatgarg May 20, 2024
6856e06
Fix snapshotTree.id bug in driver (#21160)
tyler-cai-microsoft May 20, 2024
2c09027
Data Virtualization: Supports control over odsp cache in e2e tests (#…
tyler-cai-microsoft May 20, 2024
ffe04d5
refactor(tree) use separate cells ids for src and dst cells in moves …
yann-achard-MS May 21, 2024
fa4025e
docs(map, tree): Explicitly call out in SharedMap and SharedTree map …
Josmithr May 21, 2024
ea13563
tree: Fix reading tree during events (#21172)
CraigMacomber May 21, 2024
dc6ae62
Tree: Align tree tsconfigs with repo conventions (#21165)
CraigMacomber May 21, 2024
49e36f5
Merge branch 'main' into kkachmar/removeSessionStartMetric
kekachmar May 21, 2024
962a82b
fix merge conflict
kekachmar May 21, 2024
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
Prev Previous commit
Next Next commit
Fix type test symbol handling (#21070)
## Description

Improve type test symbols handling. Well known symbols are preserved, as
is `symbol`, but unique symbols are replaced (with never), both when
used as keys and as value types preventing valse positives (detected API
breaks that are op-ops).

This was manually tested with the RC4 client packages, a determined to
fix the issue with the new fluid handle symbol.
CraigMacomber authored and kekachmar committed May 21, 2024
commit 661db7cda5fd3230404f6cfbcabf0fcdf097f2d5
97 changes: 81 additions & 16 deletions build-tools/packages/build-tools/src/typeValidator/compatibility.ts
Original file line number Diff line number Diff line change
@@ -17,35 +17,76 @@ type requireAssignableTo<_A extends B, B> = true;
* Type meta-function which takes in a type, and removes some of its type information to get structural typing.
* This is necessary since TypeScript does not always treat identical declarations of the same type in two different places as assignable.
*
* The most common case of this is with classes where [private and protected members trigger nominal typing](https://www.typescriptlang.org/docs/handbook/type-compatibility.html#private-and-protected-members-in-classes].
* The `{ [P in keyof T]: TypeOnly<T[P]>; }` logic handles this by only preserving the list of members, and not fact that its a class.
* The most common case of this is with classes where [private and protected members trigger nominal typing](https://www.typescriptlang.org/docs/handbook/type-compatibility.html#private-and-protected-members-in-classes).
* A mapped type (for example `{ [P in keyof T]: T[P]; }`) is used preserve only the list of members, and discard the fact that it is a class.
*
* Another case is with `const enum`. The [docs for enum compatibility](https://www.typescriptlang.org/docs/handbook/type-compatibility.html#enums) seems to be only partly accurate, so tests for their behavior are included below.
*
* The `T extends number ? number :` included here is a workaround for how const enums behave (that fixes the case where the value is a number).
* This will strip some type branding information which ideally would be kept for stricter checking, but without it, const enums show up as breaking when unchanged.
*
* Another case is custom symbols.
* To mitigate this, symbols which are not either `symbol` or a [well known symbol (like Symbols.iterator)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#static_properties),
* are replaced with `never`.
*/
export const typeOnly = `
// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.
type ValueOf<T> = T[keyof T];
type OnlySymbols<T> = T extends symbol ? T : never;
type WellKnownSymbols = OnlySymbols<ValueOf<typeof Symbol>>;
/**
* Omit (replace with never) a key if it is a custom symbol,
* not just symbol or a well known symbol from the global Symbol.
*/
type SkipUniqueSymbols<Key> = symbol extends Key
? Key // Key is symbol or a generalization of symbol, so leave it as is.
: Key extends symbol
? Key extends WellKnownSymbols
? Key // Key is a well known symbol from the global Symbol object. These are shared between packages, so they are fine and kept as is.
: never // Key is most likely some specialized symbol, typically a unique symbol. These break type comparisons so are removed by replacing them with never.
: Key; // Key is not a symbol (for example its a string or number), so leave it as is.
/**
* Remove details of T which are incompatible with type testing while keeping as much as is practical.
*
* See 'build-tools/packages/build-tools/src/typeValidator/compatibility.ts' for more information.
*/
type TypeOnly<T> = T extends number
? number
: T extends string
? string
: T extends boolean | bigint | symbol
? T
: {
[P in keyof T]: TypeOnly<T[P]>;
};
: T extends boolean | bigint | string
? T
: T extends symbol
? SkipUniqueSymbols<T>
: {
[P in keyof T as SkipUniqueSymbols<P>]: TypeOnly<T[P]>;
};
`;

type ValueOf<T> = T[keyof T];
type OnlySymbols<T> = T extends symbol ? T : never;
type WellKnownSymbols = OnlySymbols<ValueOf<typeof Symbol>>;
/**
* Omit (replace with never) a key if it is a custom symbol,
* not just symbol or a well known symbol from the global Symbol.
*/
type SkipUniqueSymbols<Key> = symbol extends Key
? Key // Key is symbol or a generalization of symbol, so leave it as is.
: Key extends symbol
? Key extends WellKnownSymbols
? Key // Key is a well known symbol from the global Symbol object. These are shared between packages, so they are fine and kept as is.
: never // Key is most likely some specialized symbol, typically a unique symbol. These break type comparisons so are removed by replacing them with never.
: Key; // Key is not a symbol (for example its a string or number), so leave it as is.
/**
* Remove details of T which are incompatible with type testing while keeping as much as is practical.
*
* See 'build-tools/packages/build-tools/src/typeValidator/compatibility.ts' for more information.
*/
type TypeOnly<T> = T extends number
? number
: T extends string
? string
: T extends boolean | bigint | symbol
? T
: T extends boolean | bigint | string
? T
: T extends symbol
? SkipUniqueSymbols<T>
: {
[P in keyof T]: TypeOnly<T[P]>;
[P in keyof T as SkipUniqueSymbols<P>]: TypeOnly<T[P]>;
};

// Checks //
@@ -217,9 +258,33 @@ namespace Test_TypeOnly_Preserves_Primitives {

// Branded unions of primitive types are preserved, except for string and number,
// which are stripped to just 'string | number'.
type brandedUnion = (undefined | null | boolean | bigint | symbol) & {
// Symbols are excluded from this as they are more aggressively omitted to handle unique symbols.
type brandedUnion = (undefined | null | boolean | bigint) & {
brand: "Union";
};
type _check_union3 = requireAssignableTo<TypeOnly<brandedUnion>, brandedUnion>;
type _check_union4 = requireAssignableTo<brandedUnion, TypeOnly<brandedUnion>>;
}

namespace Test_TypeOnly_Symbols {
interface A {
[Symbol.iterator]: number;
}

// Ensure well known symbols are preserved
type _check1 = requireAssignableTo<TypeOnly<A>, A>;
type _check2 = requireAssignableTo<A, TypeOnly<A>>;

// Custom symbols are skipped, since they are likely from the package in question,
// and thus will not be considered equal to the version from the other copy of the package.
const X: unique symbol = Symbol();
interface B {
[X]: number;
}

// @ts-expect-error Symbol is skipped
type _check = requireAssignableTo<TypeOnly<B>, B>;

type _check3 = requireAssignableTo<TypeOnly<B>, object>;
type _check4 = requireAssignableTo<object, TypeOnly<B>>;
}