Commit Graph

5200 Commits

Author SHA1 Message Date
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
Sofia Faro
245f87fcaa
Add warning for variant constructor with unit arg. (#7369)
* Add warning for variant constructor with unit arg.

changelog_begin
- [DAML Compiler] The compiler will now emit a warning when you have a variant type constructor with a single argument of unit type ``()``. For example, ``data Foo = Bar () | Baz`` will result in a warning on the constructor ``Bar``.  This is because the unit type will not be preserved when importing the package via data-dependencies. The correct solution, usually, is to remove the argument from the constructor: ``data Foo = Bar | Baz``. Note that this rule does not apply when the variant type has only one constructor, since no ambiguity arises.
changelog_end

* Rename checks in preprocessor

* Weird lint but ok
2020-09-10 14:27:36 +01:00
Remy
f67af49044
LF: typos in contract ID spec. (#7364)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-10 10:58:27 +02:00
azure-pipelines[bot]
1d94951c4e
update compat versions for 1.6.0-snapshot.20200908.5166.0.1623baec (#7353)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-10 09:18:14 +02:00
Moritz Kiefer
5bee5a08df
Document ApplicativeDo restrictions (#7359)
fixes #7343

changelog_begin
changelog_end
2020-09-09 17:56:33 +02:00
Martin Huschenbett
cf3d5ad819
Contract ID spec: Fix typos (#7363)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 15:38:36 +00:00
Martin Huschenbett
a239edb0eb
damlc: Don't use uniques for type vars during conversion to LF (#7361)
We had some issues with shadowing of type variables in our DAML-LF type
checkers because of some bugs in our implementations of substitution. As
a workaround for these issues, we suffixed each type variable with its
GHC unique during conversion to DAML-LF. Unfortunately, this leads to
new problems when using parametrized variant types and record
projections in combination with data-dependencies.

This PR, drops the unique suffix when converting to DAML-LF. This
change is possible since we fixed the bugs in the substitutions a while
ago. Fortunately, this also fixes the aforementioned problem regarding
data-dependencies.

This fixes #7284.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 13:40:28 +00:00
Remy
56fd866180
LF: minor cleanup in SortedLookupList (#7345)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 14:57:07 +02:00
Sofia Faro
220cfc5c79
Disable multipackage LSP tests on Windows. (#7360)
* Disable multi-package lsp-tests on windows.

These are consistently timing out on Windows for unknown reasons.
Disabling until we figure out how to fix the tests. See #4904

changelog_begin
changelog_end

* fix definition
2020-09-09 12:50:30 +00:00
azure-pipelines[bot]
7c9704f1ce
rotate release duty after 1.5.0-snapshot.20200908.5166.0.1623baec (#7349)
@cocreature is taking care of 1.5.0-snapshot.20200908.5166.0.1623baec (#7348), so they get pushed back to the end of the line.

Please do not merge this before #7348.

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-09 13:38:28 +02:00
Moritz Kiefer
8d66817f1d
Remove redundant --force from npm invocations (#7358)
NPM doesn’t actually need this (at least it didn’t for me locally and
hopefully CI agrees) to pick up changes and it emits a very
scary-looking warning if you do pass it.

changelog_begin
changelog_end
2020-09-09 13:28:24 +02:00
Martin Huschenbett
2236a949b6
Docs: Minor improvements to ledger structure (#7357)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 13:15:25 +02:00
Remy
0c1d11d5ac
Speedy: dop useless Hasher for value (#7346)
This is a left over of #4893, where we changeed underlying of
SGenMap from InsertOrdMap to TreeMap.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 12:30:48 +02:00
Remy
73121fef0b
LF: minor typo in spec (#7352)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 11:39:32 +02:00
Moritz Kiefer
719ca468bd
Release new snapshot (#7350)
With the last one being the RC for 1.5.0, this is now a 1.6.0
snapshot.

changelog_begin
changelog_end
2020-09-09 08:47:48 +00:00
Remy
95f17d5239
Speedy: share implementation of GenMap and TextMap. (#7334)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-09 09:12:02 +02:00
Gary Verhaegen
1623baec4d
add multi-{key,query} stream to daml-ledger (#7066)
This is an attempt to address #7034 & #7036. Strictly speaking, this
does not match their acceptance criteria, as this only supports multiple
queries, not mixed templates.

Because the two new functions can cover the exact same use cases (and
more) as the existing `streamQuery` and `streamFetchByKey`, the latter
are deprecated. The deprecation cycle I suggest is to deprecate them
immediately by annotating them as such in the documentation (done on
this PR).

That's it. I do not think we ever need to actually remove them, nor to
make them print annoying warnings or anything. There is nothing wrong
with the functions as they stand, they just don't fit in the API
anymore.

We could, at some point, move them to a separate documentation page, or
to the boottm of the existing one, but I feel even removing them from
the documentation is unnecessary.

CHANGELOG_BEGIN

- [JavaScript Client Libraries] Two new methods have been added to
  `daml-ledger`: `streamQueries` and `streamFetchByKeys`. They are
  similar to the existing singular versions, except they can take
  multiple queries and multiple keys, respectively, and return a union
  of what the corresponding individual queries/keys would have. Because
  these new functions can do everything the existing ones can, we are
  deprecating the latter, though there is no plan to remove them.

  Upgrade path is straightforward:

  ```
  streamQuery(t); => streamQueries(t, []);
  streamQuery(t, undefined); => streamQueries(t, []);
  streamQuery(t, q); => streamQueries(t, [q]);
  streamFetchByKey(t, k); => streamFetchByKey(t, [k]);
  ```

  There is one caveat, though: `streamFetchByKeys` is a little bit less
  lenient in the format in which it expects the key. If your existing
  code was conforming to the generated TypeScript code we provide,
  everything should keep working, but if you were using plain JS or
  bypassing the TS type system, it is possible that you used to
  construct keys that will no longer be accepted. The new function
  requires all keys to be given in the _output_ format of the JSON API,
  which is a little bit more strict than the general JSON <-> LF
  conversion rules.

CHANGELOG_END
2020-09-08 19:17:49 +02:00
anthonylusardi-da
86c637b43d
Add links to get forum badges at the end of the GSG sections (#7327)
* Add links to get forum badges at the end of the GSG sections

* CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 12:47:55 -04:00
Remy
b385f9b7d4
Speedy: cleanup test for builtins (#7326)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 16:14:37 +02:00
Remy
598f8d585d
LF: shortcup failure in TypeOrdering (#7204)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 16:14:12 +02:00
Remy
f0372979be
Speedy: shortcup failure in SValue ordering. (#7329)
* LF: shortcup failure in SValue ordering.

Before this PR comparison of lists, maps, ans structural record had a
always linear complexity.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 16:13:40 +02:00
Moritz Kiefer
d086738ac0
Migrate DAML Intro to DAML Script (#7264)
changelog_begin
changelog_end
2020-09-08 14:28:30 +02:00
Moritz Kiefer
fea21e33a6
Migrate leftover scenario in quickstart to DAML Script (#7338)
We already migrated everything in the Tests directory but forgot about
this one.

changelog_begin
changelog_end
2020-09-08 13:15:45 +02:00
azure-pipelines[bot]
8b942687f8
update compat versions for 1.5.0-snapshot.20200907.5151.0.eb68e680 (#7337)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <support@digitalasset.com>
2020-09-08 12:56:35 +02:00
Robin Krom
678a8eef71
Replace yarn with npm (#7222)
* replace yarn with npm in docs

CHANGELOG_BEGIN
CHANGELOG_END

* updating assistant and compatibility tests

* moved gitignore entry to toplevel
2020-09-08 12:07:04 +02:00
Robin Krom
b86d213ecb
moved robin down in release rotation because of holidays. (#7339)
CHANGELOG_BEGIN
CHANGELOG_END
2020-09-08 09:06:26 +00:00
Gerolf Seitz
86608c2d98
Update CODEOWNERS (#7336)
reflect recent org changes

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-07 15:50:40 +00:00
Moritz Kiefer
82c4971d91
Release a new snapshot (#7335)
Includes a bugfix for data-dependencies which we want in 1.5.0.

changelog_begin
changelog_end
2020-09-07 16:56:34 +02:00
Remy
8aa34c701c
Speedy: use standard scala equality to check SBuiltinTests result. (#7333)
This reverts changed made in #3416, where the standard scala was
replace by ad-hoc Speedy equality for SValue. As Speedy equality
become more permisive (e.g. it does not check for type constructor of
records, variants, and enumrations or constructor of variants or
enumerations) this is safer to use standard scala eqality for case
class.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-07 16:33:01 +02:00
Robin Krom
3728106958
create-daml-app: make sure errors are displayed (#7332)
When an error happend during decoding of JSON API answers due to missing
templates, the error was just displayed as an empty object '{}'.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-07 16:21:03 +02:00
Samir Talwar
74e7086662
ledger-api-test-tool: Only create sessions once. (#7328)
* ledger-api-test-tool: Wait for futures when constructing LedgerSession.

* ledger-api-test-tool: Wait for futures on `new ParticipantSession`.

* ledger-api-test-tool: If we create two sessions, close one immediately.

* ledger-api-test-tool: Only create sessions once.

CHANGELOG_BEGIN
- [Ledger API Test Tool] Fix a race condition in which multiple
  connections were created to a single participant, and only one was
  shut down properly. This error was likely benign but may cause
  spurious errors to show up when the test tool finishes and shuts down.
CHANGELOG_END

* ledger-api-test-tool: Let ParticipantSessionManager manage connections.

* ledger-api-test-tool: Shrink the configuration surface area.

* ledger-api-test-tool: Use `Future.traverse` to simplify LedgerSession.

* ledger-api-test-tool: Fix the ParticipantSessionManager logger.

* ledger-api-test-tool: Address issues flagged by @stefanobaghino-da.

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>

* ledger-api-test-tool: Make `SessionParts` a real class.

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-09-07 14:15:52 +00:00
Samir Talwar
eb68e680f6
kvutils: Change the export header from "v3" to "v2". (#7330)
The old v2 is no more. Let's pretend it never happened.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-07 13:52:09 +00:00