Task runnerGuidesAffected Detection

Affected Detection

Only run tasks for packages changed since the base branch

Affected Detection

Affected detection uses git diff to determine which packages have changed since a base branch, then filters the task graph to only include tasks for those packages and their dependents.

Usage

import {
    getChangedFiles,
    getAffectedProjects,
    filterAffectedTasks,
} from "@visulima/task-runner";

// Detect affected projects (uses git diff internally)
const affected = await getAffectedProjects({
    base: "main",
    head: "HEAD",
    projectGraph,
    projects,
    workspaceRoot,
});

// Filter task IDs to only affected projects
const filteredTaskIds = filterAffectedTasks(
    taskIds,
    new Set(affected.affectedProjects),
);

Transitive Expansion

If package A depends on package B, and B changes, then A is also affected. The affected detection expands transitively through the project dependency graph.

CI Integration

const results = await defaultTaskRunner(
    filterAffectedTasks(taskIds, new Set(affected.affectedProjects)),
    options,
    context,
);
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues