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

Revert "eslint(test-end-to-end-tests): Prefix test-end-to-end-tests before enabling no-unchecked-record-access" #23498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jason-ha
Copy link
Contributor

@jason-ha jason-ha commented Jan 8, 2025

Reverts #23436

  1. Where ? was used to address linter defect, TypeScript appears to mostly ignore that these cases may lead to undefined result which is not accepted per type specifications. Use of ? is thus a behavior change that will shift point of failure away from where it could first be detected - revert those behavior changes. (Many of the test uses of ? in original change are permissible as there is a follow-up assertion that will fail. But those were not separated during revert.)

  2. Where T | undefined was used to address linter defect, TypeScript will narrow without undefined without noUncheckedIndexAccess enabled. Thus, the code appears more confusing as there is a non-respected type annotation.

@Copilot Copilot bot review requested due to automatic review settings January 8, 2025 01:50
@github-actions github-actions bot added base: main PRs targeted against main branch area: tests Tests to add, test infrastructure improvements, etc labels Jan 8, 2025
@jason-ha jason-ha requested review from scottn12 and RishhiB January 8, 2025 01:50

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 21 changed files in this pull request and generated no comments.

Files not reviewed (15)
  • packages/test/test-end-to-end-tests/src/test/gc/gcTrailingOps.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/data-virtualization/groupIdInSummary.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcSweepDataStores.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcDatastoreDuplicateRoutes.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcTreeSummaryHandles.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcSweepAttachmentBlobs.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/idCompressor.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcUnreferencedTimestamp.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcDeleteObjectsInTestMode.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/summarization/summarizeIncrementally.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcSweepUnreferencePhases.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/gc/gcTestSummaryUtils.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/data-virtualization/loadNewerGroupIdSnapshot.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/test/deRehydrateContainerTests.spec.ts: Evaluated as low risk
  • packages/test/test-end-to-end-tests/src/mocking.ts: Evaluated as low risk
Comments suppressed due to low confidence (6)

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:86

  • Accessing 'summary.tree[".metadata"].content' directly without optional chaining or null check could lead to runtime errors if 'summary.tree[".metadata"]' is undefined.
const metadata = readBlobContent(summary.tree[".metadata"].content) as Record<string, unknown>;

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:99

  • Accessing 'summary.tree[channelsTreeName]' directly without optional chaining or null check could lead to runtime errors if 'summary.tree[channelsTreeName]' is undefined.
const channelsTree = summary.tree[channelsTreeName];

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:105

  • Accessing 'channelsTree.tree[defaultDataStore._context.id]' directly without optional chaining or null check could lead to runtime errors if 'channelsTree.tree[defaultDataStore._context.id]' is undefined.
const defaultDataStoreNode = channelsTree.tree[defaultDataStore._context.id];

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:115

  • Accessing 'defaultDataStoreNode.tree[channelsTreeName]' directly without optional chaining or null check could lead to runtime errors if 'defaultDataStoreNode.tree[channelsTreeName]' is undefined.
const dataStoreChannelsTree = defaultDataStoreNode.tree[channelsTreeName];

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:117

  • Accessing 'defaultDataStoreNode.tree[".component"].content' directly without optional chaining or null check could lead to runtime errors if 'defaultDataStoreNode.tree[".component"]' is undefined.
const attributes = readBlobContent(defaultDataStoreNode.tree[".component"].content) as Record<string, unknown>;

packages/test/test-end-to-end-tests/src/test/benchmark/summarization.memory.spec.ts:136

  • Accessing 'dataStoreChannelsTree.tree.root' directly without optional chaining or null check could lead to runtime errors if 'dataStoreChannelsTree.tree.root' is undefined.
const defaultDdsNode = dataStoreChannelsTree.tree.root;
Copy link
Collaborator

@msfluid-bot msfluid-bot left a comment

Choose a reason for hiding this comment

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

Code Coverage Summary

No packages impacted by the change.


Baseline commit: 46abe82
Baseline build: 315740
Happy Coding!!

Code coverage comparison check passed!!

@msfluid-bot
Copy link
Collaborator

@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 470.55 KB 470.59 KB +35 Bytes
azureClient.js 567.29 KB 567.34 KB +49 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 266.44 KB 266.46 KB +14 Bytes
fluidFramework.js 439.08 KB 439.09 KB +14 Bytes
loader.js 134.2 KB 134.21 KB +14 Bytes
map.js 42.68 KB 42.69 KB +7 Bytes
matrix.js 150.36 KB 150.36 KB +7 Bytes
odspClient.js 534.75 KB 534.8 KB +49 Bytes
odspDriver.js 99.49 KB 99.51 KB +21 Bytes
odspPrefetchSnapshot.js 43.05 KB 43.06 KB +14 Bytes
sharedString.js 166.51 KB 166.52 KB +7 Bytes
sharedTree.js 429.55 KB 429.56 KB +7 Bytes
Total Size 3.42 MB 3.42 MB +245 Bytes

Baseline commit: 46abe82

Generated by 🚫 dangerJS against c9213ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants