Commit Graph

5231 Commits

Author SHA1 Message Date
Stephen Compall
d48e9d251d
ExecutionContext[EC] phantom for control, Future[EC, A] (#7347)
* add phantom-tagged ExecutionContext and Future to scala-utils concurrent package

* many new operations for Futures

* Future, ExecutionContext combinators from porting ledger-on-sql

- picked from 546b84ab9cdf4de2d93ec5682bdee6cfd6b385f8

* move Future, ExecutionContext companions into normal package

* lots of new docs

* many new Future utilities

* working zipWith

* tests for ExecutionContext resolution, showing what will be picked under different scenarios

* even more tests for ExecutionContext resolution

* tests showing some well-typed and ill-typed Future combinator usage

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* missed scalafmt

* one more doc note

* split concurrent package to concurrent library

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-09-17 07:36:50 +00:00
azure-pipelines[bot]
0e31e33df3
update compat versions for 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7417)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-17 08:19:46 +02:00
Gary Verhaegen
2e25dfdc82
reenable Windows cache (#7426)
All machines have been reset.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 23:54:35 +02:00
Gary Verhaegen
f98b92d7ba
reset Windows cache (#7423)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 22:38:40 +02:00
Leonid Shlyapnikov
d13e7aa184
JSON API daily perf test cron job (#7406)
* Add http-json-perf daily cron job

changelog_begin
changelog_end

* commenting out other jobs so we can manually test the new one

* commenting out other jobs so we can manually test the new one

* Fix the shell script

* Fixing the gs bucket, `gs://http-json bucket does not exist`

* uncomment the other jobs

* timestamp from git log

* get rid of DAR copying

* comment out the other jobs, so we can test it

* uncomment the other jobs
2020-09-16 13:02:02 -04:00
Gary Verhaegen
051b0b515e
remove mailchim popup code (#7424)
After discussion we have decided to introduce such popups through Google
Tag Manager, as the release schedule fo these sorts of JS tags does not
mesh well with the current release process of our docs site.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 16:28:38 +00:00
Gary Verhaegen
b9acc09a77
read access to data bucket for appr members (#7422)
We've been saving data there but not doing anything with it. Ideally
this data would be used by some sort of automated process, but in the
meantime (or while developing said processes), having at least some
people with read access can help.

This is a Standard Change requested by @cocreature.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 18:25:23 +02:00
Stefano Baghino
51cd79f47e
Improve release instructions (#7421)
* Improve release instructions

- Add more notes on Remmina and how to use ad-hoc machines
- Fix Windows quickstart testing after change to template

changelog_begin
changelog_end

* Fix typo

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>

Co-authored-by: Samir Talwar <samir.talwar@digitalasset.com>
2020-09-16 16:07:44 +00:00
Remy
23d8451b98
LF: Drop legacy engine configuration for Sandbox Classic. (#7415)
The migration script from #7344 ensures that there are no more values
in Sandbox Classic DB encoded with Value version < 6.  Hence, we do
not need anymore a special EngineConfig to maintain backward
compatibility of Sandbox classic DB.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 17:14:53 +02:00
Moritz Kiefer
b6673b6b4d
Add design doc for authentication in the trigger service (#7394)
* Add design doc for authentication in the trigger service

This is a draft of how I currently imagine authentication in the
trigger service to work. Since the authentication middleware has to be
pluggable in the end anyway we need public documentation in the end
anyway and I find this much easier to manage than a google doc outside
of the repo which just never sees updates.

changelog_begin
changelog_end

* Update triggers/service/authentication.md

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-09-16 15:57:26 +02:00
Leonid Shlyapnikov
fe63816431
Write report summary in text format (#7407)
* write summary.txt

changelog_begin
changelog_end

* make `Response time distribution` brackets configurable
2020-09-16 09:31:54 -04:00
Gary Verhaegen
9632a2fa43
fix check-changelog (#7419)
In #7386 I inadvertently removed the default value for the argument
`check-changelog.sh` takes. This did not break CI because CI always
passes the argument explicitly, but it did break local workflows for
some developers.

Apologies.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:19:37 +00:00
Stefano Baghino
ce6e3a709c
Fix code generation command for release testing (#7418)
* Fix code generation command for release testing

* Address https://github.com/digital-asset/daml/pull/7418#pullrequestreview-489587957

changelog_begin
changelog_end
2020-09-16 13:05:54 +00:00
anthonylusardi-da
54ad2adf06
Remove hubspot mailing list popup and replace with mailchimp (#7408)
* Remove hubspot mailing list popup and replace with mailchimp

* CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 09:01:23 -04:00
Gary Verhaegen
adc0b45f5f
faster docs preview (#7383)
There is generally little need to preview the PDF version of the docs.
Also, opening up the Python server on 0.0.0.0 (the default) triggers OS
warnings on macOS.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 14:12:59 +02:00
Remy
ddbb334ecb
Engine: add submitter arg to Engine#validate (#7405)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:47:21 +02:00
Remy
b8ebd1daf1
Sandbox: Migrate Pre SDK 1.0 values (#7344)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 13:23:54 +02:00
Gary Verhaegen
c94e7256bc
daml/ledger: close ws on stream close (#7404)
The notion of `close` on `Stream` seems a bit confused at the moment. As
the code stands (without this PR), if you register a listener for
`'close'` events, you get notified when the underlying WebSocket closes
(even though the stream will then try to open a new one and, if it
manages to reconnect, will keep sending `'change'` events), and you do
not get notified when the stream itself gets closed (by calling
`.close()` on it), because the code in `.close()` removes the listeners
before closing the WebSocket connection, and so also before trying to
send a message to `'close'` listeners.  Further, calling `.close()` also
does not seem to work as expected, or at least as I would expect: it
will remove all listeners and close the WebSocket connection, but then
it will immediately open it up again (provided that `reconnectThreshold`
milliseconds have elapsed since the WS was last opened), leaking an open
WebSocket connection.

As part of the same confusion, the current implementation also expects
`'close'` listeners on the stream to receive a WebSocket close event, i.e.
of the form `{code, reason}`.

This PR changes the behaviour such that listeners on the _stream_
`'close'` event:

* do not get notified if the WS connection drops but manages to
  reconnect.
* do get notified if the stream closes due to a connection error we
  cannot recover from, with a `4001` status code.
* do get notified if the stream is closed by calling the `.close()`
  method, with a `4000` status code.

This PR also changes the WS termination logic such that calling the
`.close()` method on the stream actually closes the underlying WebSocket
connection.

CHANGELOG_BEGIN

* JavaScript Client Libraries: fix a bug where, upon closing a stream,
  the underlying WebSocket connection may not be properly closed.

CHANGELOG_END
2020-09-16 12:55:11 +02:00
azure-pipelines[bot]
764b5b54a5
rotate release duty after 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7411)
@stefanobaghino-da is taking care of 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7410), so they get pushed back to the end of the line.

Please do not merge this before #7410.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-16 12:46:44 +02:00
azure-pipelines[bot]
2fe9eae394
release 1.6.0-snapshot.20200915.5208.0.09014dc6 (#7410)
@stefanobaghino-da is in charge of this release.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-16 12:39:31 +02:00
Gary Verhaegen
3baa96be14
fixup whitespace in release/src/Upload.hs (#7414)
Please indulge my OCD.

And apologies to whoever was counting on these for their steganographed
[Whitespace] program.

[Whitespace]: https://esolangs.org/wiki/Whitespace

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 11:47:48 +02:00
Gary Verhaegen
68c3f0de3e
increase Maven timeout (#7413)
We reach the timeout on pretty much every release lately and we need to
retry to entire release process two or three times to get through. This
is us giving up on Maven, not Maven itself crashing, so I4d like to try
giving it more time.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 09:37:57 +00:00
Moritz Kiefer
fcc7c928e2
Release 1.5.0 (#7412)
Note that following the changed process for release notes which now
just point to the blog, this does not include an update to the release
notes in the rst file.

changelog_begin
changelog_end
2020-09-16 10:51:45 +02:00
Stephen Compall
09014dc637
use GenMaps for trigger ACS (#7365)
* use GenMaps for trigger ACS

* Next removed for 1.dev

* temp port trigger test code to 1.dev only

* run trigger tests on 1.dev only

* move pending back to TextMap

* include trigger service in the 1.dev test lineup

- it takes >2min, so shouldn't be permanent

* add Ord TypeRep and Ord TemplateTypeRep when possible

* swap names in Internal to reduce the diff

* try to enable cpp for triggers compilation

$ bazel build //triggers/daml:daml-trigger-1.dev
<snip>
File:     daml/Daml/Trigger/Internal.daml
Hidden:   no
Range:    103:-1-103:-1
Source:   CPP
Severity: DsError
Message:  22 in hpp-0.6.1:Hpp.CmdLine
File:     daml/Daml/Trigger.daml
Hidden:   no
Range:    103:-1-103:-1
Source:   CPP
Severity: DsError
Message:  22 in hpp-0.6.1:Hpp.CmdLine
ERROR: Creation of DAR file failed.
<snip>

* remove problematic options for invoking cpp

hpp: Couldn't open input file: -Werror
CallStack (from HasCallStack):
  error, called at src/Hpp/CmdLine.hs:103:22 in hpp-0.6.1:Hpp.CmdLine

* enough cpp so default and 1.dev triggers compile

* cpp needed for docs as well

* no changelog

CHANGELOG_BEGIN
CHANGELOG_END

* return trigger service to testing against sdk default lf version

* run trigger integration test against sdk default and LF 1.dev

* return trigger scenario test to SDK default LF version

* avoid import warnings in trigger lib

* Windows manifests a missing file differently. Hilarious
2020-09-15 12:30:23 -04:00
Leonid Shlyapnikov
ae2981eaf2
Updating readme (#7398)
changelog_begin
changelog_end
2020-09-15 08:51:57 -04:00
Sofia Faro
861d9b0d05
Add --navigator-port option in daml start. (#7401)
* Add --navigator-port option in daml start.

Fixes #5777

changelog_begin

- [DAML SDK] Added a ``--navigator-port`` option in ``daml start``,
  allowing you to specify the port for navigator's web server.

changelog_end

* Perform defaulting in optparse-applicative
2020-09-15 11:16:35 +00:00
Bernhard Elsner
1af817aba6
Add a queryFilter function to Daml.Script (#7367)
* Add a queryFor function to Daml.Script

`queryFor` combines `query` and filter. A very common pattern.

CHANGELOG_BEGIN
CHANGELOG_END

* Update daml-script/daml/Daml/Script.daml

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-15 09:40:46 +00:00
mziolekda
7a1fd2dbb2
Tame concurrent double spend test [KVL-470] (#7395)
* Tame concurrent double spend test [KVL-470]

* address review commnents
2020-09-15 08:40:52 +02:00
Gary Verhaegen
b2d58a3304
save daily perf results (#7396)
It's a real shame I forgot to do this sooner, but better late than never
I suppose.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 18:38:31 +00:00
Gary Verhaegen
d966178f47
add indication of DAML_SDK_VERSION for daml version (#7385)
Fixes #7381.

```
$ alias daml=~/.daml/sdk/0.0.0/daml/daml
$ daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=invalid daml version
daml: Invalid value for environment variable DAML_SDK_VERSION.
  context: Determining SDK version and path.
  details: Invalid SDK version  "invalid": Failed reading: takeWhile1

$ DAML_SDK_VERSION=1.4.4 daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.4.4                                    (selected by env var DAML_SDK_VERSION, not installed)
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=1.4.0 daml version
DAML SDK versions:
  0.0.0
  1.4.0                                    (selected by env var DAML_SDK_VERSION)
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (default SDK version for new projects)
$ DAML_SDK_VERSION=1.5.0-snapshot.20200902.5118.0.2b3cf1b3 daml version
DAML SDK versions:
  0.0.0
  1.4.0
  1.5.0-snapshot.20200811.4959.0.bbc2fe56
  1.5.0-snapshot.20200818.5027.0.1b33d374
  1.5.0-snapshot.20200902.5118.0.2b3cf1b3  (selected by env var DAML_SDK_VERSION, default SDK version for new projects)
$
```

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 19:31:06 +02:00
Sofia Faro
ef67efbaaf
Fix missing date under/overflow in DA.Date.date (#7393)
* Fix missing date under/overflow in DA.Date.date

changelog_begin

- [DAML Standard Library] Bugfix: DA.Date.date
  now raises an error when the day argument is
  outside the valid range.

changelog_end

* Add test for underflow too
2020-09-14 16:09:18 +01:00
Moritz Kiefer
f28c877584
Expose Script in data-dependencies (#7391)
Previously, it was filtered out by accident since damlc considered it
to be an old-style typeclass. This PR fixes this by adding a dummy
field.

This is primarily useful in DAML REPL since all DARs there are
importad as data-dependencies atm. It’s not actually all that useful
across SDK versions since you end up with multiple daml-script
libraries but at least within an SDK you can use it and don’t have to
think about whether your project is a dependency or data-dependency.

changelog_begin
changelog_end
2020-09-14 15:29:09 +02:00
daravep
7ab036bd2a
Added in-place update to var-gauge (#7374)
Before, we could in-place update the value of a var gauge. Now, we can not only set such a value but in-place update it atomically.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 15:00:31 +02:00
Remy
23d5552807
DAML-script: drop ScriptLedgerClient.Command (#7378)
in favor of standard lf.command.Command.

This PR tries to decuple a bit more DAML-script to speedy.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 14:46:49 +02:00
Moritz Kiefer
f28e783725
Bump node-fetch in language-support/ts/packages (#7390)
Fixes a security alert by bumping cross-fetch to pull in the new
node-fetch which also gets rid of a transitive dep.

changelog_begin
changelog_end
2020-09-14 14:05:41 +02:00
Gary Verhaegen
bcee8f9152
let dependabot bypass changelog check (#7386)
Currently, when Dependabot makes a PR, not only do we need to manually
trigger CI through `/azp run`, we also need to either change the commit
or add a new one to pass the changelog check. This addresses that second
part by making a exception for PRs signed by dependabot.

This is also a bit of an excuse to play with git signatures and gpg.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 14:04:37 +02:00
dependabot[bot]
166c799618
Bump node-fetch from 2.6.0 to 2.6.1 in /compiler/daml-extension (#7389)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

changelog_begin
changelog_end

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-14 11:44:15 +00:00
Gary Verhaegen
852189ac73
add gitattributes to templates (#7388)
As suggested by @hurryabit in #129.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 13:37:53 +02:00
dependabot[bot]
32356a465b
Bump node-fetch from 2.6.0 to 2.6.1 in /navigator/frontend (#7382)
* Bump node-fetch from 2.6.0 to 2.6.1 in /navigator/frontend

Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

* add changelog entry

This is a dummy commit to add a changelog entry to the PR.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2020-09-14 10:07:37 +02:00
Remy
c94f81db0f
DAML-script: fix complexity of script.Converter#toCommands (#7377)
imporve complexity from quadratic to linear

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 09:34:44 +02:00
Remy
c9c5bcbfe0
DAML-script: limit usage of SParty (#7376)
This PR tries to decuple DAML-script to speedy.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-14 09:33:38 +02:00
Miklos
7bab3f1b39
Make sure the gzip input/output streams get closed in case of an exception. (#7384)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-11 13:42:45 +00:00
Leonid Shlyapnikov
4fbde3c672
Open-sourcing Gatling statistics reporter (#7325)
* Open sourcing gatling statistics reporter

Running gatling scenarios with `RunLikeGatling` from libs-scala/gatling-utils

* cleaning up

* Replace "\n" with System.lineSeparator

so the formatting test cases pass on windows

* Testing DurationStatistics Monoid laws

* Renaming RunLikeGatling -> CustomRunner
2020-09-11 13:39:05 +00:00
Miklos
f4f187b0ca
Close GzipInputStream after decompressing message. (#7380)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-11 12:37:43 +00:00
Samir Talwar
929c2216c2
nix: Pin scala to v2.12.11, the same version we use in Bazel. (#7379)
The version in nixpkgs is v2.12.10, which means that the Scala REPL we
used was not the same version as we use in our code.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-11 09:58:29 +00:00
Brian Healey
b2e1dd85cd
Upgrade Jackson to 2.11.2 to address security vulnerabilities (#7375)
CHANGELOG_BEGIN
Upgrade Jackson to 2.11.2 to address security vulnerabilities
CHANGELOG_END

Signed-off-by: Brian Healey <brian.healey@digitalasset.com>
2020-09-10 14:32:01 -04:00
Moritz Kiefer
84fe505a58
Add queryContractKey to DAML Script (#7354)
* Add queryContractKey to DAML Script

This matches the behavior and the implementation of
`queryContractId`. We only return contracts for stakeholders and we
return an `Optional` so you can handle lookup failures. On the JSON
API and in DAML Studio this is fairly efficient, over the gRPC API it
degrades to a linear search.

changelog_begin

- [DAML Script] Add `queryContractKey` to the DAML Script API.

changelog_end

* Update daml-script/runner/src/main/scala/com/digitalasset/daml/lf/engine/script/LedgerInteraction.scala

Co-authored-by: Stephen Compall <stephen.compall@daml.com>

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-09-10 19:39:23 +02:00
Gary Verhaegen
b4d211642c
fixup Terraform setup (#7373)
It looks like #6761 broke our Terraform setup by upgrading the nixpkgs
snapshot. That this has not been caught earlier is, I suppose, a
testament to how stable our infrastructure has become nowadays.

This is the same issue we had with the Google providers in #6402, i.e.
we are trying to pin the provider versions both at the nix level and at
the terraform level, with no way to force them to stay in sync.

I don't have a good proposal for such a way, and it seems rare and
innocuous enough to not warrant the investment to fix this at a more
fundamental level.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-10 16:28:18 +02:00
Moritz Kiefer
c0b6851abe
Generate hoogle docs for daml script/triggers (#7371)
* Generate hoogle docs for daml script/triggers

This PR switches over the documentation generation for daml script and
daml triggers to the multi-page format we already use for the standard
library and extends it to also generate hoogle documentation.

All 3 hoogle files are combined in a single hoogle_db.tar.gz archive.

Since the location in the multi-page format is different, I’ve added
redirects.

I verified locally, that I can generate the hoogle database and that
the links point to the right places.

changelog_begin
changelog_end

* Fix baseurl for daml-stdlib

changelog_begin
changelog_end
2020-09-10 15:58:15 +02:00
Gary Verhaegen
4b13b18c8f
hoogle db as tarbal (#7370)
We want to be able to support more than one package in our [Hoogle]
instance. In order to not have to list each file individually, we assume
the collection of Hoogle text files will be published as a tarball.

Note: we keep trying the existing file for now, because the deployment
of this change needs to be done in separate, asynchronous steps if we
want everything to keep working with no downtime:

1. We deploy the new version of the Hoogle configuration, which supports
   both the new and old file structure on the docs website (this PR).
2. After the next stable version (likely 1.6) is published, the docs
   site actually changes to the new format.
3. We can then clean-up the Hoogle configuration.

Any other sequence will require turning off Hoogle and coordinating with
the docs update, which seems impractical.

[Hoogle]: https://hoogle.daml.com

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-10 15:39:09 +02:00