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

Bump patch version to add deprecation warnings #374

Open
wants to merge 3 commits into
base: v4
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
*
* <p>Relies on {@link java.net.http.HttpClient}
* for the underlying implementation.</p>
*
* @deprecated
* Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10.
* Fauna accounts created after August 21, 2024 must use FQL v10.
* Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
*/
@Deprecated(since = "4.5.1")
public class Connection {

private static final String API_VERSION = "4";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@
* </pre>
*
* @see com.faunadb.client.query.Language
*
* @deprecated
* Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10.
* Fauna accounts created after August 21, 2024 must use FQL v10.
* Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
*/
@Deprecated(since = "4.5.1")
public class FaunaClient {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ public enum Metrics {
QUERY_BYTES_IN("x-query-bytes-in"),
QUERY_BYTES_OUT("x-query-bytes-out"),
QUERY_TIME("x-query-time"),
READ_OPS("x-read-ops"),
STORAGE_BYTES_READ("x-storage-bytes-read"),
STORAGE_BYTES_WRITE("x-storage-bytes-write"),
TXN_RETRIES("x-txn-retries"),
TXN_TIME("x-txn-time"),
WRITE_OPS("x-write-ops");
TXN_TIME("x-txn-time");

private final String metric;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,10 @@ public void shouldReturnMetricsData() throws Exception {
Optional<String> queryBytesIn = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_IN);
Optional<String> queryBytesOut = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_BYTES_OUT);
Optional<String> queryTime = metricsResponse.getMetric(MetricsResponse.Metrics.QUERY_TIME);
Optional<String> readOps = metricsResponse.getMetric(MetricsResponse.Metrics.READ_OPS);
Optional<String> storageBytesRead = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_READ);
Optional<String> storageBytesWrite = metricsResponse.getMetric(MetricsResponse.Metrics.STORAGE_BYTES_WRITE);
Optional<String> txnRetries = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_RETRIES);
Optional<String> txnTime = metricsResponse.getMetric(MetricsResponse.Metrics.TXN_TIME);
Optional<String> writeOps = metricsResponse.getMetric(MetricsResponse.Metrics.WRITE_OPS);

assertThat(byteReadOps.isPresent(), is(true));
assertThat(byteWriteOps.isPresent(), is(true));
Expand All @@ -339,12 +337,10 @@ public void shouldReturnMetricsData() throws Exception {
assertThat(queryBytesIn.isPresent(), is(true));
assertThat(queryBytesOut.isPresent(), is(true));
assertThat(queryTime.isPresent(), is(true));
assertThat(readOps.isPresent(), is(true));
assertThat(storageBytesRead.isPresent(), is(true));
assertThat(storageBytesWrite.isPresent(), is(true));
assertThat(txnRetries.isPresent(), is(true));
assertThat(txnTime.isPresent(), is(true));
assertThat(writeOps.isPresent(), is(true));
}

@Test
Expand Down Expand Up @@ -3171,7 +3167,7 @@ public void streamFailsIfTargetDoesNotExist() throws Exception {
@Test
public void streamFailsIfQueryIsNotReadOnly() throws Exception {
thrown.expectCause(isA(BadRequestException.class));
thrown.expectMessage(containsString("invalid expression: Write effect in read-only query expression."));
thrown.expectMessage(containsString("invalid expression: Call performs a write, which is not allowed in stream requests."));

adminClient.stream(CreateCollection(Collection("spells"))).get();
}
Expand Down
34 changes: 33 additions & 1 deletion faunadb-scala/src/main/scala/faunadb/FaunaClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ import scala.compat.java8.OptionConverters._
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{ExecutionContext, Future}

/** Companion object to the FaunaClient class. */
/**
* Companion object to the FaunaClient class.
*
* @deprecated
* Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10.
* Fauna accounts created after August 21, 2024 must use FQL v10.
* Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
*/
@deprecated("Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10. " +
"Fauna accounts created after August 21, 2024 must use FQL v10. " +
"Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.",
"4.5.1"
)
object FaunaClient {

// singleton ObjectMapper for all clients
Expand All @@ -43,7 +55,17 @@ object FaunaClient {
* milliseconds precision. If not provided, a default timeout value is set on the server side.
* @param userAgent A value used for the User-Agent HTTP header.
* @return A configured FaunaClient instance.
*
* @deprecated
* Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10.
* Fauna accounts created after August 21, 2024 must use FQL v10.
* Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
*/
@deprecated("Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10. " +
"Fauna accounts created after August 21, 2024 must use FQL v10. " +
"Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.",
"4.5.1"
)
def apply(
secret: String = null,
endpoint: String = null,
Expand Down Expand Up @@ -105,7 +127,17 @@ object FaunaClient {
* }}}
*
* @constructor create a new client with a configured [[com.faunadb.common.Connection]].
*
* @deprecated
* Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10.
* Fauna accounts created after August 21, 2024 must use FQL v10.
* Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
*/
@deprecated("Fauna is decommissioning FQL v4 on June 30, 2025. This driver is not compatible with FQL v10. " +
"Fauna accounts created after August 21, 2024 must use FQL v10. " +
"Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.",
"4.5.1"
)
class FaunaClient private (connection: Connection) {

/**
Expand Down
2 changes: 0 additions & 2 deletions faunadb-scala/src/main/scala/faunadb/values/Metrics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ object Metrics extends Enumeration {
val QueryBytesIn = Value("x-query-bytes-in")
val QueryBytesOut = Value("x-query-bytes-out")
val QueryTime = Value("x-query-time")
val ReadOps = Value("x-read-ops")
val StorageBytesRead = Value("x-storage-bytes-read")
val StorageBytesWrite = Value("x-storage-bytes-write")
val TxnRetries = Value("x-txn-retries")
val TxnTime = Value("x-txn-time")
val WriteOps = Value("x-write-ops")

val All = values.toList
}
6 changes: 1 addition & 5 deletions faunadb-scala/src/test/scala/faunadb/ClientSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,10 @@ class ClientSpec
val queryBytesIn = metricsResponse.getMetric(Metrics.QueryBytesIn)
val queryBytesOut = metricsResponse.getMetric(Metrics.QueryBytesOut)
val queryTime = metricsResponse.getMetric(Metrics.QueryTime)
val readOps = metricsResponse.getMetric(Metrics.ReadOps)
val storageBytesRead = metricsResponse.getMetric(Metrics.StorageBytesRead)
val storageBytesWrite = metricsResponse.getMetric(Metrics.StorageBytesWrite)
val txnRetries = metricsResponse.getMetric(Metrics.TxnRetries)
val txnTime = metricsResponse.getMetric(Metrics.TxnTime)
val writeOps = metricsResponse.getMetric(Metrics.WriteOps)

byteReadOps.isDefined should equal (true)
byteWriteOps.isDefined should equal (true)
Expand All @@ -538,12 +536,10 @@ class ClientSpec
queryBytesIn.isDefined should equal (true)
queryBytesOut.isDefined should equal (true)
queryTime.isDefined should equal (true)
readOps.isDefined should equal (true)
storageBytesRead.isDefined should equal (true)
storageBytesWrite.isDefined should equal (true)
txnRetries.isDefined should equal (true)
txnTime.isDefined should equal (true)
writeOps.isDefined should equal (true)
}

it should "paginate with cursor object" in {
Expand Down Expand Up @@ -2163,7 +2159,7 @@ class ClientSpec
it should "stream return error if the query is not readonly" in {
val err = client.stream(Create(Collection("spells"), Obj("data" -> Obj("testField" -> "testValue0")))).failed.futureValue
err shouldBe a[BadRequestException]
err.getMessage should include("Write effect in read-only query expression.")
err.getMessage should include("Call performs a write, which is not allowed in stream requests.")
}

it should "stream on document reference contains `document` field by default" in {
Expand Down
7 changes: 6 additions & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scoverage.ScoverageSbtPlugin.autoImport._

object Settings {

lazy val driverVersion = "4.5.0"
lazy val driverVersion = "4.5.1"

lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.14"
Expand Down Expand Up @@ -61,6 +61,11 @@ object Settings {
<organizationUrl>https://fauna.com</organizationUrl>
</developer>
</developers>
<deprecated>true</deprecated>
<deprecation>
<message>v4 EOL notice</message>
<since>4.5.1</since>
</deprecation>
),
usePgpKeyHex(sys.env.getOrElse("GPG_SIGNING_KEY", "0")),
pgpPassphrase := sys.env.get("GPG_PASSPHRASE") map (_.toArray),
Expand Down