Repository navigation
pkg_npm should support stamping with arbitrary stable/volatile keys 聽#1694
Description
Activity
Yeah that makes a lot of sense. Do you have time to contribute it?
Yea I can look into it hopefully. I would want to see your thoughts on #1693 and how it relates to this ticket. My needs would only be satisfied here if I could mark some targets as to never rely on stamping and some conditional on the stamp flag.
It seems like there might be place for a generic rule or task that makes the stamping easy for plain text interpolations as opposed to duplicating this functionality in multiple places.
Also I'd be curious why it's good to support both stable keys and volatile keys. In particular since contributing npm publishing to bazelisk I was wondering why they use the stable keys file, and whether we should be recommending users to do the same. @philwo if you have a minute to comment?
@meisterT told me he can help us out here. I'm not very knowledgeable about this particular feature of Bazel.
It would seem that the use of stable keys vs. volatile keys is up to the needs of the user/organization. Some orgs may want to re-use via cache as much as possible and only ever stamp an artifact the first time its contents are generated, and others may want to re-stamp it when certain criteria is met (branch change, user/host change, etc...)
It would seem to me that the stamping feature of Bazel is representative of the needs of Google but may not be very flexible for a wider variety of needs, especially when it comes to remote caching of stamped builds
Reacted by Marius Grigoriu@thesayyn, thanks for the contribution, apologies that we missed following up the on review. I'll take a look at the PR shortly and ping Alex too.
Thank you. Also, I can implement the same feature for pkg_npm too.
Okay I just did stamping at work with rules_go so it's super clear what to do (they did a nice job in rules_go docs of presenting it simply as well, so I'll borrow from them)
- added 7 commits that reference this issue
on Aug 30, 2020 Fixed by #2157
- added a commit that references this issue
on Jan 15, 2021
馃殌 feature request
Relevant Rules
pkg_npmDescription
I want to be able to stamp multiple pieces of version information in npm archive.
Describe the solution you'd like
pkg_npm(and probablypkg_web) should allow values to use make-style variable replacements in thesubstitutionsdictionary. The keys would still refer to strings in the source files to find and replace.Describe alternatives you've considered
Writing a rule to manually copy the info from the version file into the relevant files.