Skip to content

[fluid-runner] Expose createFluidRunnerContainerAndExecute and createFluidRunnerLogger#27182

Open
kian-thompson wants to merge 4 commits into
microsoft:mainfrom
kian-thompson:fluid-runner-more-exposure
Open

[fluid-runner] Expose createFluidRunnerContainerAndExecute and createFluidRunnerLogger#27182
kian-thompson wants to merge 4 commits into
microsoft:mainfrom
kian-thompson:fluid-runner-more-exposure

Conversation

@kian-thompson

Copy link
Copy Markdown
Contributor

Our partner team requested some additional methods from the fluid-runner package.

…FluidRunnerLogger

Co-authored-by: Copilot <copilot@github.com>
@github-actions

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (188 lines, 9 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Comment thread packages/tools/fluid-runner/src/logger/fileLogger.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the @fluidframework/fluid-runner legacy/beta public API surface to support partner scenarios by exposing lower-level container execution and file-backed telemetry logger helpers.

Changes:

  • Export createFluidRunnerContainerAndExecute to load a container from an ODSP snapshot and run caller-provided execution logic.
  • Export createFluidRunnerLogger to create a file-backed telemetry logger intended to be passed into the new execution helper.
  • Promote IFileLogger and ITelemetryOptions from @internal to @legacy @beta, and update internal usage/tests accordingly.

Reviewed changes

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

Show a summary per file
File Description
packages/tools/fluid-runner/src/test/loggerUtils.spec.ts Updates tests to use createFluidRunnerLogger.
packages/tools/fluid-runner/src/test/exportFile.spec.ts Updates tests to use createFluidRunnerContainerAndExecute.
packages/tools/fluid-runner/src/parseBundleAndExportFile.ts Switches internal call sites to the newly exposed helper APIs.
packages/tools/fluid-runner/src/logger/loggerUtils.ts Renames/exposes logger creation helper and updates types/TSDoc tags.
packages/tools/fluid-runner/src/logger/fileLogger.ts Promotes IFileLogger/ITelemetryOptions to @legacy @beta.
packages/tools/fluid-runner/src/index.ts Re-exports the new helper APIs from the package entrypoint.
packages/tools/fluid-runner/src/exportFile.ts Renames/exposes the container execution helper and adjusts logger typing.
packages/tools/fluid-runner/api-report/fluid-runner.legacy.beta.api.md Updates generated legacy/beta API report to include new exports.
.changeset/expose-fluid-runner-helpers.md Adds a changeset for the new legacy/beta API surface.
Comments suppressed due to low confidence (2)

packages/tools/fluid-runner/src/logger/loggerUtils.ts:44

  • Now that this helper is part of the public legacy/beta surface, consider validating filePath inside createFluidRunnerLogger (e.g. fail if it already exists). JSONFileLogger appends to the file during initialization, which can corrupt output if an existing file is passed, and consumers may not call getTelemetryFileValidationError first.
	const fileLogger =
		options?.outputFormat === OutputFormat.CSV
			? new CSVFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps)
			: new JSONFileLogger(filePath, options?.eventsPerFlush, options?.defaultProps);

packages/tools/fluid-runner/src/exportFile.ts:153

  • When disableNetworkFetch is true, this function overwrites global.fetch but never restores the original implementation. This leaks a process-wide side effect to callers (and any subsequent container loads) and can cause unrelated code to start failing after this helper returns. Please restore the previous global.fetch in a finally block (or otherwise scope the override) so the override only applies during the container load/execution.
		if (disableNetworkFetch) {
			global.fetch = async () => {
				throw new Error("Network fetch is not allowed");
			};
		}

Comment thread .changeset/expose-fluid-runner-helpers.md Outdated
Comment thread packages/tools/fluid-runner/src/index.ts
Comment thread packages/tools/fluid-runner/src/test/loggerUtils.spec.ts Outdated
Comment thread packages/tools/fluid-runner/src/index.ts
Comment thread packages/tools/fluid-runner/src/logger/loggerUtils.ts Outdated
Comment thread packages/tools/fluid-runner/src/exportFile.ts Outdated
Co-authored-by: Copilot <copilot@github.com>

@jason-ha jason-ha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make sure to build a FF test/ branch build and confirm integration with Pages.
They are using /internal imports and mocking right now. While that isn't "supported" it will be a problem for us if those integration breaks.

@jason-ha

jason-ha commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Since this didn't make 2.103, please wait to build new test build until after #27476 merges in 2.110 and merged to this branch.

kian-thompson and others added 2 commits June 9, 2026 22:40
…r helpers

Keep the previous names available as deprecated @internal aliases so
existing internal consumers continue to work:

- createContainerAndExecute -> createFluidRunnerContainerAndExecute
- createLogger              -> createFluidRunnerLogger
- ITelemetryOptions         -> IFileLoggerTelemetryOptions

The deprecated functions retain the original implementations. The new
@legacy @beta exports are thin wrappers that take/return the public
ITelemetryBaseLogger surface.

Also fixes a few coupled bugs introduced by the rename (missing
createChildLogger import, stale baseLogger reference, stale
ITelemetryOptions type reference) and updates the changeset to document
the back-compat aliases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output

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:
  290922 links
    1934 destination URLs
    2184 URLs ignored
       0 warnings
       0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants