diff --git a/src/workerd/api/r2-bucket.c++ b/src/workerd/api/r2-bucket.c++ index 85fd1412c0d..57d17e5e283 100644 --- a/src/workerd/api/r2-bucket.c++ +++ b/src/workerd/api/r2-bucket.c++ @@ -25,22 +25,6 @@ #include namespace workerd::api::public_beta { -kj::Own r2GetClient( - IoContext& context, uint subrequestChannel, R2UserTracing user) { - TraceContext traceContext = context.makeUserTraceSpan(user.op); - traceContext.setTag("rpc.service"_kjc, "r2"_kjc); - traceContext.setTag(user.method.key, user.method.value); - KJ_IF_SOME(b, user.bucket) { - traceContext.setTag("cloudflare.r2.bucket"_kjc, b); - } - KJ_IF_SOME(tag, user.extraTag) { - traceContext.setTag(tag.key, tag.value); - } - - // TODO(o11y): Attach trace context to awaitIo call to match operation lifetime better? - return context.getHttpClient(subrequestChannel, true, kj::none, traceContext) - .attach(kj::mv(traceContext)); -} kj::Own R2Bucket::getHttpClient(IoContext& context, TraceContext& traceContext) { KJ_SWITCH_ONEOF(clientChannel) { diff --git a/src/workerd/api/r2-bucket.h b/src/workerd/api/r2-bucket.h index a57770965f9..afd0770aedf 100644 --- a/src/workerd/api/r2-bucket.h +++ b/src/workerd/api/r2-bucket.h @@ -15,24 +15,6 @@ class Headers; namespace workerd::api::public_beta { -struct StringTagParams { - kj::LiteralStringConst key; - kj::StringPtr value; -}; - -struct R2UserTracing { - kj::LiteralStringConst op; - StringTagParams method; - // Passing Maybe instead of Maybe here – this avoids a branch on - // the caller side when bucket is already a Maybe, which is more convenient. - kj::Maybe bucket; - kj::Maybe extraTag; -}; - -// Helper for creating R2 HTTP Client with the right span tags across operations. This is much -// cleaner than setting span tags directly in each function. -kj::Own r2GetClient(IoContext& context, uint subrequestChannel, R2UserTracing user); - kj::ArrayPtr fillR2Path( kj::StringPtr pathStorage[1], const kj::Maybe& bucket); diff --git a/src/workerd/api/r2-rpc.h b/src/workerd/api/r2-rpc.h index 1b6f16b459b..832346f89f5 100644 --- a/src/workerd/api/r2-rpc.h +++ b/src/workerd/api/r2-rpc.h @@ -106,7 +106,6 @@ kj::Promise doR2HTTPPutRequest(jsg::Lock& js, kj::Own client, kj::Maybe value, kj::Maybe streamSize, - // Deprecated. For internal beta API only. kj::String metadataPayload, kj::ArrayPtr path, kj::Maybe jwt); diff --git a/src/workerd/io/compatibility-date-test.c++ b/src/workerd/io/compatibility-date-test.c++ index 3ebc2dab859..afa6b2b8c0f 100644 --- a/src/workerd/io/compatibility-date-test.c++ +++ b/src/workerd/io/compatibility-date-test.c++ @@ -74,7 +74,7 @@ KJ_TEST("compatibility flag parsing") { [](kj::StringPtr compatDate, kj::ArrayPtr featureFlags, kj::StringPtr expectedOutput, kj::ArrayPtr expectedErrors = nullptr, CompatibilityDateValidation dateValidation = CompatibilityDateValidation::FUTURE_FOR_TEST, - bool r2InternalBetaApiSet = false, bool experimental = false, + bool r2InternalBetaBindingsSet = false, bool experimental = false, kj::ArrayPtr allowedExperimentalFlags = nullptr) { capnp::MallocMessageBuilder message; auto orphanage = message.getOrphanage(); @@ -95,10 +95,10 @@ KJ_TEST("compatibility flag parsing") { capnp::TextCodec codec; auto parsedExpectedOutput = codec.decode(expectedOutput, orphanage); - if (!r2InternalBetaApiSet) { - // The r2PublicBetaApi is always expected by default regardless of compat date unless - // explicitly disabled. - parsedExpectedOutput.get().setR2PublicBetaApi(true); + if (!r2InternalBetaBindingsSet) { + // obsolete13 is always expected by default regardless of compat date unless explicitly + // disabled with r2_internal_beta_bindings. + parsedExpectedOutput.get().setObsolete13(true); } // If errors are expected, then the output is irrelevant. @@ -230,7 +230,7 @@ KJ_TEST("compatibility flag parsing") { " specCompliantUrl = true," " globalNavigator = true," " captureThrowsAsRejections = true," - " r2PublicBetaApi = true," + " obsolete13 = true," " obsolete14 = false," " noSubstituteNull = true," " transformStreamJavaScriptControllers = true," @@ -288,7 +288,7 @@ KJ_TEST("compatibility flag parsing") { " specCompliantUrl = true," " globalNavigator = true," " captureThrowsAsRejections = true," - " r2PublicBetaApi = true," + " obsolete13 = true," " obsolete14 = false," " noSubstituteNull = true," " transformStreamJavaScriptControllers = true," diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index a2087d79bbf..122ace2201a 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -179,12 +179,12 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef { # throw synchronously. This flag changes the behavior so that async functions return # rejections instead of throwing. - r2PublicBetaApi @13 :Bool + obsolete13 @13 :Bool $compatEnableFlag("r2_public_beta_bindings") $compatDisableFlag("r2_internal_beta_bindings") $compatEnableAllDates; - # R2 public beta bindings are the default. - # R2 internal beta bindings is back-compat. + # Obsolete flag. Has no effect. The R2 bindings that `r2_internal_beta_bindings` used to select + # no longer exist, so all workers get the same R2 API regardless of this flag. obsolete14 @14 :Bool $compatEnableFlag("durable_object_alarms");