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

Add missing python-fetch-individual-packages autogate check. #3348

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/workerd/server/workerd-api.c++
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,8 @@ void WorkerdApi::compileModules(jsg::Lock& lockParam,
jsg::ModuleRegistry::Type::INTERNAL);

// Inject packages tar file
if (featureFlags.getPythonExternalPackages()) {
if (featureFlags.getPythonExternalPackages() ||
util::Autogate::isEnabled(util::AutogateKey::PYTHON_FETCH_INDIVIDUAL_PACKAGES)) {
modules->addBuiltinModule("pyodide-internal:packages_tar_reader", "export default { }"_kj,
workerd::jsg::ModuleRegistry::Type::INTERNAL, {});
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/workerd/util/autogate.c++
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ kj::StringPtr KJ_STRINGIFY(AutogateKey key) {
return "test-workerd"_kj;
case AutogateKey::STREAMING_TAIL_WORKERS:
return "streaming-tail-workers"_kj;
case AutogateKey::PYTHON_FETCH_INDIVIDUAL_PACKAGES:
return "python-fetch-individual-packages";
case AutogateKey::NumOfKeys:
KJ_FAIL_ASSERT("NumOfKeys should not be used in getName");
}
Expand Down
3 changes: 3 additions & 0 deletions src/workerd/util/autogate.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ namespace workerd::util {
enum class AutogateKey {
TEST_WORKERD,
STREAMING_TAIL_WORKERS,
// Fetches Python packages as individual bundles from GCS instead of using a single big bundle
// embedded in the binary
PYTHON_FETCH_INDIVIDUAL_PACKAGES,
NumOfKeys // Reserved for iteration.
};

Expand Down
Loading