Commit Graph

200 Commits

Author SHA1 Message Date
Rafael Guglielmetti
291bb5d82c
Add min1 and max1 on NonEmpty for Iterable (#14016)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-05-31 13:08:37 +00:00
Stephen Compall
96a6fe62e4
choice name overloading in lf/interface (#13938)
* introduce TemplateChoices to mediate template choice resolution
* if any resolutions fail in EnvironmentInterface, discard the template's resolution
* if any resolutions fail in Interface, discard the remaining unresolved

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-31 08:41:48 -04:00
Marton Nagy
5d8ebd7a08
Switch to asynchronous teardown at Dispatcher (#13631)
Previously a fire and forget release process
was implemented, which in corner cases could
result in exceptions, as API stream was still running after DbDispatcher was released.

This PR changes to waiting for all the streams to finish as releasing Dispatcher (with a timeout of 5 seconds).

CHANGELOG_BEGIN
CHANGELOG_END
2022-05-05 21:15:58 +02:00
Nicu Reut
a792de39a5
Update scalafmt to 3.5.1. (#13584)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-28 09:57:04 +00:00
Andreas Lochbihler
fc8ec7f261
add more operations to NonEmpty (#13647)
* add more operations to NonEmpty
* add sorted method

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2022-04-21 18:25:42 +00:00
Hubert Slojewski
6b3e7969cf
ledger-api-tests: Add hints to eventually [KVL-1407] (#13607)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-15 14:19:57 +02:00
Sergey Kisel
c7e5c83684
Simplify test evidence generator [DPP-996] (#13553)
CHANGELOG_BEGIN
CHANGELOG_END
2022-04-11 19:24:28 +02:00
Soren Bleikertz
e1a13babed
Added CSV export of test evidence (#13483)
changelog_begin
changelog_end
2022-04-05 14:02:12 +02:00
Andreas Lochbihler
af288a6bce
Move the public methods on NonEmpty to companion object (#13415)
Now the signatures of those methods refer to the type synonyms defined in the package object rather than to the abstract type members of the class.
This makes sure that IntelliJ will find the implict classes for NonEmpty and NonEmptyF.

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-29 14:52:41 +02:00
Sergey Kisel
66c37badce
Moving Scala sources to correct path so sources are published correctly. (#13435)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-28 18:58:06 +02:00
Sergey Kisel
b5c3b9460b
Publish test evidence generator library (#13389)
changelog_begin
changelog_end
2022-03-23 17:24:14 +00:00
Sergey Kisel
1543dd2bb4
Generator for test evidence using ScalaTest framework [DPP-962] (#13345)
* Generator for test evidence using ScalaTest framework [DPP-962]

changelog_begin
changelog_end
2022-03-22 15:50:54 +01:00
Sergey Kisel
9eeacdca94
Library for test evidence [DPP-959] (#13319)
* Test library for test evidence to annotate scala and ledger api tests. [DPP-959]

changelog_begin
changelog_end
2022-03-22 11:02:34 +01:00
Stephen Compall
2dd248cd68
move nonempty code to new nonempty library (#13350)
- new nonempty artifact, separate from scala-utils
- com.daml.scalautil.nonempty is now com.daml.nonempty

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-21 17:14:17 +00:00
Sergey Kisel
a4f4300502
Naming and logging improvements [DPP-956] (#13270)
* Naming and logging improvements [DPP-956]

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-15 09:40:39 +01:00
Stephen Compall
2056f0a5cf
nonempty-cats refactoring (#13282)
* move ImplicitPreference to scala-utils
  - test it
  - use it instead of tags for json-api testing
  - fix a somewhat nonsensical type therein
* several new tests for the NonEmpty Foldable instances

CHANGELOG_BEGIN
CHANGELOG_END
2022-03-14 20:48:41 -04:00
pbatko-da
ee6a5f9e0e
Handle misc error codes todos. [DPP-606] (#13248)
changelog_begin
changelog_end
2022-03-14 17:16:31 +01:00
Stephen Compall
2ce4223b97
fix maven_coordinates for nonempty-cats (#13278)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-14 15:05:50 +00:00
pbatko-da
92e3e9e2df
Add unit tests for ErrorCode [DPP-799] (#13236)
changelog_begin
changelog_end
2022-03-14 12:38:23 +01:00
pbatko-da
a27fa0c95a
[Error codes] Move and test logging value string serializer [DPP-606] (#13261)
changelog_begin
changelog_end
2022-03-14 12:09:10 +01:00
Stephen Compall
c9b5750968
NonEmpty utilities, new nonempty-cats library (#13115)
New instances and collection methods, many of which included
as-is from @andreaslochbihler-da's experiments downstream.

* mk, a version of apply with special inference
* new names for the conversion functions suggested by
  @andreaslochbihler-da
* groupBy1, zipWithIndex, reduceLeft, last1, distinct, toVector1
* a derived Semigroup instance
* a more explicit subtyping utility to specify implicit preference than
  what we get with shapeless @@
* from method, alias for unapply
* cats functorial, foldable instances in the new nonempty-cats library
* new NonEmpty utilities

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Lochbihler <36634420+andreaslochbihler-da@users.noreply.github.com>
2022-03-10 16:30:42 +00:00
Gary Verhaegen
1af8934be6
remove Samir's accesses (#13247)
CHANGELOG_BEGIN
CHANGELOG_END
2022-03-10 13:55:10 +00:00
pbatko-da
fbb3ba55c2
Simplify implementations of BaseError trait [DPP-606] (#13185)
1. Remove `BaseError.Impl`, `LoggingTransactionErrorImpl` and `LoggingPackageServiceError` 
and instead provide more direct `DamlError` and `DamlErrorWithDefiniteAnswer`.


2. Remove custom implementation of `TransactionError.rpcStatus` and instead provide simpler one in `DamlErr.r.rpcStatus` (which works by first calling `code.asGrpcStatus` and then converting the result to `com.google.rpc.status.Status`).

3. Remove `GrpcStatus.toProto` and instead use `DamlError.rpcStatus`.

4. Use `asGrpcStatus` and `asGrpcError`  instead of `asGrpcStatusFromContext` and `asGrpcErrorFromContext` where possible.


changelog_begin
changelog_end
2022-03-10 12:12:14 +01:00
Sergey Kisel
9a27edd656
Improve MessageDigest and Mac instance creation to solve lock contention [DPP-956] (#13221)
* Improve MessageDigest and Mac instance creation to solve lock contention problem [DPP-956]

changelog_begin
Scalability bottleneck in regard to hashing has been fixed in multiple places.
changelog_end
2022-03-09 22:15:32 +01:00
pbatko-da
37c645333f
Use an error code when AkkaGrpc services get closed (#13175)
changelog_begin
Ledger API Specification: Streaming endpoints will use error code 'SERVER_IS_SHUTTING_DOWN' when the server
is being shut down, whereas before an exception without an error code was used.
Grpc status code in use remains 'UNAVAILABLE'.
changelog_end
2022-03-08 12:48:22 +01:00
tudor-da
2bfc08bb77
Refactorings (#12992)
* ReleasableResourceOwner and unit test
* Extract ledger end consumption out of LedgerEndPoller

changelog_begin
changelog_end
2022-02-23 15:01:34 +01:00
Remy
ac3d9a4647
LF: Add LoggingContext to Speedy Machine (#12976)
This advances the state of #12208

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-21 13:34:46 +01:00
pbatko-da
b3f8fad987
[User management] Better ListUsers tests and general way to clean up new users [DPP-831] [DPP-889] (#12790)
changelog_begin
changelog_end
2022-02-16 13:23:55 +01:00
Samir Talwar
3dccabf6ba
ledger/cli-opts: Add tests for --auth-* CLI parameters. (#12894)
These were previously untested.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-11 19:42:21 +01:00
Remy
183f936def
LF: Imporve safety of the Serialization of proto message. (#12686)
This is a follow up of #12638, applied to LF support for KV.

CHANGELOG_BEGIN
CHANGELOG_END
2022-02-01 15:45:17 +01:00
Remy
2ac76fd4fe
LF: Gracefully handle serialization error of Values beyond 2GB (#12638)
fixes #12392

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-31 21:10:27 +00:00
Remy
5cdf9b95fb
Remove some unecessary implictly with Factory (#12559)
CHANGELOG_BEGIN
CHANGELOG_END
2022-01-26 13:28:26 +00:00
Marton Nagy
54339ada82
Safeguard Oracle CI tests with lockIdSeed [DPP-802] (#12573)
* Fixes OracleAround so it creates unique oracle users
* Fixes rouge connection pool in JdbcLedgerDaoTransactionsSpec
* Fixes cleanup in OracleAroundAll
* Introduces lockIdSeed for test frameworks
* Adapts usage

changelog_begin
changelog_end
2022-01-26 00:54:17 +01:00
Simon Maxen
cc19df44a8
Persist transaction metering info [DPP-814,DPP-821] (#12274)
* Add transaction metering information to batch and persist to database

changelog_begin
Transaction Metering now persisted to database
changelog_end
2022-01-25 18:29:49 +00:00
Stefano Baghino
f1cd4b1c7c
Remove dependencies on compatibility libraries (#12548)
Continues the work started in https://github.com/digital-asset/daml/pull/12543

These libraries were only needed to transition from Scala 2.12 to 2.13
and are no longer useful as all the necessary items are now available
in Scala 2.13.

changelog_begin
changelog_end
2022-01-24 18:04:07 +00:00
Stefano Baghino
aec3390904
Replace silencer plugin with built-in warning configuration (#12543)
Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
2022-01-24 15:01:35 +00:00
Samir Talwar
eb618935ff
resources: Remove ResettableResourceOwner. (#12499)
It is no longer used.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-20 16:18:35 +01:00
Samir Talwar
ba422bf529
resources: Add more test coverage for parallel acquisition. (#12357)
* resources: Add more test coverage for parallel acquisition.

Just to verify the behavior is as I expected.

CHANGELOG_BEGIN
CHANGELOG_END

* resources: Use concurrent collections in tests, instead of syncing.
2022-01-11 17:15:57 +01:00
akshayshirahatti-da
4f4d18829b
[Trigger-Service] Changes to use a typeconfig conf for trigger-service when provided. (#12217)
* Changes to add the option of starting trigger service with typeconf/HOCON config

CHANGELOG_BEGIN
CHANGELOG_END

* add tests for authorization config and fail on both config file and cli args

* refactor and cleanup config loading and tests

* Changes based on code review comments

* Daml doc changes and making sure that we have defaults for most fields to mirror cli args

CHANGELOG_BEGIN
Trigger Service can now be configured with HOCON config file.
 - If a config file is provided we will choose to start the service using that, else we will fallback to cli arguments.
 - If both config file and cli args are provided we will error out.
CHANGELOG_END

* addressing some more code review comments

* use scalatest inside properly
2022-01-06 00:12:47 +00:00
Gary Verhaegen
d2e2c21684
update copyright headers (#12240)
New year, new copyright, new expected unknown issues with various files
that won't be covered by the script and/or will be but shouldn't change.

I'll do the details on Jan 1, but would appreciate this being
preapproved so I can actually get it merged by then.

CHANGELOG_BEGIN
CHANGELOG_END
2022-01-03 16:36:51 +00:00
nicu-da
2ba3d60947
Add conversions for CompletionStage to Future which unwraps failures (#12165)
changelog_begin
changelog_end
2021-12-17 09:34:20 +00:00
Samir Talwar
9d00861b4e
resources-akka: Wait for the bounded source queue to finish. (#12142)
* resources-akka: Wait for the bounded source queue to finish.

Otherwise, we may get submissions after dependencies have shut down.

CHANGELOG_BEGIN
CHANGELOG_END

* resources-akka: Simplify the interface and use clearer type param names.
2021-12-15 20:42:06 +00:00
Samir Talwar
9f8e640b1a
Use ExecutionContext.parasitic instead of DirectExecutionContext. (#11783)
* concurrent: Replace `DirectExecutionContextInternal` with `parasitic`.

* concurrent: Rename `DirectExecutionContext` `parasitic`.

* Use `ExecutionContext.parasitic` instead of `DirectExecutionContext`.

We no longer need the latter.

CHANGELOG_BEGIN
CHANGELOG_END

* Fix formatting.
2021-12-10 16:25:46 +01:00
Stephen Compall
c4d82f724c
new 2.12-removal-enabled features for NonEmpty (#11933)
* replace pour with a new, total, uncurried apply to create NonEmpty's

* use the new NonEmpty apply in place of pour

* non-empty cons, snoc, head, tail

* add map and flatMap for NonEmpty iterables

* remove scala-collection-compat from scalautils

* tests for map, flatMap, cons

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* missing 'extends AnyVal'

* colliding map and flatMap for Maps

* Revert "colliding map and flatMap for Maps"

* more specific Map and Set return types

* type tests for map operations

* add 'to' conversions
2021-12-07 19:38:37 +00:00
Stefano Baghino
00d3326ebe
Remove source code specific to Scala 2.12 (#12003)
Looks like it has been removed from the build files but not from the source tree.

changelog_begin
changelog_end
2021-12-07 10:08:19 +00:00
Hubert Slojewski
6356f13cde
Properly upgrade gRPC to 1.41.0 (#11858)
CHANGELOG_BEGIN
CHANGELOG_END
2021-11-25 08:50:33 +00:00
Hubert Slojewski
db425216d1
libs-scala: Change SourceQueueResourceOwner to BoundedSourceQueueResourceOwner [KVL-1177] (#11832)
CHANGELOG_BEGIN

- [Integration Kit] `SourceQueueResourceOwner` has been renamed to `BoundedSourceQueueResourceOwner` and takes a `BoundedSourceQueue` from now on

CHANGELOG_END
2021-11-24 12:02:19 +01:00
Moritz Kiefer
addb2edc03
Drop Scala 2.13 version guards from Bazel definitions (#11819)
changelog_begin
changelog_end
2021-11-22 17:37:49 +00:00
Moritz Kiefer
c8ace8b1cf
Factor kind projector target into a variable (#11759)
Seems nicer than trying to format a string everywhere

changelog_begin
changelog_end
2021-11-18 09:51:43 +01:00
Moritz Kiefer
fa7663148a
Drop 2.12 versioned_scala_deps (#11748)
I’ve kept the infrastructure for versioned_scala_deps around because
I’m optimistic and hope that eventually we’ll do another Scala upgrade.

changelog_begin
changelog_end
2021-11-17 22:13:08 +00:00