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

Remove unnecessary ContainerRuntime members #23625

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

anthony-murphy
Copy link
Contributor

This change removes unnecessary ContainerRuntime members. These members just increased complexity of the class, and most could be moved to just be function scoped variables.

@Copilot Copilot bot review requested due to automatic review settings January 22, 2025 01:39
@anthony-murphy anthony-murphy requested a review from a team as a code owner January 22, 2025 01:39
@github-actions github-actions bot added base: main PRs targeted against main branch area: runtime Runtime related issues public api change Changes to a public API labels Jan 22, 2025

Choose a reason for hiding this comment

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

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

Files not reviewed (1)
  • packages/runtime/container-runtime/src/containerRuntime.ts: Evaluated as low risk
Comments suppressed due to low confidence (3)

packages/runtime/container-runtime/src/summary/summaryCollection.ts:38

  • The code assumes that op.timestamp is always defined, which may not be the case. Add a check to ensure op.timestamp is defined before using it.
const lastOpTimestamp = op.timestamp;

packages/runtime/container-runtime/src/connectionTelemetry.ts:153

  • Ensure that ITelemetryBaseLogger provides all the necessary methods and properties that ITelemetryLoggerExt did.
logger: ITelemetryBaseLogger,

packages/runtime/container-runtime/src/connectionTelemetry.ts:171

  • Ensure that this.logger is properly initialized before being passed to createSampledLogger.
this.deltaLatencyLogger = createSampledLogger(this.logger, deltaLatencyEventSampler);
@anthony-murphy anthony-murphy force-pushed the cleanup-containerRuntime branch from 16cce3e to 9fcb28f Compare January 22, 2025 17:20
// back-compat: initialSummarizerDelayMs was moved from ISummaryRuntimeOptions
// to ISummaryConfiguration in 0.60.
initialSummarizerDelayMs = runtimeOptions.summaryOptions.initialSummarizerDelayMs ?? 0,
} = isSummariesDisabled(summaryConfiguration) ? {} : summaryConfiguration;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is terse but kind of confusing to follow as the assignment precedence bounces between lines. Looks like this has resulted in summaryConfiguration overriding summaryOptions for initialSummarizerDelayMs, a behavior change since currently summaryOptions takes precedence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

summaryConfiguration is a really hard type to work with, so i'm not surprised the deprecated field is still around and used. i fixed precedence issue. i would like to fix the type, but is it exposed, so hard to make changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

None of either summaryConfiguration nor summaryOptions is directly exposed publicly AFAICT, and since the class is now hidden maybe there's some opportunity to precompute these in loadContainerRuntime such that the ctor can just take a simple initialSummarizerDelayMs directly. Might be nice to (1) externalize that complication from the class, (2) pass the tough objects through as few calls as possible, and (3) probably makes the class simpler to test directly? Not needed for this PR but something to think about.

@anthony-murphy anthony-murphy force-pushed the cleanup-containerRuntime branch from 01881ea to 4e70de8 Compare January 22, 2025 17:48
Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  170508 links
    1603 destination URLs
    1842 URLs ignored
       0 warnings
       0 errors


Copy link
Contributor

@ChumpChief ChumpChief left a comment

Choose a reason for hiding this comment

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

Seems cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants