Skip to content

Commit

Permalink
Add missing python-fetch-individual-packages autogate check.
Browse files Browse the repository at this point in the history
  • Loading branch information
dom96 committed Jan 17, 2025
1 parent ebf021c commit bcbe94f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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

0 comments on commit bcbe94f

Please # to comment.