daml/ledger-service/http-json/BUILD.bazel

125 lines
4.1 KiB
Python
Raw Normal View History

2019-08-13 19:23:03 +03:00
# Copyright (c) 2019 The DAML Authors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_library",
"da_scala_test",
)
load("//rules_daml:daml.bzl", "daml_compile")
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
hj_scalacopts = [
json-api: store contracts similar to Extractor's single-table (#3192) * new library ledger-service/db-backend * borrow contracts table schema from extractor * borrow contract insertion, removing some data to be unused * match contract schema with insert function * factor insertContract arguments * offset table declarations * CLI argument for query store * surrogate template IDs * compute surrogate template IDs on-the-fly * database init action * incoherent typeclasses, eh * newtype SurrogateTpId * offset fetch/update functions * bad sql * bulk insert contracts, function for selecting contracts * expose contract column name for query's usage * Initializing DB on startup if configured * dropping existing tables as part of initialization * fix some query syntax errors * createSchema flag * function for streaming transactions with jwt party selected * formatting * usage * collect acs contracts and the ledger offset at the end * lastOffset * fixing merge conflicts, updating the way 3rd party deps are specified * Moving ContractDao into http-json module so it can take domain AST as an input * cleanup * injecting new dependencies * split transaction batches into inserts and deletes * generate sql for deleting contracts * `fetch_sources = True` for java_deps * make the delete-constructed fragment more efficient; handle empty list here * pass logHandler for insertContracts * ContractDao returns ConnectionIO, it's up to the caller to wrap query into a transaction * fixing typo * minor cleanup, moving fromLedgerApi factory function into corresponding companion objects * don't need it any more * GetActiveContractsResponse => domain.Contract factory * make concatFragment private * add partition graph; move other contract-fetching experiments to ContractsFetch * experimenting with akka sources * introducing domain.Offset to work around API's empty/null offset cases * minor cleanup * decompose fetchActiveContractsFromOffset * missed via * ACS splitting graph * finish doc for ACS splitting graph * remove unneeded stages * WIP * lazily read a stream of ConnectionIO into a single ConnectionIO * cancel on IO error * figuring out how to put all the pieces together * graph WIP * Removing workflowId from the JSON API * simplify acsAndBoundary; describe other flow pieces * WIP * use Vector in InsertDeleteStep; add variant for ACS (no deletes) * `org.wartremover.warts.NonUnitStatements` enforced in `http-json` module * evaluate InsertDeleteStep to a ConnectionIO * database variant of LfValueCodec, using numbers for numbers * convert input to JSON, combine insert plans, connect rest of contractsToOffsetIo * remove strict contractsToOffset sink * moving dao methods into an object * putting pieces together * contractsFromOffset WIP * should be it * cleanup * cleanup * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * cleanup * put all pieces together, testing something does not work yet * diff is not required to return anything that is why Sink.lastOption that gives Option[domain.Offset] * factor out tuple split * use traverse syntax in contractsIo2 * factor explicit flow steps out of graph DSL; remove aggregate * locally model the Absolute/Begin distinction for offset bookmarking in DB * Adding test cases to run HTTP Service with Postgres backend the same set of test cases, run with and without DB backend * make better use of domain.Offset in OffsetBoundary * monomorphize InsertDeleteStep#append * Disabling a test that fails with DB backend * add release note * add release note about workflowId * a test case that checks the number or stored contracts * trying to figure out why Postgres test fails on Windows with NPE
2019-11-06 21:53:16 +03:00
"-P:wartremover:traverser:org.wartremover.warts.NonUnitStatements",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
"-Ypartial-unification",
"-Xsource:2.13",
]
http_json_deps = [
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_github_scopt_scopt_2_12",
"@maven//:com_typesafe_akka_akka_http_2_12",
"@maven//:com_typesafe_akka_akka_http_core_2_12",
"@maven//:com_typesafe_akka_akka_http_spray_json_2_12",
"@maven//:com_typesafe_akka_akka_slf4j_2_12",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_spray_spray_json_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
json-api: store contracts similar to Extractor's single-table (#3192) * new library ledger-service/db-backend * borrow contracts table schema from extractor * borrow contract insertion, removing some data to be unused * match contract schema with insert function * factor insertContract arguments * offset table declarations * CLI argument for query store * surrogate template IDs * compute surrogate template IDs on-the-fly * database init action * incoherent typeclasses, eh * newtype SurrogateTpId * offset fetch/update functions * bad sql * bulk insert contracts, function for selecting contracts * expose contract column name for query's usage * Initializing DB on startup if configured * dropping existing tables as part of initialization * fix some query syntax errors * createSchema flag * function for streaming transactions with jwt party selected * formatting * usage * collect acs contracts and the ledger offset at the end * lastOffset * fixing merge conflicts, updating the way 3rd party deps are specified * Moving ContractDao into http-json module so it can take domain AST as an input * cleanup * injecting new dependencies * split transaction batches into inserts and deletes * generate sql for deleting contracts * `fetch_sources = True` for java_deps * make the delete-constructed fragment more efficient; handle empty list here * pass logHandler for insertContracts * ContractDao returns ConnectionIO, it's up to the caller to wrap query into a transaction * fixing typo * minor cleanup, moving fromLedgerApi factory function into corresponding companion objects * don't need it any more * GetActiveContractsResponse => domain.Contract factory * make concatFragment private * add partition graph; move other contract-fetching experiments to ContractsFetch * experimenting with akka sources * introducing domain.Offset to work around API's empty/null offset cases * minor cleanup * decompose fetchActiveContractsFromOffset * missed via * ACS splitting graph * finish doc for ACS splitting graph * remove unneeded stages * WIP * lazily read a stream of ConnectionIO into a single ConnectionIO * cancel on IO error * figuring out how to put all the pieces together * graph WIP * Removing workflowId from the JSON API * simplify acsAndBoundary; describe other flow pieces * WIP * use Vector in InsertDeleteStep; add variant for ACS (no deletes) * `org.wartremover.warts.NonUnitStatements` enforced in `http-json` module * evaluate InsertDeleteStep to a ConnectionIO * database variant of LfValueCodec, using numbers for numbers * convert input to JSON, combine insert plans, connect rest of contractsToOffsetIo * remove strict contractsToOffset sink * moving dao methods into an object * putting pieces together * contractsFromOffset WIP * should be it * cleanup * cleanup * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * cleanup * put all pieces together, testing something does not work yet * diff is not required to return anything that is why Sink.lastOption that gives Option[domain.Offset] * factor out tuple split * use traverse syntax in contractsIo2 * factor explicit flow steps out of graph DSL; remove aggregate * locally model the Absolute/Begin distinction for offset bookmarking in DB * Adding test cases to run HTTP Service with Postgres backend the same set of test cases, run with and without DB backend * make better use of domain.Offset in OffsetBoundary * monomorphize InsertDeleteStep#append * Disabling a test that fails with DB backend * add release note * add release note about workflowId * a test case that checks the number or stored contracts * trying to figure out why Postgres test fails on Windows with NPE
2019-11-06 21:53:16 +03:00
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
"@maven//:org_typelevel_cats_kernel_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_tpolecat_doobie_postgres_2_12",
"//daml-lf/interface",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
"//daml-lf/transaction",
"//language-support/scala/bindings-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger/ledger-api-common",
"//daml-lf/data:data",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
"//ledger-service/lf-value-json",
"//ledger-service/utils",
"//ledger-service/jwt",
json-api: store contracts similar to Extractor's single-table (#3192) * new library ledger-service/db-backend * borrow contracts table schema from extractor * borrow contract insertion, removing some data to be unused * match contract schema with insert function * factor insertContract arguments * offset table declarations * CLI argument for query store * surrogate template IDs * compute surrogate template IDs on-the-fly * database init action * incoherent typeclasses, eh * newtype SurrogateTpId * offset fetch/update functions * bad sql * bulk insert contracts, function for selecting contracts * expose contract column name for query's usage * Initializing DB on startup if configured * dropping existing tables as part of initialization * fix some query syntax errors * createSchema flag * function for streaming transactions with jwt party selected * formatting * usage * collect acs contracts and the ledger offset at the end * lastOffset * fixing merge conflicts, updating the way 3rd party deps are specified * Moving ContractDao into http-json module so it can take domain AST as an input * cleanup * injecting new dependencies * split transaction batches into inserts and deletes * generate sql for deleting contracts * `fetch_sources = True` for java_deps * make the delete-constructed fragment more efficient; handle empty list here * pass logHandler for insertContracts * ContractDao returns ConnectionIO, it's up to the caller to wrap query into a transaction * fixing typo * minor cleanup, moving fromLedgerApi factory function into corresponding companion objects * don't need it any more * GetActiveContractsResponse => domain.Contract factory * make concatFragment private * add partition graph; move other contract-fetching experiments to ContractsFetch * experimenting with akka sources * introducing domain.Offset to work around API's empty/null offset cases * minor cleanup * decompose fetchActiveContractsFromOffset * missed via * ACS splitting graph * finish doc for ACS splitting graph * remove unneeded stages * WIP * lazily read a stream of ConnectionIO into a single ConnectionIO * cancel on IO error * figuring out how to put all the pieces together * graph WIP * Removing workflowId from the JSON API * simplify acsAndBoundary; describe other flow pieces * WIP * use Vector in InsertDeleteStep; add variant for ACS (no deletes) * `org.wartremover.warts.NonUnitStatements` enforced in `http-json` module * evaluate InsertDeleteStep to a ConnectionIO * database variant of LfValueCodec, using numbers for numbers * convert input to JSON, combine insert plans, connect rest of contractsToOffsetIo * remove strict contractsToOffset sink * moving dao methods into an object * putting pieces together * contractsFromOffset WIP * should be it * cleanup * cleanup * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * contractsIo that takes List[domain.TemplateId.RequiredPkg]) * cleanup * put all pieces together, testing something does not work yet * diff is not required to return anything that is why Sink.lastOption that gives Option[domain.Offset] * factor out tuple split * use traverse syntax in contractsIo2 * factor explicit flow steps out of graph DSL; remove aggregate * locally model the Absolute/Begin distinction for offset bookmarking in DB * Adding test cases to run HTTP Service with Postgres backend the same set of test cases, run with and without DB backend * make better use of domain.Offset in OffsetBoundary * monomorphize InsertDeleteStep#append * Disabling a test that fails with DB backend * add release note * add release note about workflowId * a test case that checks the number or stored contracts * trying to figure out why Postgres test fails on Windows with NPE
2019-11-06 21:53:16 +03:00
"//ledger-service/db-backend",
"//libs-scala/auth-utils",
]
da_scala_library(
name = "http-json",
srcs = glob(["src/main/scala/**/*.scala"]),
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
scalacopts = hj_scalacopts,
tags = ["maven_coordinates=com.digitalasset.ledger-service:http-json:__VERSION__"],
visibility = ["//visibility:public"],
deps = http_json_deps,
)
da_scala_binary(
name = "http-json-binary",
main_class = "com.digitalasset.http.Main",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
scalacopts = hj_scalacopts,
tags = [
"maven_coordinates=com.digitalasset.ledger-service:http-json-deploy:__VERSION__",
"no_scala_version_suffix",
],
visibility = ["//visibility:public"],
deps = [":http-json"] + http_json_deps,
)
daml_compile(
name = "Account",
main_src = "src/test/daml/Account.daml",
)
da_scala_test(
name = "tests",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
size = "medium",
srcs = glob(["src/test/scala/**/*.scala"]),
Bazel 1.1 (#3249) * bazel: 0.28.1 --> 1.1.0 * bazel-watcher sha256 * Fix missing line in patch * proto_source_root --> strip_import_prefix See https://github.com/bazelbuild/bazel/issues/7153 for details. * Update rules_nixpkgs Required to avoid errors of the form ``` ERROR: An error occurred during the fetch of repository 'node_nix': parameter 'sep' may not be specified by name, for call to method split(sep, maxsplit = None) of 'string' ``` and ``` ERROR: An error occurred during the fetch of repository 'node_nix': Traceback (most recent call last): File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'nodejs'. Command: [/Users/runner/.nix-profile/bin/nix-build, /private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/node_nix/nix/bazel.nix, "-A", "nodejs", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/nixpkgs/nixpkgs"] Return code: 1 Error output: src/main/tools/process-tools.cc:173: "setitimer": Invalid argument ``` * Update rules_scala * .proto has been removed, use [ProtoInfo] instead See https://docs.bazel.build/versions/1.1.0/be/protocol-buffer.html#proto_library * python3_nix add nix_file attribute To avoid the following error ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/BUILD:66:1: //:nix_python3_runtime depends on @python3_nix//:bin/python in repository @python3_nix which failed to fetch. no such package '@python3_nix//': Traceback (most recent call last): File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'python3'. Command: [/home/aj/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "python3", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs"] Return code: 1 Error output: error: anonymous function at /home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs.nix:3:1 called with unexpected argument 'config', at (string):1:1 ``` * rules_haskell unnamed string.split(_, maxsplit = _) The keyword argument may no longer be named. * string.replace(_, _, maxsplit = _) may not be named * Move proto sources from deps to data Fixes ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/daml-lf/archive/BUILD.bazel:150:1: in deps attribute of scala_test rule //daml-lf/archive:daml_lf_archive_reader_tests_test_suite_src_test_scala_com_digitalasset_daml_lf_archive_DecodeV1Spec.scala: '//daml-lf/archive:daml_lf_1.6_archive_proto_srcs' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'da_scala_test_suite', the error might have been caused by the macro implementation ``` * Define sha256 for haskell_ghc__paths Bazel 1.1.0 fails on missing hashes. * Disable --incompatible_windows_native_test_wrapper * //compiler/daml-extension don't modify sources Modifying sources in-place can cause issues on Windows, where build actions are not sandboxed and changes on sources can affect other build steps. * bazel-genfiles --> bazel-bin The bazel-genfiles symlink has been removed since Bazel 1.0. See https://github.com/bazelbuild/bazel/issues/8651 * Mark dev_env_tool repository rule as configure See https://docs.bazel.build/versions/1.1.0/skylark/lib/globals.html#repository_rule * Move data deps into data attribute * Mark dev_env_tool as local = True * Manually fetch @makensis_dev_env
2019-11-11 12:06:03 +03:00
data = [
":Account.dar",
Bazel 1.1 (#3249) * bazel: 0.28.1 --> 1.1.0 * bazel-watcher sha256 * Fix missing line in patch * proto_source_root --> strip_import_prefix See https://github.com/bazelbuild/bazel/issues/7153 for details. * Update rules_nixpkgs Required to avoid errors of the form ``` ERROR: An error occurred during the fetch of repository 'node_nix': parameter 'sep' may not be specified by name, for call to method split(sep, maxsplit = None) of 'string' ``` and ``` ERROR: An error occurred during the fetch of repository 'node_nix': Traceback (most recent call last): File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'nodejs'. Command: [/Users/runner/.nix-profile/bin/nix-build, /private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/node_nix/nix/bazel.nix, "-A", "nodejs", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/nixpkgs/nixpkgs"] Return code: 1 Error output: src/main/tools/process-tools.cc:173: "setitimer": Invalid argument ``` * Update rules_scala * .proto has been removed, use [ProtoInfo] instead See https://docs.bazel.build/versions/1.1.0/be/protocol-buffer.html#proto_library * python3_nix add nix_file attribute To avoid the following error ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/BUILD:66:1: //:nix_python3_runtime depends on @python3_nix//:bin/python in repository @python3_nix which failed to fetch. no such package '@python3_nix//': Traceback (most recent call last): File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149 _execute_or_fail(repository_ctx, <3 more arguments>) File "/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail fail(<1 more arguments>) Cannot build Nix attribute 'python3'. Command: [/home/aj/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "python3", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs"] Return code: 1 Error output: error: anonymous function at /home/aj/.cache/bazel/_bazel_aj/5f825ad28f8e070f999ba37395e46ee5/external/nixpkgs/nixpkgs.nix:3:1 called with unexpected argument 'config', at (string):1:1 ``` * rules_haskell unnamed string.split(_, maxsplit = _) The keyword argument may no longer be named. * string.replace(_, _, maxsplit = _) may not be named * Move proto sources from deps to data Fixes ``` ERROR: /home/aj/tweag.io/da/da-bazel-1.1/daml-lf/archive/BUILD.bazel:150:1: in deps attribute of scala_test rule //daml-lf/archive:daml_lf_archive_reader_tests_test_suite_src_test_scala_com_digitalasset_daml_lf_archive_DecodeV1Spec.scala: '//daml-lf/archive:daml_lf_1.6_archive_proto_srcs' does not have mandatory providers: 'JavaInfo'. Since this rule was created by the macro 'da_scala_test_suite', the error might have been caused by the macro implementation ``` * Define sha256 for haskell_ghc__paths Bazel 1.1.0 fails on missing hashes. * Disable --incompatible_windows_native_test_wrapper * //compiler/daml-extension don't modify sources Modifying sources in-place can cause issues on Windows, where build actions are not sandboxed and changes on sources can affect other build steps. * bazel-genfiles --> bazel-bin The bazel-genfiles symlink has been removed since Bazel 1.0. See https://github.com/bazelbuild/bazel/issues/8651 * Mark dev_env_tool repository rule as configure See https://docs.bazel.build/versions/1.1.0/skylark/lib/globals.html#repository_rule * Move data deps into data attribute * Mark dev_env_tool as local = True * Manually fetch @makensis_dev_env
2019-11-11 12:06:03 +03:00
"//docs:quickstart-model.dar",
"@postgresql_dev_env//:all",
],
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
resources = glob(["src/test/resources/**/*"]),
scalacopts = hj_scalacopts,
deps = [
":http-json",
HTTP JSON API first version (#1994) * Cleanup * WIP * first integration test + fixture * minor cleanup * Implementing ContractService.lookup * Reverting back to endpoints.all (all2 did not work) * Cleanup * replace ApiValue ADT with aliases to daml-lf/transaction Value ADT * porting rest of navigator to LF Value ADT * Command Service WIP * CommandService WIP * porting more of navigator to LF Value ADT * last error, not first * rename ApiValueImplicits file * special conversion features for ImmArray and FrontStack - just .to[ImmArray] or .to[FrontStack] any random collection * finish porting most of navigator main code * use numeric indices for record field name fallback when pretty-printing * tuples are not serializable * use numeric indices for label fallback in JSON verbose encoding * make traverseEitherStrictly more likely to preserve the seq's class * to shortcut for ImmArraySeq .to[ImmArraySeq] * compiling, passing navigator backend tests * test traverseEitherStrictly more, er, strictly * pass scalacopts through to scaladoc * deal with unused warning * remove unneeded function * simpler error reporting, more private functions in ApiCodecCompressed * move slowApply to FrontStack, test it so it actually works * remove unneeded toStrings; better error from impossible ValueTuple case * scalafmt FrontStackSpec * support alternative, label-free record JSON encoding * Adding domain.CreateCommand + corresponding json formats and dummy json format for lav1.value.Record * CommandService.create should be done... need to test it * TODO added * Cleanup * move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package * Using tagged TemplateId type instead of Identifier + exercise command WIP * adapt navigator to moved pieces * start defining scalacheck extension to ApiCodecCompressedSpec * CommandService.exercise + introducing CommandMeta * Adding command endpoints, can't test them yet, need lf value json formats * fuse some list operations - suggested by @stefanobaghino-da; thanks * blue error message * Minor fixes after merging librify-navigator-json-compressed, #2136 * experiment with an inductive case in TypedValueGenerators * finish a List case for TypedValueGenerators; it's revealing * Introducing API value to LF value converter, CommandsValidator takes IdentifierResolverLike instead of IdentifierResolver * cleanup * remove accidentally readded duplicate aliases * start tying knots in TypedValueGenerators * verbatim copy ApiCodecCompressedSpec to lf-value-json * shift some tests from navigator to lf-value-json * test Optional and Map for ApiCodecCompressed * heavier random testing of ApiCodecCompressed * remove unused dependencies from lf-value-json * adding value json writer * cleanup * Revert "cleanup" This reverts commit 2e4d153f * fixing the build * cleanup * cleaning up imports * JsValue to API value is done, needs a test * cleanup * use scalac -Ypartial-unification in http-json * simplify some Traverse instances * factor CreateCommand and ExerciseCommand traverse instances * Command create integration test WIP * Command create integration test WIP, got rid of the JsonReader and JsonWriter for the values, converting values explicitly * Extracting DomainJsonDecoder and DomainJsonEncoder * LfV refactoring * Create command serialize/deserialize test works * cleanup * resolving conflicts * More json encode/decode tests * logging * command/create passes integration test now * Adding readme * grammar * TODO added * GetActiveContractsResponse encoding * ideintifier conversion renaming * PackageService resolveTemplateId returns domain.TemplateId now * Resolving LF Identifier instead of Template ID, this should also work for Exercise command decoding * cleaning up a bit * daml-lf: show type in TypedValueGenerators-driven errors * exercise command json encoding/decoding works * command/exercise IOU_Transfer integration test passes now * avoid filter for Gens; makes many contract ID gens not fail * test ApiCodecCompressed against 100 random types, 20 random values each * Updating README instructions * improving error handling, failed futures, get logged and reported to the user now as 500 * [ROUTING DSL] Removing routing DSL, it did not work * getting rid of HttpEntity.Strict match + cleanup * fixing the merge conflict * updating README * use Show.shows instead of new Show * List(_) isn't checked, but Seq(_) is slightly safer * improving test assertions * Adding /contracts/lookup implementation * http-json: use ImmArraySeq instead of List; use toRightDisjuction * http-json: .toList.toSet is shorter than fold * http-json: replace .leftMap.map with .bimap * http-json: use subst instead of reimplementing JsonFormat * http-json: remove unused ExceptionHandler * http-json: safer == comparison * Adding two test cases for expected errors * Adding BazelRunfiles.rlocation magic that supposed to handle windows path for bazel dependencies * http-json: import, not extend
2019-07-29 23:49:57 +03:00
"//bazel_tools/runfiles:scala_runfiles",
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
"//daml-lf/data",
"//daml-lf/interface",
"//daml-lf/transaction",
"//daml-lf/transaction-scalacheck",
"//language-support/scala/bindings-akka",
"//ledger-api/rs-grpc-bridge",
"//ledger-service/db-backend",
"//ledger-service/jwt",
"//ledger-service/lf-value-json",
"//ledger-service/utils",
"//ledger/ledger-api-auth",
Remove unused dependencies to da_scala_test(_suite) (#3925) * Remove unused scala.bzl imports * override_targets org.scalatest.scalatest_2.12 Otherwise, rules_scala implicitly adds a different version to scala_test than other packages transitively depending on scalatest. This causes unused dependency checker to raise an error. * Handle rules_scala scalatest in pom_file.bzl * Inline all scala_test dependencies So that `unused_dependency_checker = "error"` can be applied to them. * Run //:buildifier-fix * TMP scala_test_suite --> scala_test * da_scala_test: Enable unused dependency checker * //navigator/backend:navigator-scala-tests * //ledger/sandbox:sandbox-scala-tests * //ledger/participant-state/kvutils:kvutils-tests * //ledger/participant-state:participant-state-tests * //ledger/ledger-api-scala-logging:ledger-api-scala-logging-test * //ledger/ledger-api-common:ledger-api-common-scala-tests * //ledger/ledger-api-client:ledger-api-client-tests * //ledger/ledger-api-auth:ledger-api-auth-scala-tests * //ledger-service/lf-value-json:tests * //ledger-service/jwt:tests * //ledger-service/http-json:tests * //ledger-api/rs-grpc-akka:rs-grpc-akka-tests * //language-support/scala/codegen-sample-app:tests * //language-support/scala/codegen-sample-app:ScalaCodeGenIT * //language-support/scala/codegen:tests * //language-support/scala/bindings-akka:tests * //language-support/java/codegen:test * //language-support/java/codegen:ledger-tests * //language-support/java/bindings-rxjava:bindings-java-tests * //language-support/codegen-common:test * //extractor:extractor-scala-tests * //daml-lf/scenario-interpreter:scenario-interpreter_tests * //daml-lf/language:language-test * //daml-lf/interface:tests * //daml-lf/engine:tests * //daml-lf/encoder:tests * //daml-lf/archive:daml_lf_archive_reader_tests * //daml-assistant/scala-daml-project-config:scala-daml-project-config-tests * UNDO scala_test_suite --> scala_test This reverts commit 13ed47ba725e944533ca1157a070cb8dc30569ac. Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2019-12-30 16:49:59 +03:00
"//ledger/ledger-api-common",
"//ledger/participant-state",
"//ledger/sandbox",
"//ledger/sandbox:sandbox-scala-tests-lib",
"//libs-scala/auth-utils",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_chuusai_shapeless_2_12",
"@maven//:com_lihaoyi_sourcecode_2_12",
"@maven//:com_typesafe_akka_akka_http_core_2_12",
"@maven//:com_typesafe_scala_logging_scala_logging_2_12",
"@maven//:io_spray_spray_json_2_12",
"@maven//:org_scalacheck_scalacheck_2_12",
"@maven//:org_scalatest_scalatest_2_12",
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_tpolecat_doobie_core_2_12",
"@maven//:org_tpolecat_doobie_free_2_12",
"@maven//:org_tpolecat_doobie_postgres_2_12",
"@maven//:org_typelevel_cats_core_2_12",
"@maven//:org_typelevel_cats_effect_2_12",
"@maven//:org_typelevel_cats_free_2_12",
],
)
exports_files(["release/json-api-logback.xml"])