Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add StampSettingsInfo and STAMP_ATTRS #3162

Merged

Conversation

gregmagolan
Copy link
Collaborator

@gregmagolan gregmagolan commented Dec 22, 2021

Adds support for stamp env vars BAZEL_VERSION_FILE and BAZEL_INFO_FILE to run_node if "stamp": STAMP_ATTR is in ctx.attr

Adds stamp attr to npm_package_bin
Adds stamp attr to pkg_npm (replacing node_context_info)
Adds stamp attr to pkg_web (replacing node_context_info)
Adds stamp attr to esbuild (replacing node_context_info)
Adds stamp attr to rollup_bundle (replacing node_context_info)

Removes old NodeContextData and NODE_CONTEXTS_ATTRS from //internal/node/context.bzl in favor of StampSettingInfo and STAMP_ATTR from //nodejs/private/providers:stamp_setting_info.bzl

@gregmagolan gregmagolan force-pushed the npm_package_bin_stamp_env_vars branch from dac7e94 to b5234e2 Compare December 22, 2021 07:43
@gregmagolan gregmagolan changed the title feat: support --stamp env vars in npm_package_bin feat: add StampSettingsInfo and STAMP_ATTRS Dec 22, 2021
@Wenqer
Copy link

Wenqer commented Dec 22, 2021

Is it possible to add 'stamp' attr to nodejs_binary and nodejs_test too?

@gregmagolan gregmagolan force-pushed the npm_package_bin_stamp_env_vars branch from b5234e2 to dc7b5ad Compare December 22, 2021 07:56
@gregmagolan
Copy link
Collaborator Author

Is it possible to add 'stamp' attr to nodejs_binary and nodejs_test too?

Definitely. @alexeagle or I will add that as a follow-up to this.

internal/pkg_web/test/BUILD.bazel Outdated Show resolved Hide resolved
internal/providers/node_runtime_deps_info.bzl Outdated Show resolved Hide resolved
nodejs/BUILD.bazel Outdated Show resolved Hide resolved
providers.bzl Outdated Show resolved Hide resolved
@gregmagolan gregmagolan force-pushed the npm_package_bin_stamp_env_vars branch 2 times, most recently from 781f819 to 245a8e8 Compare December 24, 2021 08:58
@gregmagolan gregmagolan requested a review from mrmeku as a code owner December 24, 2021 08:58
@gregmagolan gregmagolan force-pushed the npm_package_bin_stamp_env_vars branch from 245a8e8 to 2b1288f Compare December 24, 2021 09:11
Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delightful :octocat:

@alexeagle alexeagle merged commit 38fee32 into bazel-contrib:5.x Dec 28, 2021
@mtsgrd
Copy link

mtsgrd commented Jun 15, 2022

Is it possible to add 'stamp' attr to nodejs_binary and nodejs_test too?

Definitely. @alexeagle or I will add that as a follow-up to this.

Is there an issue tracking this? I would currently use it to stamp a cypress e2e testing API key into the environment variables for cypress_web_test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants