Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LF: change type from Try to Either in archive module #10277

Merged
merged 6 commits into from
Jul 14, 2021

Conversation

remyhaemmerle-da
Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da commented Jul 14, 2021

This is the first part of restructuring errors in archive module.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@remyhaemmerle-da remyhaemmerle-da added the component/daml-engine DAML-LF Engine & Interpreter label Jul 14, 2021
@remyhaemmerle-da remyhaemmerle-da added this to the Maintenance milestone Jul 14, 2021
@remyhaemmerle-da remyhaemmerle-da changed the title Remy lf archive errors LF: change type from Try to Either in archive module Jul 14, 2021
@remyhaemmerle-da remyhaemmerle-da force-pushed the remy-lf-archive-errors branch 2 times, most recently from ce1e784 to fbac3f9 Compare July 14, 2021 13:38
@remyhaemmerle-da remyhaemmerle-da marked this pull request as ready for review July 14, 2021 13:39
@remyhaemmerle-da remyhaemmerle-da requested a review from a user July 14, 2021 13:39
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

remyhaemmerle-da and others added 5 commits July 14, 2021 19:10
This is the first part of restructuring errors in archive module.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
@mergify mergify bot merged commit a8f1902 into main Jul 14, 2021
@mergify mergify bot deleted the remy-lf-archive-errors branch July 14, 2021 19:24
@S11001001
Copy link
Contributor

not a huge fan of the type synonyms for this type of stuff.

I am a fan of this specific example, for two reasons:

  1. It's of the "make me rewrite all these signatures once, shame on you, make me do it twice, shame on me" variety. Such a refactoring worth doing once is worth guarding against having to do again.
  2. Specific to Scala, in situations where you can't infer the higher-kinded type Either[Error, ?], it's nicer to have Result at hand to avoid the kind-projector, or worse, writing it out in the official way ({type l[a] = Either[Error, a]})#l.

remyhaemmerle-da added a commit that referenced this pull request Jul 15, 2021
This is a follow up of #10277.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
remyhaemmerle-da added a commit that referenced this pull request Jul 19, 2021
This is a follow up of #10277.
This is part of #9974.

CHANGELOG_BEGIN
CHANGELOG_END
azure-pipelines bot pushed a commit that referenced this pull request Jul 21, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@Robin-da is in charge of this release.

Commit log:
```
b7cf42d Upgrade doobie to version 0.13.4 (#10326)
1a72314 fix broken triggers link (#10336)
271f9da Added back DeduplicationPeriod.DeduplicationOffset [KVL-998] (#10324)
b701caa Report divulgence warning at commit location. (#10329)
742bdcb Describe prometheus in daml-on-sql README (#10307)
93d0ed6 [Mutable cache] Resolve with full lookup on negative cache read-through lookups [DPP-501] (#10262)
f59951b document min npm version (#10330)
d982e16 fix besu listing (#10328)
c3bc26f daml-lf/data: Move ID aliases to `Ref` from _ledger-api-common_. [KVL-1002] (#10323)
cf2f79d Register divulgence warning as a diagnostic (#10289)
8360e9f Mark Java Bot tests flaky (#10322)
a6bf892 [In-memory fan-out] CLI parameters update (#10250)
5fa49c3 Disables flaky test suite of InstrumentedSource.bufferedSource (#10321)
504c231 Use a combined template id, stakeholder index (#10315)
9a01065 participant-state: Remove the Daml-LF transaction and value aliases. [KVL-1002] (#10317)
159728d LF: use Either by default in all archive reader API (#10295)
449a72a increase ES memory (#10318)
80b65f6 [DOCS] Add documentation for the JSON API metrics (#10312)
6abb903 [JSON-API] Put the request & response bodies into the log ctx if the log level is debug (for specific statements) (#10298)
3c0010b detect mount issue earlier (#10313)
0e09f3b Remove optLocation field from transaction nodes. (#10301)
e62852f Make ledger API test tool's 'max-connection-attempts' into an option (#10311)
bd12170 participant-state: Remove the `ParticipantId`, `PackageId`, and `Party` aliases. [KVL-1002] (#10308)
fed4497 Extend JSON API ContractDao query bench’s with different tpids (#10309)
bd35f80 ledger-configuration: Correct the protobuf package. [KVL-1002] (#10302)
d69328d Ledger API Test Tool: add a `--max-connection-attempts` command line option [KVL-977] (#10297)
a3b861e refresh es cluster (#10300)
63332d0 update NOTICES file (#10306)
1ee53c0 participant-state-index: Use `Ref` directly. (#10299)
0eba812 Remove trace_context field from Ledger API [KVL-1021] (#10256)
88886be ledger-configuration: Add tests for the `Configuration` decoding methods. [KVL-1002] (#10293)
cb29f34 ledger-offset: Move `Offset` to a new package. [KVL-1002] (#10296)
b899ae1 Codeowners: Add @nicu-da to the kvutils code review. (#10292)
f033bc2 LF: Clean legacy from archive proto + TEXT_TO_CODE_POINTS  typo (#10286)
70b12f0 ledger-on-sql: Remove conformance tests for H2 and SQLite files. (#10291)
a9a0b70 ledger-configuration: Extract the configuration from participant-state. [KVL-1002] (#10279)
d96b54e Use Text not String in exception docs (#10287)
5382253 Refresh json API materialized view on statement (#10285)
6e447c5 Patch export filtering of GHC.Types.[] in damldocs (#10282)
d565cae DPP-457 Add UpdateToDbdto tests (#10116)
814442e update NOTICES file (#10284)
0493480 rotate release duty after 1.15.0-snapshot.20210713.7343.0.1f35db17 (#10268)
84094e0 update compat versions for 1.15.0 (#10281)
ba8e829 [In-memory fan-out] Oracle support (#10263)
a8f1902 LF: change type from Try to Either in archive module (#10277)
c84b37a Release SDK 1.15 (#10269)
980d96b Fix status check in collect_build_data (#10278)
191d3b8 Add unit test to SequentialWriteDao [DPP-456] (#10265)
2271f93 Fix crash on duplicate submissionId (#10242)
906184c LF: Simplify UniversalDarReader (#10271)
42c487b [JSON-API] Refactor Endpoints.scala to use path directives etc. (#10274)
6840401 release 1.15.0-snapshot.20210713.7343.0.1f35db17 (#10267)
0df70fa Document bazel-testlogs directory in BAZEL.md (#10276)
44204bb Add a benchmark for contract insertion in the JSON API (#10272)
6107f8a Ignore failure to upload log failures (#10270)
caf85a2 LF: rationalize archive Parser/Reader/Decoder (#10239)
0043b81 Add a ContractDao benchmark (#10259)
21a9e62 Add disclaimer to participant state v2 API [KVL-998] (#10254)
6c63f96 participant-integration-api: Move `SeedService` here. (#10261)
58c0b46 kvutils: Simplify usage of Rejections [KVL-1015] (#10258)
41aba1c kvutils: Move unrelated test cases to a proper test class [KVL-1015] (#10257)
```
Changelog:
```

- [JSON-API] You can now find a section `Metrics` in the http-json api documentation explaining how to enable metrics and which are available

- [JSON-API] Logging of the request and response bodies are now available for appropriate requests if the chosen log level is equal or lower than DEBUG. These can then be found in the logging context of the request begin & end log messages (The field names in the ctx are "request_body" and "response_body").
- [Integration Kit] The *ledger_configuration.proto* Protobuf definition
  has been repackaged under ``com.daml.ledger.configuration``, and the
  Java and C# packages have been renamed accordingly. If you are using
  this Protobuf definition, you will need to update your imports. The
  Maven artifact name has not changed.
- [Integration Kit] Add a `--max-connection-attempts` command line option to the Ledger API Test Tool
* [Integration Kit] Removed trace_context field from Ledger API and its bindings as we now have trace context propagation support via gRPC metadata. If you are constructing or consuming Ledger API requests or responses directly, you may need to update your code.
- [Integration Kit] The ``Offset`` type has been moved to a new Maven
  package, ``ledger-offset``, from the ``participant-state`` package.
  The Java package has been renamed to ``com.daml.ledger.offset``. If
  you are using this type, you will need to update your dependencies and
  imports.
- [Integration Kit] The ledger configuration classes, ``Configuration``,
  ``LedgerInitialConditions``, and ``TimeModel``, have been moved from
  *participant-state* to a separate package named
  *ledger-configuration*, in the Java package
  ``com.daml.ledger.configuration``. You will need to update your
  dependencies and imports.
- [Integration Kit] ``TimeModel`` has been renamed to
  ``LedgerTimeModel``. If you are using the ledger configuration classes
  directly, you may need to update your code.
Fix crash in ConfigManagement- and PackageManagement- services on duplicate submissionsIds from different participants.
Extend ledger-api-test-tool to cover the duplicate submissionId cases.
- [Integration Kit] The class ``SeedService`` has been moved from the
  *participant-state* Maven package to the *participant-integration-api*
  Maven package, under the Java package name
  ``com.daml.platform.apiserver`` to reflect its usage by the API
  server, not the participant state API. If you use this class directly,
  you will need to change your imports.
```

CHANGELOG_BEGIN
CHANGELOG_END
ghost pushed a commit that referenced this pull request Jul 21, 2021
This PR has been created by a script, which is not very smart
and does not have all the context. Please do double-check that
the version prefix is correct before merging.

@Robin-da is in charge of this release.

Commit log:
```
b7cf42d Upgrade doobie to version 0.13.4 (#10326)
1a72314 fix broken triggers link (#10336)
271f9da Added back DeduplicationPeriod.DeduplicationOffset [KVL-998] (#10324)
b701caa Report divulgence warning at commit location. (#10329)
742bdcb Describe prometheus in daml-on-sql README (#10307)
93d0ed6 [Mutable cache] Resolve with full lookup on negative cache read-through lookups [DPP-501] (#10262)
f59951b document min npm version (#10330)
d982e16 fix besu listing (#10328)
c3bc26f daml-lf/data: Move ID aliases to `Ref` from _ledger-api-common_. [KVL-1002] (#10323)
cf2f79d Register divulgence warning as a diagnostic (#10289)
8360e9f Mark Java Bot tests flaky (#10322)
a6bf892 [In-memory fan-out] CLI parameters update (#10250)
5fa49c3 Disables flaky test suite of InstrumentedSource.bufferedSource (#10321)
504c231 Use a combined template id, stakeholder index (#10315)
9a01065 participant-state: Remove the Daml-LF transaction and value aliases. [KVL-1002] (#10317)
159728d LF: use Either by default in all archive reader API (#10295)
449a72a increase ES memory (#10318)
80b65f6 [DOCS] Add documentation for the JSON API metrics (#10312)
6abb903 [JSON-API] Put the request & response bodies into the log ctx if the log level is debug (for specific statements) (#10298)
3c0010b detect mount issue earlier (#10313)
0e09f3b Remove optLocation field from transaction nodes. (#10301)
e62852f Make ledger API test tool's 'max-connection-attempts' into an option (#10311)
bd12170 participant-state: Remove the `ParticipantId`, `PackageId`, and `Party` aliases. [KVL-1002] (#10308)
fed4497 Extend JSON API ContractDao query bench’s with different tpids (#10309)
bd35f80 ledger-configuration: Correct the protobuf package. [KVL-1002] (#10302)
d69328d Ledger API Test Tool: add a `--max-connection-attempts` command line option [KVL-977] (#10297)
a3b861e refresh es cluster (#10300)
63332d0 update NOTICES file (#10306)
1ee53c0 participant-state-index: Use `Ref` directly. (#10299)
0eba812 Remove trace_context field from Ledger API [KVL-1021] (#10256)
88886be ledger-configuration: Add tests for the `Configuration` decoding methods. [KVL-1002] (#10293)
cb29f34 ledger-offset: Move `Offset` to a new package. [KVL-1002] (#10296)
b899ae1 Codeowners: Add @nicu-da to the kvutils code review. (#10292)
f033bc2 LF: Clean legacy from archive proto + TEXT_TO_CODE_POINTS  typo (#10286)
70b12f0 ledger-on-sql: Remove conformance tests for H2 and SQLite files. (#10291)
a9a0b70 ledger-configuration: Extract the configuration from participant-state. [KVL-1002] (#10279)
d96b54e Use Text not String in exception docs (#10287)
5382253 Refresh json API materialized view on statement (#10285)
6e447c5 Patch export filtering of GHC.Types.[] in damldocs (#10282)
d565cae DPP-457 Add UpdateToDbdto tests (#10116)
814442e update NOTICES file (#10284)
0493480 rotate release duty after 1.15.0-snapshot.20210713.7343.0.1f35db17 (#10268)
84094e0 update compat versions for 1.15.0 (#10281)
ba8e829 [In-memory fan-out] Oracle support (#10263)
a8f1902 LF: change type from Try to Either in archive module (#10277)
c84b37a Release SDK 1.15 (#10269)
980d96b Fix status check in collect_build_data (#10278)
191d3b8 Add unit test to SequentialWriteDao [DPP-456] (#10265)
2271f93 Fix crash on duplicate submissionId (#10242)
906184c LF: Simplify UniversalDarReader (#10271)
42c487b [JSON-API] Refactor Endpoints.scala to use path directives etc. (#10274)
6840401 release 1.15.0-snapshot.20210713.7343.0.1f35db17 (#10267)
0df70fa Document bazel-testlogs directory in BAZEL.md (#10276)
44204bb Add a benchmark for contract insertion in the JSON API (#10272)
6107f8a Ignore failure to upload log failures (#10270)
caf85a2 LF: rationalize archive Parser/Reader/Decoder (#10239)
0043b81 Add a ContractDao benchmark (#10259)
21a9e62 Add disclaimer to participant state v2 API [KVL-998] (#10254)
6c63f96 participant-integration-api: Move `SeedService` here. (#10261)
58c0b46 kvutils: Simplify usage of Rejections [KVL-1015] (#10258)
41aba1c kvutils: Move unrelated test cases to a proper test class [KVL-1015] (#10257)
```
Changelog:
```

- [JSON-API] You can now find a section `Metrics` in the http-json api documentation explaining how to enable metrics and which are available

- [JSON-API] Logging of the request and response bodies are now available for appropriate requests if the chosen log level is equal or lower than DEBUG. These can then be found in the logging context of the request begin & end log messages (The field names in the ctx are "request_body" and "response_body").
- [Integration Kit] The *ledger_configuration.proto* Protobuf definition
  has been repackaged under ``com.daml.ledger.configuration``, and the
  Java and C# packages have been renamed accordingly. If you are using
  this Protobuf definition, you will need to update your imports. The
  Maven artifact name has not changed.
- [Integration Kit] Add a `--max-connection-attempts` command line option to the Ledger API Test Tool
* [Integration Kit] Removed trace_context field from Ledger API and its bindings as we now have trace context propagation support via gRPC metadata. If you are constructing or consuming Ledger API requests or responses directly, you may need to update your code.
- [Integration Kit] The ``Offset`` type has been moved to a new Maven
  package, ``ledger-offset``, from the ``participant-state`` package.
  The Java package has been renamed to ``com.daml.ledger.offset``. If
  you are using this type, you will need to update your dependencies and
  imports.
- [Integration Kit] The ledger configuration classes, ``Configuration``,
  ``LedgerInitialConditions``, and ``TimeModel``, have been moved from
  *participant-state* to a separate package named
  *ledger-configuration*, in the Java package
  ``com.daml.ledger.configuration``. You will need to update your
  dependencies and imports.
- [Integration Kit] ``TimeModel`` has been renamed to
  ``LedgerTimeModel``. If you are using the ledger configuration classes
  directly, you may need to update your code.
Fix crash in ConfigManagement- and PackageManagement- services on duplicate submissionsIds from different participants.
Extend ledger-api-test-tool to cover the duplicate submissionId cases.
- [Integration Kit] The class ``SeedService`` has been moved from the
  *participant-state* Maven package to the *participant-integration-api*
  Maven package, under the Java package name
  ``com.daml.platform.apiserver`` to reflect its usage by the API
  server, not the participant state API. If you use this class directly,
  you will need to change your imports.
```

CHANGELOG_BEGIN
CHANGELOG_END

Co-authored-by: Azure Pipelines DAML Build <[email protected]>
@remyhaemmerle-da remyhaemmerle-da linked an issue Jul 28, 2021 that may be closed by this pull request
6 tasks
@remyhaemmerle-da remyhaemmerle-da removed a link to an issue Jul 28, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/daml-engine DAML-LF Engine & Interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants