fix(ng-dev/release): ignore lock files when detecting snapshot changes#3549
fix(ng-dev/release): ignore lock files when detecting snapshot changes#3549alan-agius4 merged 1 commit intoangular:mainfrom
Conversation
Update the `diff-index` command used during snapshot publishing to ignore `MODULE.bazel.lock` and `package-lock.json` files. This prevents triggering snapshot publishes when the only changes are in dependency lock files.
There was a problem hiding this comment.
Code Review
This pull request updates the snapshot publishing logic to ignore changes in MODULE.bazel.lock and package-lock.json when determining if a new snapshot should be published. The change correctly uses git diff-index with pathspecs to exclude these files from the diff. My review includes a suggestion to make the list of ignored files configurable to improve future maintainability.
| [ | ||
| 'diff-index', | ||
| '--quiet', | ||
| '-I', | ||
| '0\\.0\\.0-[a-f0-9]+', | ||
| 'HEAD', | ||
| '--', | ||
| '.', | ||
| ':(exclude)**/MODULE.bazel.lock', | ||
| ':(exclude)**/package-lock.json', | ||
| ], |
There was a problem hiding this comment.
While this change correctly ignores the specified lock files, hardcoding them here makes it less flexible. If we need to ignore other files in the future, we'll have to modify this code again.
Consider making the list of ignored files configurable in the release configuration (e.g., in .ng-dev/config.js). This would make the snapshot publishing logic more maintainable and adaptable.
For example, you could add a snapshotIgnoredFiles property to the release config and then build the diff-index arguments dynamically from that list.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
Update the
diff-indexcommand used during snapshot publishing to ignoreMODULE.bazel.lockandpackage-lock.jsonfiles.This prevents triggering snapshot publishes when the only changes are in dependency lock files.