Skip to content

feat(fluid-build): Leaf Task File Dependencies #24929

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

Merged
merged 6 commits into from
Jul 1, 2025

Conversation

curtisman
Copy link
Member

@curtisman curtisman commented Jun 26, 2025

Add optional file dependency specification on task definitions for leaf tasks, similar to declarativeTask per executable name.

Thus, it enables:

  • Turning an unknown executable to incrementally buildable.
  • Overrides any default dependency handling of the leaf task based on executable names.

@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 19:18
@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Jun 26, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

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 introduces file dependency support for leaf tasks within fluid-build, allowing tasks to specify input/output globs for incremental builds. The changes remove free function task handlers in favor of constructor-based ones, update task creation logic to handle file dependencies, and enforce validation rules for file configurations in global and non-script task definitions.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
build-tools/src/fluidBuild/tasks/taskHandlers.ts Removed the free function task handler type and related type guard.
build-tools/src/fluidBuild/tasks/taskFactory.ts Updated task creation functions to pass file dependency configurations and added error checks for file dependencies on unsupported tasks.
build-tools/src/fluidBuild/tasks/leaf/leafTask.ts Modified return types of glob-fetching methods to accommodate optional file lists.
build-tools/src/fluidBuild/tasks/leaf/declarativeTask.ts Renamed and refactored declarative task handler to use the updated constructor-based approach.
build-tools/src/fluidBuild/fluidTaskDefinitions.ts Added TaskFileDependencies along with validations for file dependency configurations.
build-tools/src/fluidBuild/fluidBuildConfig.ts Updated DeclarativeTask interface to extend TaskFileDependencies.
build-tools/src/fluidBuild/buildGraph.ts Propagated file dependency information to script task creation.

@curtisman
Copy link
Member Author

@tylerbutler @scottn12 FYI.

@curtisman curtisman force-pushed the taskfiledep branch 2 times, most recently from 0108a67 to c59d63b Compare June 27, 2025 16:54
Copy link
Member

@tylerbutler tylerbutler left a comment

Choose a reason for hiding this comment

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

Mostly nits.

* @param command the command to create the task for
* @param context the build context
* @param taskName target name
* @param files file dependencies for the task, if any
Copy link
Member

Choose a reason for hiding this comment

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

Are these paths relative to the package or to the repo root? Or are they absolute?

Copy link
Member Author

Choose a reason for hiding this comment

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

Package relative

Comment on lines +91 to +94
// If the task has file dependencies specification, create a declarative task
if (files !== undefined) {
return new DeclarativeLeafTask(node, command, context, taskName, files);
}
Copy link
Member

Choose a reason for hiding this comment

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

Putting this first means that you can't override one of the built-in tasks (e.g. the eslint one) to change its inputs/outputs, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean it can override the built-in behavior? If so, then yes, that's the intent

curtisman and others added 4 commits June 28, 2025 14:17
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
Co-authored-by: Tyler Butler <tyler@tylerbutler.com>
@curtisman
Copy link
Member Author

@scottn12 I have a follow up PR after this one. Wondering what's the next step to get this merged?

@scottn12
Copy link
Contributor

scottn12 commented Jul 1, 2025

@scottn12 I have a follow up PR after this one. Wondering what's the next step to get this merged?

Sorry, I've been a bit busy with some other work. I'll review this shortly!

Copy link
Contributor

@scottn12 scottn12 left a comment

Choose a reason for hiding this comment

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

Tested this out the changes locally, LGTM!

@curtisman
Copy link
Member Author

@scottn12 Is there something that needs to happen for the CI to start?

@scottn12
Copy link
Contributor

scottn12 commented Jul 1, 2025

@curtisman, maybe try updating the branch from main? I think I've seen this happen before and that restarted it

@scottn12
Copy link
Contributor

scottn12 commented Jul 1, 2025

/azp run Build - protocol-definitions,Build - test-tools,server-gitrest,server-gitssh,server-historian,server-routerlicious,Build - client packages,repo-policy-check

@scottn12
Copy link
Contributor

scottn12 commented Jul 1, 2025

/azp run Build - api-markdown-documenter,Build - benchmark-tool,Build - build-common,Build - build-tools,Build - common-utils,Build - eslint-config-fluid,Build - eslint-plugin-fluid

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scottn12 scottn12 merged commit 7463585 into microsoft:main Jul 1, 2025
28 checks passed
@curtisman curtisman deleted the taskfiledep branch July 1, 2025 22:43
MarioJGMsoft pushed a commit to MarioJGMsoft/FluidFramework that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants