rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

feat(publish): add update flag to run update pre-publish

Open ethan-burrell opened this issue 3 years ago • 2 comments

Summary

This PR is proposed as a solution to #3413, where a publish causes the the shrinkwrap in a stale state.

Design considerations:

This causes a problem where our shrinkwrap was out of date after a publish was run. By running an update before publish runs, this would keep the shrinkwrap in the correct state.

If user's would like to opt into this feature they can run rush publish .... --update to include the update to the shrinkwrap as a part of their publish pipeline.

Details

  • Adds --update as a parameter for the publish command.

How it was tested

  • [ ] Unit tests
  • [ ] Integration tests

Integration tests will consist of me attempting to reproduce the problem with the stale shrinkwraps, and replay to the commit before the publish happened and checking that the --update flag fixes the publish.

ethan-burrell avatar Jun 02 '22 00:06 ethan-burrell

Just confirming - this will commit the updated shrinkwrap, right?

iclanton avatar Jun 13 '22 18:06 iclanton

@iclanton

Just confirming - this will commit the updated shrinkwrap, right?

It will update as long as --include-all is not specified with rush publish. This is because --include-all does not commit unstated changes.

Fixing this.

How should I commit the shrink file if --include-all is specified.

I can do it in the function I defined called _updateBeforePublish. Should I create a commit called Update Dependencies? Or is there another way you'd like this handled.

ethan-burrell avatar Jun 22 '22 20:06 ethan-burrell