Tinder / bazel-diff

Performs Bazel Target Diffing between two revisions in Git, allowing for Test Target Selection and Selective Building
Other
405 stars 60 forks source link

Enhance bazel-diff to Determine Affected Targets Using pnpm-lock.yaml Granularly #257

Open Arsen-Zhakypbek-Uulu opened 2 days ago

Arsen-Zhakypbek-Uulu commented 2 days ago

Description:

Hello maintainers,

I would like to propose an enhancement to the Tinder/bazel-diff project that allows for a more granular detection of affected targets based on changes in the pnpm-lock.yaml file.

Context:

We are using Bazel in conjunction with the pnpm package manager to manage multiple JavaScript/TypeScript applications. Each application has its own package.json, and dependencies are managed collectively via the pnpm-lock.yaml file.

Problem Statement:

Currently, when the pnpm-lock.yaml file changes, bazel-diff indicates that all JS/TS applications need to be rebuilt. However, this is often unnecessary as not all applications are affected by changes in locked dependencies. Different applications might have different versions of the same package or might not be affected by a particular version change at all.

Proposed Solution:

Add a feature to bazel-diff that:

Analyzes changes within the pnpm-lock.yaml file. Maps these changes to specific applications' package.json dependencies. Identifies only those applications that are truly affected by these changes, avoiding unnecessary rebuilds. Benefits:

Increased efficiency in the build process by avoiding unnecessary rebuilds. Better resource utilization in CI/CD environments. Faster feedback for developers due to reduced build times. Reference:

Aspect has been gaining popularity for building JS/TS applications with Bazel and supports pnpm. Considering its approach might provide some insights or strategies to implement this feature.

Thank you for considering this feature request. It would greatly enhance our development workflow and I believe it could be beneficial for others in the community as well.

Looking forward to your feedback or any suggestions on this proposal.

Feel free to customize the request with any additional information or context specific to your needs.