refactor(ng-dev/release): centralize and expand ignored paths for snapshot publishing#3557
Conversation
…pshot publishing Centralizes the paths to exclude when detecting changes for snapshot publishing into a single constant. Additionally, adds `pubspec.lock` to the list of ignored files to avoid unnecessary snapshot releases when only lock files change.
2c0c719 to
8685395
Compare
There was a problem hiding this comment.
Code Review
This pull request refactors the snapshot publishing logic to centralize and expand the list of excluded file paths. The changes are well-implemented. I've suggested a minor improvement to move the new constant into the SnapshotPublisher class for better encapsulation, which requires a corresponding update to its usage.
| /** | ||
| * Paths to exclude from the snapshot commit. | ||
| */ | ||
| const PATHS_TO_EXCLUDE = ['**/MODULE.bazel.lock', '**/package-lock.json', '**/pubspec.lock']; | ||
|
|
||
| export class SnapshotPublisher { |
There was a problem hiding this comment.
For better encapsulation, consider moving PATHS_TO_EXCLUDE inside the SnapshotPublisher class as a private static readonly property. This constant is only used within this class, so this change would improve cohesion.
export class SnapshotPublisher {
/**
* Paths to exclude from the snapshot commit.
*/
private static readonly PATHS_TO_EXCLUDE = ['**/MODULE.bazel.lock', '**/package-lock.json', '**/pubspec.lock'];| '.', | ||
| ':(exclude)**/MODULE.bazel.lock', | ||
| ':(exclude)**/package-lock.json', | ||
| ...PATHS_TO_EXCLUDE.map((p) => `:(exclude)${p}`), |
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Centralizes the paths to exclude when detecting changes for snapshot publishing into a single constant. Additionally, adds
pubspec.lockto the list of ignored files to avoid unnecessary snapshot releases when only lock files change.