Commit Graph

4110 Commits

Author SHA1 Message Date
Gary Verhaegen
7d55095f17
reenable collect_build_data and notify_user (#5545)
Looking at the behaviour of `succeededOrFailed`, it looks like it does
not do what we want at all: both steps now only run on failures. My
current hypothesis is that `write_ledger_dump` being skipped switches
the state of the last job to something that is neither success nor
failure.

It would be really nice if Azure had a way to detect cancellation. :(

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-14 11:29:12 +00:00
Robin Krom
6f017cbd39
language: reconnect websocket on closed connection (#5416)
This change adds a simple retry logic to the ledger websocket methods.

If the connection is closed, and the connection was previously healthy,
meaning it was live and running for more than 30 seconds, we try to
reconnect to the stream.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-14 10:32:36 +00:00
Moritz Kiefer
a3cad2d6b8
Change gpg keyserver used in the docs (#5538)
pgp.keyserver.io seems to have lost our key
somehow. pool.sks-keyservers.net is the pool that includes the MIT gpg
keyserver and others so hopefully it is somewhat reliable.

changelog_begin
changelog_end
2020-04-13 11:26:10 +02:00
Rohan Jacob-Rao
7fafe6a08a
GSG: test messaging feature and remove copied code snippets (#5507)
* Diff with messaging feature and some noise manually removed

* Bazel target to use patch file in other build targets

* Patch file as data dep for integration tests

* Attempt to patch and test messaging feature in create-daml-app test

changelog_begin
changelog_end

* Use exports_files instead of filegroup

* Remove file existence checks that don't make sense

* Add patch to dev_env and reference it from integration tests

* Include patch on windows for later

* Set up yarn env again after codegen

* Restore file check

* Fix typo in comment on util function

* Add Tasty steps to make process explicit

* Use messaging patch for code snippets in GSG

* Use messaging code from template instead of copy

* Remove copied message code

* Refactor script to copy template code with messaging patch

* No need to retry second yarn install (only local deps should be updated)
2020-04-11 19:53:44 +00:00
Moritz Kiefer
8773001e72
Make a snapshot release (#5536)
This includes the fix for the sandbox migrations.

changelog_begin
changelog_end
2020-04-11 14:30:25 +00:00
Moritz Kiefer
f050da78c9
Used daml codegen java instead of calling the codegen from maven (#5537)
* Used `daml codegen java` instead of calling the codegen from maven

This should hopefully fix the issues with mismatched versions of
slf4j.

changelog_begin
changelog_end

* Move config to daml.yaml

* Remove alternative invocation via maven from docs
2020-04-11 11:44:53 +00:00
Gerolf Seitz
000bb046db
Sadbonx: Add migration that backfills the participant_events table (#5528)
We started serving the LedgerAPI from the new schema in #5104, #5305, #5346,
and #5397.

We must therefore also add a migration that moves the data from
ledger_entries to the new tables.

To keep the migration relatively stable with respect to refactoring the
code, I copied a bunch of files to
`db.migration.postgres.v25_backfill_participant_events`.

As a bonus, I added a line to logback.xml so that we get the usual
sandbox output on startup.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-11 09:07:48 +00:00
Stefano Baghino
19b3d1a02b
Revert participant_contracts write path (#5535)
changelog_begin
changelog_end
2020-04-11 10:00:27 +02:00
Rohan Jacob-Rao
ce1d1de1a3
Ignore daml.js not daml-ts in create-daml-app template (#5533)
changelog_begin
changelog_end
2020-04-10 20:15:04 +00:00
Leonid Shlyapnikov
89f5ebcde8
Offset ticking fix (#5532)
* Fixing offset tick

changelog_begin
changelog_end
2020-04-10 15:05:19 -04:00
Moritz Kiefer
e70ac2efbb
Fix links to typescript libraries (#5531)
changelog_begin
changelog_end
2020-04-10 20:17:11 +02:00
Bernhard Elsner
0bba883a66
Fix the developer of the Corda integration to be DA (#5529)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 23:58:10 +02:00
Stefano Baghino
21037bfd39
participant_contracts write path (#5522)
* participant_contracts write path

Writes contracts alongside events for interpretation and validation.

changelog_begin
changelog_end

* Fix self-referencing foreign key

* Address https://github.com/digital-asset/daml/pull/5522#discussion_r406289145

* Compute divulgence only if necessary

* Do not attempt at persisting witnesses for transient contracts

* Drop new tables when resetting
2020-04-09 19:33:46 +00:00
Remy
d91da3be51
Engine: refactoring preprocessing. (#5434)
* Engine: refactor preprocessing

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 20:29:03 +02:00
Moritz Kiefer
e7c887a7ee
Fix unstableSplitOn (#5523)
* Fix unstableSplitOn

unstableSplitOn is supposed to behave like splitOn but fast™ but it
didn’t live up to that promise for a few reasons:

1. Java’s split method by default drops empty strings at the
   end. Passing a second negative parameter avoids that.
2. Java’s split method does regex splitting so we need to quote the
   string.
3. Java’s split method splits on an empty pattern whereas we want to
   simply preserve the input.

I’ve added regression tests for this and for unstableDrop and a few
other functions while I was at it.

changelog_begin
changelog_end

* Update compiler/damlc/tests/daml-test-files/UnstableText.daml

Co-Authored-By: Martin Huschenbett <martin.huschenbett@posteo.me>

Co-authored-by: Martin Huschenbett <martin.huschenbett@posteo.me>
2020-04-09 17:13:14 +00:00
Samir Talwar
f84abc01a2
sandbox: Time command execution. (#5521)
* sandbox: Time command execution.

* sandbox: Tiny cleanups in StoreBackedCommandExecutor.

* sandbox: Add metrics for fetching within execution.

CHANGELOG_BEGIN
- [Ledger API Server] Add metrics under "daml.execution" to measure
  command execution time, and fetching within command execution.
CHANGELOG_END

* sandbox: Revert the ApiSubmissionService metric prefix.

It can be private again.

* sandbox: Record a mark on a meter on command execution retries.
2020-04-09 16:41:55 +00:00
Moritz Kiefer
45f4905587
Fix SINCE annotation in TemplateTypeRep tests (#5524)
We forgot to change this to 1.7 once we released that.

changelog_begin
changelog_end
2020-04-09 18:31:09 +02:00
Martin Huschenbett
06632267e9
Haskell: Add assertFileExists to DA.Test.Util (#5520)
* Haskell: Add assertFileExists to DA.Test.Util

This PR adds a helper function `assertFileExists` that captures the
`doesFileExist ... >>= assertBool ...` pattern that is very common in
our Haskell test suites. It also adds the inverse
`assertFileDoesNotExist` function. Both functions are now used where
appropriate.

CHANGELOG_BEGIN
CHANGELOG_END

* Add directory dependency to test-util lib

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 15:29:31 +00:00
Leonid Shlyapnikov
9b6d2dba6c
Applying Carol's JSON API doc changes (#5501)
* Applying Carol's doc changes.

changelog_begin
changelog_end

* reverting back to quickstart guide
2020-04-09 15:13:19 +00:00
Moritz Kiefer
5dd196ac4a
Move GHC session to a Shake rule (#5517)
This is a spin off from the work for making module prefixing
work. There I wanted to be able to use the `GeneratePackageMap` rule
to get access to the modules in an LF package which requires to be in
an Action rather than in IO.

This resulted in a much larger refactoring than I expected, so here is
a list of changes to ease review:

1. I’ve split off Development/IDE/Core/RuleTypes/Daml.hs into its own
   Bazel targets to avoid cycles. This allows us to use a rule without
   depending on the implementation of that rule.

2. Development/IDE/Core/IdeState/Daml.hs has moved into its own Bazel
   target. There is a lot of stuff that needs `withDamlIdeState` now
   since the `ghcide` `initialise` function does not add our Shake rule
   for getting the GHC session and making all of that depend on
   damlc:lib creates a mess.

3. The actual logic of the initialization has stayed the same but
   moved into a rule in Development/IDE/Core/Rules/Daml.hs.

4. As mentioned above, a few things that could previously get away
   with only the rules provided by ghcide now need our own rules so
   they switched to `withDamlIdeState`. This mainly affects `damlc
   docs`.

5. Making daml-docs work with the ofInterestRule is a bit tricky.I did
   find the issue and included the fix but also disabled the
   ofInterestRule since it really does not make sense to generate Core
   in the background.

changelog_begin
changelog_end
2020-04-09 17:11:40 +02:00
Stefano Baghino
2d82451c99
Refactor witnesses table class (#5516)
- removes unnecessary reference to offsets
- pushes event identifier translation out to enable code re-use
- event identifier translation is inline in other iterations, no significant perf degradation
- this will allow to share code between event and contract witness table objects

changelog_begin
changelog_end
2020-04-09 13:02:48 +00:00
Samir Talwar
bb362ce67f
sandbox: Remove ErrorCause.Sequencer. (#5515)
* sandbox: Remove `ErrorCause.Sequencer`.

It doesn't seem to be constructed anywhere.

Feel free to close this if it's used outside the repository.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Don't deconstruct when we can check types in a pattern match.
2020-04-09 11:47:13 +00:00
Gary Verhaegen
840faac2c9
fix docs typo in --crt (#5518)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 11:43:14 +00:00
Samir Talwar
64ae70614a
sandbox: Refactor command execution. (#5513)
* sandbox: Move command execution into its own package.

* sandbox: Make LedgerTimeHelper into a CommandExecutor implementation.

CHANGELOG_BEGIN
CHANGELOG_END

* sandbox: Rename CommandExecutorImpl to StoreBackedCommandExecutor.

And pass it objects, not functions.

* sandbox: Reorder result cases in StoreBackedCommandExecutor.

* sandbox: Inject the LedgerTimeAwareCommandExecutor.
2020-04-09 10:47:00 +00:00
Stefano Baghino
2f4cb38b30
Inline disclosure computation (#5511)
* Inline disclosure computation

It's used only in one place and the blinding info needs to also be used
to compute divulgence for contracts.

changelog_begin
changelog_end

* Address https://github.com/digital-asset/daml/pull/5511#pullrequestreview-390596850
2020-04-09 09:54:25 +00:00
Zbigniew Czapran
dab1ae778f
Small fix in formatting to be consistent with other parts (#5504)
Create and Exercise keywords are usually emboldened in the docs.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 11:36:44 +02:00
Samir Talwar
84b0ea28f2
sandbox: Reset the time service when resetting in Static Time mode. (#5510)
* sandbox: Pull out the default time provider type into a constant.

* sandbox: Name ResetService tests consistently.

* sandbox: Reset the time service when resetting in Static Time mode.

The test, unfortunately, is ``@Ignore`d due to flakiness in CI, so won't
actually be run. However, I _hope_ we're going to remove that
annotation eventually, and it allowed me to test-drive the fix on my
machine, so it's still helpful.

CHANGELOG_BEGIN
- [Sandbox] Fix a regression in the ResetService which did not reset the
  TimeService in static time mode.
CHANGELOG_END
2020-04-09 09:25:35 +00:00
Samir Talwar
1735082e91
sandbox: Re-enable "no seeding mode" for the StandaloneApiServer. (#5509)
Turns out not every participant can support seeding (yet).

CHANGELOG_BEGIN
- [Ledger API Server] Re-introduce an option to disable seeding. This
  does not affect Sandbox.
CHANGELOG_END
2020-04-09 09:05:45 +00:00
Samir Talwar
87d38d8ca6
kvutils: Don't measure submission interpretation twice. (#5496)
This is already measured in the `run` method above.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 07:27:50 +00:00
Samir Talwar
5f412a497a
kvutils/integrity-checker: Report the time taken for each submission. (#5498)
CHANGELOG_BEGIN
CHANGELOG_END
2020-04-09 07:27:46 +00:00
Leonid Shlyapnikov
b1c87e9f12
Fixing scaladoc (#5506)
changelog_begin
changelog_end
2020-04-09 06:01:18 +00:00
Moritz Kiefer
d69d24a0c7
Snapshot release (attempt -9223372036854775808) (#5505)
changelog_begin
changelog_end
2020-04-08 20:27:31 +00:00
Leonid Shlyapnikov
29e1931f17
Add --port-file command line option to JSON API (#5454)
* Adding `--port-file` support

* ``--port-file`` support

* Updating docs

changelog_begin

[JSON API] Add support for ``--port-file`` command line option.
``--http-port 0 --port-file ./json-api.port`` will pick up a free port
and write it into ``./json-api.port` file.

changelog_end

* reformatting

* Usage grammar

* use bimap

* Adding `PortFiles` utility for creating and deleting port files on JVM exit

* Adding scaladoc explaining that the port file should be deleted on

JVM termination.

* Updating usage and docs to reflect that the file must be unique and

will be deleted on graceful shutdown

* Relying on `java.nio.file.FileAlreadyExistsException` to determine the

case when failed due to the nonunique file name.

* toString instead of Exception.getMessage

java.nio exception's getMessage can be just a file name, need the class
name to capture the error context.

* updatePortFile -> createPortFile

* write to file instead of write into file
2020-04-08 18:48:11 +00:00
Moritz Kiefer
1ddcd3c096
Add a note that vscode needs to be restarted (#5503)
changelog_begin
changelog_end
2020-04-08 20:28:42 +02:00
Moritz Kiefer
15c68ee3b5
Remove extraneous backslash (#5502)
I don’t consider this a release blocker but still worth fixing.

changelog_begin
changelog_end
2020-04-08 18:15:58 +00:00
Samir Talwar
bd8e3286c6
daml-lf: Tiny performance improvements. (#5493)
* daml-lf/data: Improve performance of `areEqual`.

`areEqual` constructs a one-element `FrontStack`, which should be cheap,
but turns out to be expensive because it constructs builders along the
way. This provides overloads for `apply` that construct the FrontStack
directly, rather than jumping through hoops.

This also changes the behavior of `FrontStack#equals` to check the
length first, which makes the tests work but might also help
performance.

* daml-lf/data: Merge `length` and `len`.

In `FrontStack`, `BackStack`, and `ImmArray`.

No reason to have `def length = len` when `len` can just be public.

* daml-lf/interpreter: Allocate the right-sized list for arguments.

We spend a fair amount of time in `ArrayList#add`; this lessens that by
making sure than when we clone the `args` array for function
application, we leave some room for adding the arguments.

CHANGELOG_BEGIN
CHANGELOG_END

* daml-lf/data: Revert accidentally-lengthened imports.

Co-Authored-By: Stephen Compall <stephen.compall@daml.com>

* daml-lf/interpreter: Rename `functionArgs` to `extendedArgs`.

Co-authored-by: Stephen Compall <stephen.compall@daml.com>
2020-04-08 16:28:42 +00:00
Moritz Kiefer
2e16e40bfe
Snapshot release (attempt I don’t know) (#5495)
changelog_begin
changelog_end
2020-04-08 18:07:49 +02:00
Moritz Kiefer
3bbd7719bb
Move remaining trigger tests over to scalatest (#5494)
This PR ports the remaining trigger tests to scalatest and kills the
whole client_server_test based infrastructure 🎉

changelog_begin
changelog_end
2020-04-08 17:28:34 +02:00
Gary Verhaegen
1780466330
cleanup collect_build_data & notify_user steps (#5491)
Over the past three weeks or so, I have not seen a single case where the
"get commit" step failed erroneously, i.e. all failures were genuine
pushes, which we don't care about. Therefore, I hacve decided to remove
the `tell_gary` code, as it is long, a bit hairy, and duplicated.

In the meantime I've also discovered there actually is a way to tell
Azure not to run these steps on a canceled build, which I believe makes
sense, so I've added that.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 17:13:36 +02:00
Remy
b3ccacc006
DAML-LF. fix computation of cid (#5486)
The fix is to use the number of nodes of the partial transaction instead of the number of nodes of the full transaction.


CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 16:44:48 +02:00
Martin Huschenbett
cdd342c5a3
Getting Started: Explain success for yarn start (#5492)
Exlain how to spot when `yarn start` was successful.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 11:45:25 +00:00
Martin Huschenbett
a469d9471b
daml2js: Write all dependencies into package.json (#5490)
* daml2js: Write all dependencies into package.json

The dependencies of the generated packages on `@daml/types` and
`@mojotech/json-type-validation` somehow got lost either during a
refactoring or when changing how we depend on other generated packages.

The tests simply running `daml2ts` did not catch this because we write
a temporary `package.json` one level higher up in the directory tree
in order to `yarn install` the dependencies only once.

The tests using the generated packages also did not catch this since
they depend on `@daml/types`, which in turn depends on
`@mojotech/json-type-validation`, themselves and hence had both packages
in scope.

In other words, this is very tricky to test. We try to alleviate this
problem by sharing the code for generating the dependencies between the
function writing the actual `package.json` files and the one writing
the temporary `package.json`. This makes sure that these dependencies
do not get out of sync again.

CHANGELOG_BEGIN
CHANGELOG_END

* Adjust tests

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 11:44:05 +00:00
Gerolf Seitz
97433743a1
Set the Bearer prefix in bindings. (#5484)
* Set the `Bearer ` prefix in bindings.
* Make the `Bearer ` prefix in the authorization header mandatory.
* Bearer prefix can be removed from the token file.

CHANGELOG_BEGIN
[Extractor]: The ``Bearer `` prefix can be removed from the token file.
It is added automatically.
[Navigator]: The ``Bearer `` prefix can be removed from the token file.
It is added automatically.
[DAML Script] The ``Bearer `` prefix can be removed from the token file. It
is added automatically.
[DAML Repl] The ``Bearer `` prefix can be removed from the token file. It is
added automatically.
[Scala Bindings] The ``Bearer `` prefix can be removed from the token. It is
added automatically.
[Java Bindings] The ``Bearer `` prefix can be removed from the token. It is
added automatically.
[DAML Integration Kit] ``AuthService`` implementations MUST read the
``Authorization`` header and the value of the header MUST start with
``Bearer ``.
CHANGELOG_END
2020-04-08 13:07:28 +02:00
Gary Verhaegen
8261af86d2
correct commit title in Slack msg (#5471)
Currently, on a release commit on master, if the commit fails, we get
the message from the target PR, which is confusing. This should
(hopefully; it's a bit hard to test as it would require setting up a
release PR that succeeds but fails on master) get us the title of the
release commit, which hopefully will be less confusing.

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 13:01:42 +02:00
Moritz Kiefer
a96e7425ea
Add a yarn install --force step to make sure changes are picked up (#5489)
Yarn does not pick up changes to file: dependencies and link:
dependencies are unusable because Windows so we add an explicit
install step that refreshes them. It doesn’t make any sense to do
dependency resolution again here and could break something for
unrelated reasons so I added --frozen-lockfile as well.

changelog_begin
changelog_end
2020-04-08 12:15:42 +02:00
associahedron
696de17422
Notify Sofia on #team-daml-ci (#5487)
changelog_begin
changelog_end
2020-04-08 09:31:54 +00:00
fabiotudone-da
1bb1517c08
[TestTool] Provide performance tests for all performance envelopes (#5473)
* Produce performance tests for all envelopes

CHANGELOG_BEGIN
[TestTool] Provide performance tests for all performance envelopes
CHANGELOG_END

* Follow Scala's recommended pattern for enum-like hierarchies
2020-04-08 09:59:29 +02:00
Moritz Kiefer
8d56ed3a7e
Consistently avoid infix syntax in the GSG and reinstantiate dlint (#5483)
We avoided infix syntax here for `elem` but still used it for
`notElem` which doesn’t make much sense. Also we lost the config to
disable the lint when integrating the example in this repo. This
resulted in our own code producing a lint which is obviously a bad
idea.

side note: I think this lint does make sense once you
are familiar with the syntax and I feel slightly bad about disabling
more and more lints so for now I’m keeping it in the config.

changelog_begin
changelog_end
2020-04-08 09:40:50 +02:00
Martin Huschenbett
e2a02ca78c
Getting Started guide: Remove useless yarn build (#5482)
The call to `yarn build` in the Getting Started guide is completely
useless for everything that follows (it would only be necessary if you
want to deploy the app) and quite time consuming. Let's just remove it!

CHANGELOG_BEGIN
CHANGELOG_END
2020-04-08 07:31:00 +00:00
Moritz Kiefer
aca282bc56
Fix choice name in GSG (#5481)
User is the template not the choice. The choice is called SendMessage.

changelog_begin
changelog_end
2020-04-08 07:00:08 +00:00