feat: Only generate manifest if update is specified #8
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
Idea
invalid
question
released
security
semantic-release
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: marc/packwatch#8
Loading…
Reference in a new issue
No description provided.
Delete branch "only-generate-manifest-with-option"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mostly a suggestion based upon how I imagine packwatch would be used in CI:
In CI: simply run
packwatch
. It fails if the package size is bigger than expected. The current behaviour is to generate a new manifest and succeed, so if somehow the manifest gets deleted, the build will pass unwittingly, and the generated file won't even get committed to the repository.By requiring the
--update-manifest
flag to be passed to generate the manifest for the first time, it ensures that packwatch won't "accidentally" pass in CI if it hasn't already been configured locally already.Let me know if this makes sense! There are other options but this was the first that came to mind. Also should probably write a test for this somehow 😛
It would be a breaking change so I've added a commit message that our pal semantic-release should pick up.
Codecov Report
Continue to review full report at Codecov.
I feel that using
--update-manifest
to generate it initially is a bit weird semantically. However, I agree that CI should fail if you do not have a.packwatch.json
file - I would advocate for returning an error code when generating the file for the first time so that CI would always fail if it has to create the file, otherwise it would pas. This would preserve the idea that--update-manifest
expects a file to exist already.LGTM
@ -37,1 +36,4 @@
// If the update flag wasn't specified, exit with a non-zero code so we
// don't "accidentally" pass CI builds if the manifest didn't exist
process.exit(isUpdatingManifest ? 0 : 1)
}
An argument could be made that there's never a valid use case in which you'd want CI to run
--update-manifest
and pass either (since having--update-manifest
in CI would always pass the check). That being said, I feel that this can be addressed further up and check if a CI env variable is set to error out early if--update-manifest
is passed in.LGTM.
@all-contributors please add @msrose for code
@mcataford
I've put up a pull request to add @msrose! 🎉
🎉 This PR is included in version 2.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀