Commit Graph

3092 Commits

Author SHA1 Message Date
Shayne Fletcher
3811b6c191 Use template Key in template generic params list (#4186)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-23 20:21:24 +00:00
Leonid Shlyapnikov
78b29852d3
JSON API documentation update (#4173)
Document error handling

Document query store

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 14:54:12 -05:00
Robin Krom
811d740df5
upload typescript packages to npm registry (#4185)
* make packages public

This uploads the typescript npm packages of the language support to the
npm registry in the release process.

CHANGELOG_BEGIN
CHANGELOG_END

* address moritz/gary's review

* generate the .npmrc file

* adding debug output

just in case the upload will fail in the next release.

* reverse package order
2020-01-23 18:31:50 +01:00
Samir Talwar
e13f9a7edd
kvutils: Use resources in KeyValueParticipantState, not AutoClo… (#4177)
* kvutils: Use resources in KeyValueParticipantState, not AutoCloseable.

CHANGELOG_BEGIN
- [kvutils] The simplified API now uses ``com.digitalasset.resources``
  to manage acquiring and releasing resources instead of ``Closeable``.
CHANGELOG_END

* ledger-on-posix-filesystem: Remove dead code due to a refactoring fail.
2020-01-23 16:59:01 +01:00
Robin Krom
a3de2fbf0c
rename typescript language support libs (#4180)
We rename the typescript packages of the language support as follows:
  @digitalasset/daml-json-types -> @daml/types
  @digitalasset/daml-ledger-fetch -> @daml/ledger

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 16:14:25 +01:00
Gary Verhaegen
9d8e8d494a
ci cron: tell Slack on failure (#4179)
Currently, when cron jobs fail, this is completely silent. After #4178,
in which we realized the VSCode extension had not been updated for about
a month, I believe it may be a good idea to get error messages sent to
Slack when a cron job fails.

We'll need to monitor for verbosity, but hopefully they will work most
of the time.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 15:28:37 +01:00
associahedron
04e8b4b7b1
First pass at generic order relation in DAML-LF 1.dev spec. (#4116)
* Generic order relation, first pass

* First pass at generic order specification

changelog_begin
changelog_end

* Order functions raise an error if the arguments are incomparable

* refer to internal representation for cid ordering

* Add gen lt rules for maps.
2020-01-23 14:05:05 +00:00
Moritz Kiefer
d62006daaa
Fix yarn target in VSCode ext cron job (#4178)
This has changed in 0a26591849 which
broke the build. We only build the latest release so changing this
should be safe and not break older releases.

changelog_begin
changelog_end
2020-01-23 14:07:05 +01:00
Gerolf Seitz
1866374bbf
Remove the doc sections on the rxjava bots (#3872)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 13:55:44 +01:00
nickchapman-da
62d592ec62
support type synonyms in scala (#4101)
* Support DAML-LF type synonyms in scala.

CHANGELOG_BEGIN
CHANGELOG_END

* dont create synonymns in GenerateSimpleDalf

* extend DAML-LF parser to support type synonyms

* test: expand type synonyms correctly
2020-01-23 10:49:28 +00:00
Moritz Kiefer
20804a4e6b
Add a basic integration test for navigator (#4174)
This test just checks that navigator starts and we get a 200
response. This is obviously not a very comprehensive test but it would
have caught the issues that prevented 0.13.44 an 0.13.45 from getting
published so it seems like a good idea to test this.

changelog_begin
changelog_end
2020-01-23 11:14:18 +01:00
Stefano Baghino
54abbf34ce
Add parties to logging context of active contracts service (#4175)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-23 10:47:16 +01:00
Shayne Fletcher
526801789e Add associated key type for templates (#4172)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-23 09:10:24 +01:00
Samir Talwar
6c1d931c05
ledger-api-test-tool-on-canton: Upgrade to Canton v0.7.0 and cl… (#4170)
* ledger-api-test-tool-on-canton: Upgrade Canton to v0.7.0.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-api-test-tool-on-canton: Use the health endpoint instead of `nc`.

Netty prints a warning when kicking it with `nc -z` from Nix's
netcat-gnu. Not other netcats though… don't know why.

* ledger-api-test-tool-on-canton: Let IntelliJ format the shell script.

* ledger-api-test-tool-on-canton: Stop Canton with SIGINT.

For some reason, Canton doesn't print out a load of errors if it's
stopped with SIGINT (Ctrl+C). SIGTERM, on the other hand…

* ledger-api-test-tool-on-canton: Write Canton logs to STDOUT.

Now the logs are no longer noisy, we can just pump them to STDOUT. This
should make debugging any transient issues on CI a lot easier.
2020-01-23 09:04:16 +01:00
Shayne Fletcher
e9d67ba9f6
Disambiguate consuming vs pre-consuming choices (#4164)
changelog_begin
- [DAML Compiler] Choices marked explicitly as `preconsuming` are now equivalent to a non-consuming choice that calles `archive self` at the beginning.
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-22 14:24:00 -05:00
Robin Krom
8e1e91dcf6
release 0.13.46 (#4171)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 20:15:57 +01:00
Gary Verhaegen
16da700532
temporary Windows machins for Andreas (#4165)
The recent changes to the way in which we build npm packages with Bazel
have caused a lot of issues on Windows. To debug those, Andreas has
requested a temporary machine.

This is pretty much an exact replica of #3294 (a87749113), with the same
plan:

1. I run terraform apply on this PR is merged.
2. I manually, through the GCP web console, set a dummy password for that
  machine's RDP connection and transmit that to @aherrmann-da through
  Slack.
3. @aherrmann-da debugs the issue.
4. I create a PR to roll back this one, then apply it once it's merged.

Note: I have verified that master applies cleanly prior to opening this
PR.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 19:10:01 +01:00
Robin Krom
b054dcc5ab
language: really fix navigator (#4160)
The last fix only worked for linux, this fixes it also on windows.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 18:54:04 +01:00
Remy
b6e848b576
Engine: Add node and contract Discriminator
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 18:49:30 +01:00
Samir Talwar
eeaa2edc91
ledger-on-posix-filesystem: Fix the tests on CI. (#4166)
* libs-scala: Make sure `RetryStrategy` works if `attempts.isEmpty`.

* ledger-on-posix-filesystem: Only retry on expected lock errors.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-on-posix-filesystem: Only create the lock attempt directory once.

Soooo much faster.

* ledger-on-posix-filesystem: Don't run the unit tests on Windows.
2020-01-22 18:02:23 +01:00
Moritz Kiefer
2fb107b505 Remove damlc.jar (#4157)
* Remove damlc.jar

We never advertised or published this externally and our only internal
user has moved off this months ago already.

changelog_begin
changelog_end

* Remove dependency from navigator test lib on damlc jar
2020-01-22 16:44:27 +00:00
Andreas Herrmann
032ed82254
language-support/ts yarn install (#4159)
* Remove language-support/ts/packages/yarn.lock

That file is for local development exclusively.

CHANGELOG_BEGIN
CHANGELOG_END

* yarn args --frozen-lockfile

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-22 17:28:14 +01:00
Moritz Kiefer
9b529ad8cb
Cleanup typescript hacks for Windows (#4167)
changelog_begin
changelog_end
2020-01-22 17:19:45 +01:00
Moritz Kiefer
57d0e32c3e
Mark lsp-tests as flaky (#4158)
This makes me a :sadpanda: but until we have figured out what is going
on, this seems better than forcing manual restarts.

changelog_begin
changelog_end
2020-01-22 16:55:44 +01:00
Samir Talwar
2e3c6b28bd
ledger-on-sql: Get H2 working in the conformance tests. (#4155)
* kvutils: Make logback.xml a base file, rather than the only option.

* kvutils/app: Simplify logback.base.xml.

Mostly by getting rid of unnecessary appenders.

* ledger-on-sql: Add trace logging for all database work.

* Upgrade H2; there's a few useful bug fixes.

* kvutils/app: Let the user override the server JDBC URL.

* kvutils/app: Provide a way to specify the ledger ID.

* ledger-on-sql: If there are missing entries in the log, fail on read.

This can happen right now because we insert in parallel. Next step: stop
doing that.

* ledger-on-sql: Stop writing in parallel; it causes race conditions.

This unfortunately means we also stop _reading_ in parallel, which is
less fun.

* Revert "ledger-on-sql: Use a sequential log entry ID."

This reverts commit c58265bf43.

* ledger-on-sql: Create tables with columns that are not nullable.

* ledger-on-sql: The H2 conformance tests now work, just slowly.

CHANGELOG_BEGIN
CHANGELOG_END

* ledger-on-sql: Run tests against H2 and SQLite on memory and disk.

* ledger-on-sql: Allow H2 to read from the log in parallel with writes.

* ledger-on-sql: Use UUIDs for entry IDs, not 8 random bytes.

* ledger-on-sql: Make sure to log the correlation ID.

* ledger-on-sql: Do less while holding a database connection.

* ledger-on-sql: Log the connection.

* ledger-on-sql: We don't need to tell H2 not to drop the connection.

The connection pool takes care of that.

* ledger-on-sql: Disable H2 conformance tests on CI; they're too slow.

* ledger-on-sql: Rename `loggingContext` to `logCtx`.

* ledger-on-sql: Don't abuse log contexts; put the data in the message.

* ledger-on-sql: Make the connection log line easier to read.

And pull out the logger, even if it's only used once.

* ledger-on-sql: Run the unit tests against (H2, SQLite) * (memory, file).
2020-01-22 16:54:51 +01:00
Remy
63d6e73f4c Engine: Simplify ordering of nodes in transaction (#4140)
* engine: the natural order in Transaction is pre-order traversal

- Do not use anymore SortedMap for nodes in transaction
- Drop unused transaction traversal

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lg: improve generator of transactions
2020-01-22 15:53:44 +00:00
Moritz Kiefer
970d9891fd
Disable all the TS stuff on Windows (#4163)
* Disable all the TS stuff on Windows

changelog_begin
changelog_end

* disable jest explicitly

* more disabling

* :sadpanda:

* Replace @language_support_ts_deps on Windows

Provides dummy content so that `load` commands are still valid on
Windows without `yarn_install`.

* disable daml-ledger-fetch on windows

* shut up buildifier

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-22 16:07:20 +01:00
Moritz Kiefer
2653c6f1fe
Disable eslint_test on Windows (#4161)
* Disable eslint_test on Windows

This is currently breaking CI completely so for now let’s disable it.

changelog_begin
changelog_end

* clean expunge
2020-01-22 14:43:15 +01:00
anticlimactic
4978901f71 Fixed typo in glossary.rst (#4063)
CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 14:29:46 +01:00
Robert Autenrieth
3f95c2ec13
Change sandbox JWT format (#4070)
* Introduce new JWT payload format
... the reader still supports old formats

CHANGELOG_BEGIN
[Sandbox] The sandbox uses a new payload format for authentication tokens (JWTs).
          The old format is deprecated, but still works.
[JSON API] The HTTP JSON API now uses the same payload format for authentication tokens as the sandbox.
           The old format is deprecated, but still works.
CHANGELOG_END

* Add helper function for getting token party

* Support sandbox tokens in JSON API

* Add warning for deprecated formats

* Update documentation

* Add explicit test for new format

* Update JSON API documentation

* Fix test
2020-01-22 14:26:57 +01:00
Shayne Fletcher
674eaffc70
Depend on ghc-lib-parser-ex (for hlint) (#4109)
changelog_begin
changelog_end

Co-authored-by: Shayne Fletcher <shayne.fletcher@digitalasset.com>
2020-01-22 06:25:51 -05:00
Moritz Kiefer
19dd7ed7c4 Handle unserializable scenario result types (#4156)
* Handle unserializable scenario result types

Previously, the conversions made some attempt at guarding against this
by matching on SPap and PClosure. While it would be possible to extend
this to match on STypeRep, this doesn’t actually fix the issue since
this can be nested, e.g., you can have a record with a field that is
an SPAP.

This PR changes this to simply catch any errors thrown from
`toValue`. While this feels a bit ugly, I think it’s a reasonable fix
for now.

changelog_begin

- [DAML Studio] Scenarios with unserializable result types no longer
  crash the scenario service.

changelog_end

* Only run test on DAML-LF >= 1.7
2020-01-22 11:15:46 +00:00
Martin Huschenbett
6abd9f4ca0
Clean the TS vs Bazel stuff a bit (#4149)
* Clean the TS vs Bazel stuff a bit

CHANGELOG_BEGIN
CHANGELOG_END

* Fix build issues

CHANGELOG_BEGIN
CHANGELOG_END

* Add dom library back to daml-json-types

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-22 11:30:50 +01:00
Andreas Herrmann
2d8d8bb1fe Add other node_modules to bazelignore (#4150)
CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-22 09:50:32 +00:00
Moritz Kiefer
a771bf6627 Release 0.13.45 (#4154)
* Release 0.13.45

changelog_begin
changelog_end

* Update docs/source/support/release-notes.rst

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

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2020-01-22 09:20:38 +00:00
Richard Kapolnai
600066691a
Fix minor issues in docs (#4151)
* Change Oblique to opaque.

* Fix docs: unfinished sentence about contract keys

* Update 3_Data.rst

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 23:19:35 +01:00
Robin Krom
81b8897fc8
added a package.json to work with yarn workspaces (#4147)
* added a package.json to work with yarn workspaces

This adds a package.json files on top of our typescript libraries so
that we can develop locally via yarn workspaces. The package.json that
describes the bazel managed dependencies is moved into a subfolder.

CHANGELOG_BEGIN
CHANGELOG_END

* updated bazelignore

* SDK_VERSION -> SDKVERSION
2020-01-21 22:23:51 +01:00
Moritz Kiefer
955978b894
Version the daml-trigger and daml-script DARs using the SDk version (#4148)
This makes much more sense than setting it to a fixed 0.0.1 version.

changelog_begin
changelog_end
2020-01-21 21:30:34 +01:00
Moritz Kiefer
8d7c021001 Remove intermediate PackageImport type (#4142)
* Remove intermediate PackageImport type

We can just reuse GHC’s PackageFlag directly which simplifies things a
bit.

changelog_begin
changelog_end

* windows is bad

* meh

* foobar

* why
2020-01-21 20:27:26 +00:00
nickchapman-da
f2f889547f
restore scala exhaustivity check in match expression by avoiding unapply patterns (#4139)
changelog_begin
changelog_end
2020-01-21 18:24:37 +00:00
Gary Verhaegen
d7a9d541c2
ci: fix collect_build_data checkout failures (#4144)
Azure builds on the merge commit provided by GitHub as
refs/pull/<pr-number>/merge. Either GitHub recently changed to clear out
such commits faster than they used to, or Azure recently changed to
cache the resulting commit sha rather than go through the indirection
again.

Either way, the end result is that, currently, if the other jobs take
"long enough", and `master` has changed in-between the build starting
and the `collect_build_data` step running, the latter will fail to
checkout the commit it is looking for, and the build will irredeemably
fail. The only option is to re-run the entire build (`/azp run` or
rebase/push), which is sort of the entire opposite of the whole reason
for introducing `collect_build_data` in the first place.

This patch aims to address this by not relying on Azure to fetch the
daml repo in the `collect_build_data` job. This is definitely a hack,
but hopefully one that can alleviate the problem for now.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 19:14:46 +01:00
Andreas Herrmann
6cf5458e30
Avoid intermediate nodejs_dev_env (#4135)
* Remove unused npm_nix

* Use node_nix directly on Unix

rules_nodejs requires a vendored node to contain the node distribution
in a subdirectory of the provided external repository. With the default
node Nix package this is not the case. The nodejs_dev_env workspace used
an intermediate repository rule to fulfill these requirements.
Occasionally, this caused flakiness on CI.

This change fulfills this requirement on the Nix side, so that Bazel can
consume the provided Nix derivation directly.

CHANGELOG_BEGIN
CHANGELOG_END

* Avoid collision with dev-env tools like license-checker

* buildifier-fix

* Add comment motivating use of `@node_nix` on Unix.

* Document npm-cli patch

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-21 17:38:11 +01:00
Stefano Baghino
8edd16396d
Improvements to glossary (#4146)
CHANGELOG_BEGIN
[Documentation] Improved glossary
CHANGELOG_END
2020-01-21 17:18:02 +01:00
Moritz Kiefer
359e5c350c
Fix enums in data-dependencies (#4143)
To differentiate between "data X = X" which is translated to a DAML-LF
enum and "data X = X {}" which is translated to a DAML-LF record, we
add a datatype context with GHC.Types.DamlEnum. For
`data-dependencies` this needs to point to Currentsdk.GHC.Types.

changelog_begin
changelog_end
2020-01-21 16:11:31 +01:00
Robin Krom
ad9325275a
language: put sdk versions into package.json (#4122)
* language: put sdk versions into package.json

The typescript library versions of our support libraries are now given
by the sdk version.

CHANGELOG_BEGIN
CHANGELOG_END

* removed local field

* better placeholders

* consistent SDK_VERSION

* sed sdkversion in test script
2020-01-21 15:41:40 +01:00
Remy
4cc14275d5 engine: node are ordered in transactions (#4129)
* engine: node in children are ordered

CHANGELOG_BEGIN
CHANGELOG_END

* address Gerolf's comment
2020-01-21 14:39:35 +00:00
Martin Huschenbett
3d2131fdbd
Remove pseudo* functions from daml-ledger-fetch (#4130)
Since the JSON API supports `fetchByKey` and `exerciseByKey` now, we don't
need the `pseudo*` versions of these functions anymore.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 15:25:40 +01:00
Gary Verhaegen
8a1b46f4fd
docs cron: use GitHub-Flavoured Markdown (#4141)
This patch changes the call to the GitHub API that translates the
release notes from markdown to HTML to use gfm instead of plain
markdown. gfm is a superset of markdown that adds the following:

- GitHub usernames (`@`-mentions) are turned into links to the user's
  profile page.
- Issues and PR numbers (`#1234`) are turned into links to the
  corresponding issue or PR.
- Existing git shas are turned into links to the corresponding commit.

An example of this feature missing is the release notes for
[v0.13.42](https://blog.daml.com/release-notes/0.13.42-1), where
intended links such as

> - Rename argument in active contract to payload. See #3826.

are not rendered.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 14:46:02 +01:00
Andreas Herrmann
e005d4c03b Define and use eslint_test Bazel macro (#4124)
* Define eslint test case

* Define eslint_test macro

* Eslint test for daml-ledger-fetch

* Fix lint issues

* Deduplicate eslint on language-support/ts

* Use eslint --parser-options to define tsconfigRootDiro

Allows to avoid hard-coding the Bazel package path into the package.json
file. Instead derives the package root from the location of the
tsconfig.json file.

* document eslint

* pass kwargs to _eslint_test

* Add copyright header

CHANGELOG_BEGIN
CHANGELOG_END

* Exclude daml-json-types tests from lint

Otherwise eslint complains about mismatching config in `tsconfig.json`.
The test files are excluded from the project in `tsconfig.json`.

* Fix linter warning in daml-json-types

Co-authored-by: Andreas Herrmann <andreash87@gmx.ch>
2020-01-21 13:39:54 +00:00
Samir Talwar
e2a5b26475
contextualized-logging: Move to its own Bazel package. (#4138)
I want to use this in _ledger/ledger-on-sql_, which doesn't depend
directly on Sandbox.

CHANGELOG_BEGIN
CHANGELOG_END
2020-01-21 14:25:06 +01:00