Skip to content

Commit

Permalink
Integrate main to next up to the type validator changes (#9751)
Browse files Browse the repository at this point in the history
* Type Validation Tool Improvements (#9674)

Make core type validation logic async to support parallelism on io, and make main loop parrallel
Improve error handling in core type validation logic
Enable loading from packages without source (from .d.ts) as we strip source from some packages, like aqueduct
Improve type handling, specifically add TypeOnly utility the recursively turns all types into typescript types, otherwise we hit problems with privates on classes.
Switch to single back compat test (Previous). The old format was overkill. In this new way every version will validation only it's previous, which will create a chain of validations between all versions. We have functional e2e test that validate back compat requirements which are runtime, not compile time.
To see changes in action look at #9673

* Add stress test for testing new fluid binary wire format (#9391)

* Disbale batching test (#9678)

* Fixing runWithRetry with abort signal when container closes (#9195)

* Reenable unbound method lint rule and preemptive fixes (#9689)

* [GitRest] Refactoring APIs to support storage name header (#9672)

* [GitRest] Refactoring APIs to support storage name header

* Addressing comments

* [r11s] Allowing getOrCreateRepo to handle headers (#9691)

* Enable type validation for all client packages (#9673)

This change uses a new improved version of the type validation tool to generate validation tests for all packages (#9674).

Generally this change in all done via automation, but there are a couple other changes.

Remove type validation from existing packages, and move to new model
Fix fluid-build non-conformant packages
All automatic type validation generation is removed. It is to slow to run on every build. It should only need to be run after release, and in the presence of new breaking changes that must be suppressed

* Fix type validator issues

* Additional type validator fixes

Co-authored-by: Tony Murphy <[email protected]>
Co-authored-by: Jatin Garg <[email protected]>
Co-authored-by: chensixx <[email protected]>
Co-authored-by: Matt Rakow <[email protected]>
Co-authored-by: Henrique Da Silveira <[email protected]>
  • Loading branch information
6 people authored Apr 6, 2022
1 parent 64afd91 commit dbb95bf
Show file tree
Hide file tree
Showing 276 changed files with 23,848 additions and 12,754 deletions.
2 changes: 2 additions & 0 deletions api-report/container-loader.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export class Container extends EventEmitterWithErrorHandling<IContainerEvents> i
// (undocumented)
get closed(): boolean;
// (undocumented)
get closeSignal(): AbortSignal;
// (undocumented)
get connected(): boolean;
// (undocumented)
get connectionState(): ConnectionState;
Expand Down
2 changes: 1 addition & 1 deletion api-report/driver-utils.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class InsecureUrlResolver implements IUrlResolver {
// @public
export interface IProgress {
cancel?: AbortSignal;
retry?(delayInMs: number, error: any): void;
onRetry?(delayInMs: number, error: any): void;
}

// @public (undocumented)
Expand Down
7 changes: 6 additions & 1 deletion common/build/eslint-config-fluid/eslint7.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ module.exports = {
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
"@typescript-eslint/unified-signatures": "error",

// eslint-plugin-eslint-comments
Expand Down
5 changes: 0 additions & 5 deletions common/build/eslint-config-fluid/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
"@typescript-eslint/quotes": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/unified-signatures": "off",
"eqeqeq": "off",
"import/no-internal-modules": "off",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
"@typescript-eslint/quotes": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/unbound-method": "off",
"guard-for-in": "off",
"import/no-duplicates": "off",
"import/no-internal-modules": "off",
Expand Down
5,849 changes: 4,384 additions & 1,465 deletions lerna-package-lock.json

Large diffs are not rendered by default.

81 changes: 39 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"tsc:fast": "fluid-build --root . -s tsc",
"tsfmt": "lerna run tsfmt:fix --no-sort --stream --no-bail",
"tsfmt:fix": "lerna run tsfmt:fix --no-sort --stream --no-bail",
"typetests:gen": "fluid-type-validator -m packages -v",
"typetests:prepare": "npm run typetests:gen -- -p",
"watch": "concurrently \"npm run watch:tsc\" \"npm run watch:esnext\" \"npm run watch:webpack\"",
"watch:esnext": "lerna run --parallel build:esnext -- -- --watch",
"watch:tsc": "lerna run --parallel tsc -- -- --watch",
Expand Down Expand Up @@ -107,7 +109,7 @@
"temp-directory": "nyc/.nyc_output"
},
"devDependencies": {
"@fluidframework/build-tools": "^0.2.58041",
"@fluidframework/build-tools": "^0.2.59529",
"@fluidframework/test-tools": "^0.2.3074",
"@microsoft/api-documenter": "^7.12.7",
"@microsoft/api-extractor": "^7.16.1",
Expand Down
9 changes: 7 additions & 2 deletions packages/dds/cell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"lint:fix": "npm run eslint:fix",
"test": "npm run test:mocha",
"test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
"test:mocha": "mocha --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
"test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
"tsc": "tsc",
"tsfmt": "tsfmt --verify",
Expand Down Expand Up @@ -70,6 +70,7 @@
"devDependencies": {
"@fluid-internal/test-dds-utils": "^0.59.1000",
"@fluidframework/build-common": "^0.23.0",
"@fluidframework/cell-previous": "npm:@fluidframework/cell@^0.58.0",
"@fluidframework/eslint-config-fluid": "^0.27.0",
"@fluidframework/mocha-test-setup": "^0.59.1000",
"@fluidframework/test-runtime-utils": "^0.59.1000",
Expand All @@ -94,5 +95,9 @@
"rimraf": "^2.6.2",
"typescript": "~4.1.3",
"typescript-formatter": "7.1.0"
},
"typeValidation": {
"version": "0.59.1000",
"broken": {}
}
}
}
3 changes: 2 additions & 1 deletion packages/dds/cell/src/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"mocha"
],
"declaration": false,
"declarationMap": false
"declarationMap": false,
"skipLibCheck": true
},
"include": [
"./**/*"
Expand Down
87 changes: 87 additions & 0 deletions packages/dds/cell/src/test/types/validateCellPrevious.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/*
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
* Generated by fluid-type-validator in @fluidframework/build-tools.
*/
/* eslint-disable max-lines */
import * as old from "@fluidframework/cell-previous";
import * as current from "../../index";

type TypeOnly<T> = {
[P in keyof T]: TypeOnly<T[P]>;
};

/*
* Validate forward compat by using old type in place of current type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "InterfaceDeclaration_ISharedCell": {"forwardCompat": false}
*/
declare function get_old_InterfaceDeclaration_ISharedCell():
TypeOnly<old.ISharedCell>;
declare function use_current_InterfaceDeclaration_ISharedCell(
use: TypeOnly<current.ISharedCell>);
use_current_InterfaceDeclaration_ISharedCell(
get_old_InterfaceDeclaration_ISharedCell());

/*
* Validate back compat by using current type in place of old type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "InterfaceDeclaration_ISharedCell": {"backCompat": false}
*/
declare function get_current_InterfaceDeclaration_ISharedCell():
TypeOnly<current.ISharedCell>;
declare function use_old_InterfaceDeclaration_ISharedCell(
use: TypeOnly<old.ISharedCell>);
use_old_InterfaceDeclaration_ISharedCell(
get_current_InterfaceDeclaration_ISharedCell());

/*
* Validate forward compat by using old type in place of current type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "InterfaceDeclaration_ISharedCellEvents": {"forwardCompat": false}
*/
declare function get_old_InterfaceDeclaration_ISharedCellEvents():
TypeOnly<old.ISharedCellEvents<any>>;
declare function use_current_InterfaceDeclaration_ISharedCellEvents(
use: TypeOnly<current.ISharedCellEvents<any>>);
use_current_InterfaceDeclaration_ISharedCellEvents(
get_old_InterfaceDeclaration_ISharedCellEvents());

/*
* Validate back compat by using current type in place of old type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "InterfaceDeclaration_ISharedCellEvents": {"backCompat": false}
*/
declare function get_current_InterfaceDeclaration_ISharedCellEvents():
TypeOnly<current.ISharedCellEvents<any>>;
declare function use_old_InterfaceDeclaration_ISharedCellEvents(
use: TypeOnly<old.ISharedCellEvents<any>>);
use_old_InterfaceDeclaration_ISharedCellEvents(
get_current_InterfaceDeclaration_ISharedCellEvents());

/*
* Validate forward compat by using old type in place of current type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "ClassDeclaration_SharedCell": {"forwardCompat": false}
*/
declare function get_old_ClassDeclaration_SharedCell():
TypeOnly<old.SharedCell>;
declare function use_current_ClassDeclaration_SharedCell(
use: TypeOnly<current.SharedCell>);
use_current_ClassDeclaration_SharedCell(
get_old_ClassDeclaration_SharedCell());

/*
* Validate back compat by using current type in place of old type
* If breaking change required, add in package.json under typeValidation.broken.0.58.2002:
* "ClassDeclaration_SharedCell": {"backCompat": false}
*/
declare function get_current_ClassDeclaration_SharedCell():
TypeOnly<current.SharedCell>;
declare function use_old_ClassDeclaration_SharedCell(
use: TypeOnly<old.SharedCell>);
use_old_ClassDeclaration_SharedCell(
get_current_ClassDeclaration_SharedCell());
Loading

0 comments on commit dbb95bf

Please sign in to comment.