daml/CONTRIBUTING.md

166 lines
8.3 KiB
Markdown
Raw Normal View History

2019-04-04 11:33:38 +03:00
# Contributing to DAML
Welcome! This page gives a high-level overview of how to contribute to the development of DAML.
2019-04-04 11:33:38 +03:00
There are many ways you can contribute beyond coding. For example, you can report problems, clarify [issues](https://github.com/digital-asset/daml/issues), and write documentation. If you're completely new to open source development, the [Open Source Guides](https://opensource.guide) is a great place to start.
2019-04-04 11:33:38 +03:00
## Working on the codebase
For information on how to build, test, and work on the codebase, see ["Contributing to DAML" in the README](./README.md#contributing-to-daml).
2019-04-04 11:33:38 +03:00
## Code of conduct
This project and everyone participating in it is governed by the [DAML Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [community@digitalasset.com](mailto:community@digitalasset.com).
## Git conventions
For Git commit messages, our principle is that `git log --pretty=oneline` should give readers a clear idea of what has changed and the detailed descriptions should help them understand the rationale. To achieve this:
* Commits must have a concise, imperative title, e.g.:
* *Fix performance regression in …*
* *Improve explanation of …*
* *Remove module X because it is not used.*
* Commits should have a description that concisely explains the rationale and context for the change if that is not obvious.
* Commit descriptions should include a `Fixes #XX` line indicating what GitHub issue number the commit fixes.
2019-04-04 11:33:38 +03:00
* The git logs are not intended for user-facing change logs, but should be a useful reference when writing them.
## Pull request checklist
* Read this document (contribution guidelines).
* Does your PR include appropriate tests?
* Make sure your PR title and description makes it easy for other developers to understand what the contained commits do. The title should say what the changes do. The description should expand on what it does (if not obvious from the title alone), and say why it is being done.
* If your PR corresponds to an issue, add “Fixes #XX” to your pull request description. This will auto-close the corresponding issue when the commit is merged into master and tie the PR to the issue.
* the squashed commit for the PR **MUST** include in its body a section between the ``CHANGELOG_BEGIN`` and ``CHANGELOG_END`` tags. This section **MAY** include a list of _user-facing_ changes [Follow these guidelines on how to write a good changelog entry](#writing-a-good-changelog-entry).
Remove unreleased.rst (#3547) * Start working on getting rid of unreleased.rst Document new process in CONTRIBUTING.md, .github/pull_request_template.md and unreleased.rst (for good measure) Report the previous changelog additions here so that they're not lost in the mist of times. CHANGELOG_BEGIN - [DAML Stdlib] Added the ``NumericScale`` typeclass, which improves the type inference for Numeric literals, and helps catch the creation of out-of-bound Numerics earlier in the compilation process. - [DAML Triggers] ``emitCommands`` now accepts an additional argument that allows you to mark contracts as pending. Those contracts will be automatically filtered from the result of ``getContracts`` until we receive the corresponding completion/transaction. - [Navigator] Fixed a bug where Navigator becomes unresponsive if the ledger does not contain any DAML packages. - [Ledger-API] Add field ``gen_map`` in Protobuf definition for ledger api values. This field is used to support generic maps, an new feature currently in development. See issue https://github.com/digital-asset/daml/pull/3356 for more details about generic maps. The Ledger API will send no messages where this field is set, when using a stable version of DAML-LF. However the addition of this field may cause pattern-matching exhaustive warnings in the code of ledger API clients. Those warnings can be safely ignored until GenMap is made stable in an upcoming version of DAML-LF. - [JSON API - Experimental] CLI configuration to enable serving static content as part of the JSON API daemon: ``--static-content "directory=/full/path,prefix=static"`` This configuration is NOT recommended for production deployment. See issue #2782. - [Extractor] The app can now work against a Ledger API server that requires client authentication. See `issue #3157 <https://github.com/digital-asset/daml/issues/3157>`__. - [DAML Script] This release contains a first version of an experimental DAML script feature that provides a scenario-like API that is run against an actual ledger. - [DAML Compiler] The default DAML-LF version is now 1.7. You can still produce DAML-LF 1.6 by passing ``--target=1.6`` to ``daml build``. - [JSON API - Experimental] The database schema has changed; if using ``--query-store-jdbc-config``, you must rebuild the database by adding ``,createSchema=true``. See `issue #3461 <https://github.com/digital-asset/daml/pull/3461>`_. - [JSON API - Experimental] Terminate process immediately after creating schema. See issue #3386. - [DAML Stdlib] ``fromAnyChoice`` and ``fromAnyContractKey`` now take the template type into account. CHANGELOG_END * Document new release process to gather changelog additions * Change the release script to ignore unreleased.rst * Remove spurious unreleased.rst lines * Transition to use tags * Document new way to get changelog additions with tags * Update release/RELEASE.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Address https://github.com/digital-asset/daml/pull/3547#discussion_r348438786 * Document correction process * Add copyright header to unreleased.sh * Update CONTRIBUTING.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Modify CONTRIBUTING.md after @garyverhaegen-da's proposal * Make unreleased.sh run per commit and treat tags as case-insensitive * Fix documentation for replacements
2019-11-20 18:16:57 +03:00
The following is an example of a well-formed commit, including the description (first line) and a body that includes changelog additions:
Fixes #1311
Remove unreleased.rst (#3547) * Start working on getting rid of unreleased.rst Document new process in CONTRIBUTING.md, .github/pull_request_template.md and unreleased.rst (for good measure) Report the previous changelog additions here so that they're not lost in the mist of times. CHANGELOG_BEGIN - [DAML Stdlib] Added the ``NumericScale`` typeclass, which improves the type inference for Numeric literals, and helps catch the creation of out-of-bound Numerics earlier in the compilation process. - [DAML Triggers] ``emitCommands`` now accepts an additional argument that allows you to mark contracts as pending. Those contracts will be automatically filtered from the result of ``getContracts`` until we receive the corresponding completion/transaction. - [Navigator] Fixed a bug where Navigator becomes unresponsive if the ledger does not contain any DAML packages. - [Ledger-API] Add field ``gen_map`` in Protobuf definition for ledger api values. This field is used to support generic maps, an new feature currently in development. See issue https://github.com/digital-asset/daml/pull/3356 for more details about generic maps. The Ledger API will send no messages where this field is set, when using a stable version of DAML-LF. However the addition of this field may cause pattern-matching exhaustive warnings in the code of ledger API clients. Those warnings can be safely ignored until GenMap is made stable in an upcoming version of DAML-LF. - [JSON API - Experimental] CLI configuration to enable serving static content as part of the JSON API daemon: ``--static-content "directory=/full/path,prefix=static"`` This configuration is NOT recommended for production deployment. See issue #2782. - [Extractor] The app can now work against a Ledger API server that requires client authentication. See `issue #3157 <https://github.com/digital-asset/daml/issues/3157>`__. - [DAML Script] This release contains a first version of an experimental DAML script feature that provides a scenario-like API that is run against an actual ledger. - [DAML Compiler] The default DAML-LF version is now 1.7. You can still produce DAML-LF 1.6 by passing ``--target=1.6`` to ``daml build``. - [JSON API - Experimental] The database schema has changed; if using ``--query-store-jdbc-config``, you must rebuild the database by adding ``,createSchema=true``. See `issue #3461 <https://github.com/digital-asset/daml/pull/3461>`_. - [JSON API - Experimental] Terminate process immediately after creating schema. See issue #3386. - [DAML Stdlib] ``fromAnyChoice`` and ``fromAnyContractKey`` now take the template type into account. CHANGELOG_END * Document new release process to gather changelog additions * Change the release script to ignore unreleased.rst * Remove spurious unreleased.rst lines * Transition to use tags * Document new way to get changelog additions with tags * Update release/RELEASE.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Address https://github.com/digital-asset/daml/pull/3547#discussion_r348438786 * Document correction process * Add copyright header to unreleased.sh * Update CONTRIBUTING.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Modify CONTRIBUTING.md after @garyverhaegen-da's proposal * Make unreleased.sh run per commit and treat tags as case-insensitive * Fix documentation for replacements
2019-11-20 18:16:57 +03:00
Also fixes a typo in the Scala bindings documentation.
Remove unreleased.rst (#3547) * Start working on getting rid of unreleased.rst Document new process in CONTRIBUTING.md, .github/pull_request_template.md and unreleased.rst (for good measure) Report the previous changelog additions here so that they're not lost in the mist of times. CHANGELOG_BEGIN - [DAML Stdlib] Added the ``NumericScale`` typeclass, which improves the type inference for Numeric literals, and helps catch the creation of out-of-bound Numerics earlier in the compilation process. - [DAML Triggers] ``emitCommands`` now accepts an additional argument that allows you to mark contracts as pending. Those contracts will be automatically filtered from the result of ``getContracts`` until we receive the corresponding completion/transaction. - [Navigator] Fixed a bug where Navigator becomes unresponsive if the ledger does not contain any DAML packages. - [Ledger-API] Add field ``gen_map`` in Protobuf definition for ledger api values. This field is used to support generic maps, an new feature currently in development. See issue https://github.com/digital-asset/daml/pull/3356 for more details about generic maps. The Ledger API will send no messages where this field is set, when using a stable version of DAML-LF. However the addition of this field may cause pattern-matching exhaustive warnings in the code of ledger API clients. Those warnings can be safely ignored until GenMap is made stable in an upcoming version of DAML-LF. - [JSON API - Experimental] CLI configuration to enable serving static content as part of the JSON API daemon: ``--static-content "directory=/full/path,prefix=static"`` This configuration is NOT recommended for production deployment. See issue #2782. - [Extractor] The app can now work against a Ledger API server that requires client authentication. See `issue #3157 <https://github.com/digital-asset/daml/issues/3157>`__. - [DAML Script] This release contains a first version of an experimental DAML script feature that provides a scenario-like API that is run against an actual ledger. - [DAML Compiler] The default DAML-LF version is now 1.7. You can still produce DAML-LF 1.6 by passing ``--target=1.6`` to ``daml build``. - [JSON API - Experimental] The database schema has changed; if using ``--query-store-jdbc-config``, you must rebuild the database by adding ``,createSchema=true``. See `issue #3461 <https://github.com/digital-asset/daml/pull/3461>`_. - [JSON API - Experimental] Terminate process immediately after creating schema. See issue #3386. - [DAML Stdlib] ``fromAnyChoice`` and ``fromAnyContractKey`` now take the template type into account. CHANGELOG_END * Document new release process to gather changelog additions * Change the release script to ignore unreleased.rst * Remove spurious unreleased.rst lines * Transition to use tags * Document new way to get changelog additions with tags * Update release/RELEASE.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Address https://github.com/digital-asset/daml/pull/3547#discussion_r348438786 * Document correction process * Add copyright header to unreleased.sh * Update CONTRIBUTING.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Modify CONTRIBUTING.md after @garyverhaegen-da's proposal * Make unreleased.sh run per commit and treat tags as case-insensitive * Fix documentation for replacements
2019-11-20 18:16:57 +03:00
CHANGELOG_BEGIN
Move unreleased user-facing features to its own file (#1762) * Move unreleased user-facing features to its own file docs/source/support/release-notes.rst unfortunately represents a "global lock" when it comes to submitting contributions: if another contribution changed it while another was going through the CI/review process, the latter would have to go again through the CI build after resolving the conflict and merging the resulting commit. The contributors originally tried to address this problem by letting the system automatically performing this operation, but this failed because release notes were moved to the wrong section by mistake. This simple change would allow the contributors to let the system take care of merging on its own, because existing release notes will no longer be corrupted by the process. There is a caveat: the automatic merging could result in invalid RST (mostly because of missing newlines). This would push the task of ensuring the release notes are valid RST to the release. I would argue this can be done quite easily and that this is checked automatically when rendering RST to HTML, so it could be a nuisance during release but it would make the day-to-day contributions easier. * Address https://github.com/digital-asset/daml/pull/1762#issuecomment-503540993 * Address https://github.com/digital-asset/daml/pull/1762#pullrequestreview-251676158 * Address https://github.com/digital-asset/daml/pull/1762#discussion_r295279530 * Remove HEAD section from release-notes.rst * Address https://github.com/digital-asset/daml/pull/1762#pullrequestreview-251678791 * Address https://github.com/digital-asset/daml/pull/1762#issuecomment-503549896
2019-06-19 17:32:03 +03:00
- [Sandbox] Introduced a new API for package management.
See `#1311 <https://github.com/digital-asset/daml/issues/1311>`__.
2019-04-04 11:33:38 +03:00
Remove unreleased.rst (#3547) * Start working on getting rid of unreleased.rst Document new process in CONTRIBUTING.md, .github/pull_request_template.md and unreleased.rst (for good measure) Report the previous changelog additions here so that they're not lost in the mist of times. CHANGELOG_BEGIN - [DAML Stdlib] Added the ``NumericScale`` typeclass, which improves the type inference for Numeric literals, and helps catch the creation of out-of-bound Numerics earlier in the compilation process. - [DAML Triggers] ``emitCommands`` now accepts an additional argument that allows you to mark contracts as pending. Those contracts will be automatically filtered from the result of ``getContracts`` until we receive the corresponding completion/transaction. - [Navigator] Fixed a bug where Navigator becomes unresponsive if the ledger does not contain any DAML packages. - [Ledger-API] Add field ``gen_map`` in Protobuf definition for ledger api values. This field is used to support generic maps, an new feature currently in development. See issue https://github.com/digital-asset/daml/pull/3356 for more details about generic maps. The Ledger API will send no messages where this field is set, when using a stable version of DAML-LF. However the addition of this field may cause pattern-matching exhaustive warnings in the code of ledger API clients. Those warnings can be safely ignored until GenMap is made stable in an upcoming version of DAML-LF. - [JSON API - Experimental] CLI configuration to enable serving static content as part of the JSON API daemon: ``--static-content "directory=/full/path,prefix=static"`` This configuration is NOT recommended for production deployment. See issue #2782. - [Extractor] The app can now work against a Ledger API server that requires client authentication. See `issue #3157 <https://github.com/digital-asset/daml/issues/3157>`__. - [DAML Script] This release contains a first version of an experimental DAML script feature that provides a scenario-like API that is run against an actual ledger. - [DAML Compiler] The default DAML-LF version is now 1.7. You can still produce DAML-LF 1.6 by passing ``--target=1.6`` to ``daml build``. - [JSON API - Experimental] The database schema has changed; if using ``--query-store-jdbc-config``, you must rebuild the database by adding ``,createSchema=true``. See `issue #3461 <https://github.com/digital-asset/daml/pull/3461>`_. - [JSON API - Experimental] Terminate process immediately after creating schema. See issue #3386. - [DAML Stdlib] ``fromAnyChoice`` and ``fromAnyContractKey`` now take the template type into account. CHANGELOG_END * Document new release process to gather changelog additions * Change the release script to ignore unreleased.rst * Remove spurious unreleased.rst lines * Transition to use tags * Document new way to get changelog additions with tags * Update release/RELEASE.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Address https://github.com/digital-asset/daml/pull/3547#discussion_r348438786 * Document correction process * Add copyright header to unreleased.sh * Update CONTRIBUTING.md Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com> * Modify CONTRIBUTING.md after @garyverhaegen-da's proposal * Make unreleased.sh run per commit and treat tags as case-insensitive * Fix documentation for replacements
2019-11-20 18:16:57 +03:00
CHANGELOG_END
If you want to amend an existing changelog entry part of a PR already merged on master, do so by adding a ``WARNING`` to your changelog additions:
CHANGELOG_BEGIN
WARNING: replace existing changelog entry "Introduced a new API for package management" with the following.
- [Sandbox] Introduce a new API for party management.
See `#1311 <https://github.com/digital-asset/daml/issues/1311>`__.
CHANGELOG_END
If the PR contains no _user-facing_ change, the section **MUST** be there but can be left empty, as in the following example:
Fixes #6666
Improve contribution guidelines
CHANGELOG_BEGIN
CHANGELOG_END
If you want to verify the changelog entries as described by a range of Git revisions, you can use the `unreleased.sh` script. In most cases, to see the entries added as part of commits added since branching off of `master`, you can run:
./unreleased.sh master..
## Writing a good changelog entry
Writing good changelog entries is **important**: as a developer, it gives visibility on your contribution; as a user, it makes clear what is new, what's changed, and how to deal with them, making the product more accessible and your work more meaningful.
The raw changelog is used to compile a meaningful summary of changes across releases. This happens some time after the PR has been merged and the person taking the responsibility of summarizing new user-facing features must be in the position to easily understand the nature of the change and report it. The ideal changelog entry can be more or less incorporated verbatim in the release notes.
Here are a few practical tips:
* if there are no user-facing changes, keep the changelog entry list empty
* the first term to appear should be the affected component -- [here's a list](#list-of-components-for-changelog-entries)
* write as many changelog entries as necessary
* don't be _too_ succinct: a single entry does **not have to** fit on a single line
* on the other end, if the size grows beyond 5-6 lines, rather add a link to a relevant documentation or issue with more details
* the ultimate target are end users: focus on the impact on them, tell them what's new or how to deal with a change
### List of components for changelog entries
This list should cover the vast majority of needs. If unsure, ask on the relevant GitHub issue or PR.
* DAML Compiler
* DAML on SQL
* DAML Studio
* Distribution/Releases
* Extractor
* Java Bindings
* Java Codegen
* JavaScript Client Libraries
* JavaScript Codegen
* JSON API
* Ledger API Specification
* Integration Kit †
* Navigator
* DAML REPL
* Sandbox
* Scala Bindings
* Scala Codegen
* DAML Script
* DAML Assistant
* DAML Standard Library
* DAML Triggers
† Covers the Ledger API Test Tool and changes to libraries that affect ledger integrations (e.g. `kvutils`)
2019-04-04 11:33:38 +03:00
## Working with issues
We use issues and [pull requests](https://help.github.com/articles/about-pull-requests/) to collaborate and track our work. Anyone is welcome to open an issue. If you just want to ask a question, please ask away on [the DAML forum](https://discuss.daml.com).
2019-04-04 11:33:38 +03:00
We encourage everyone to vote on issues that they support or not:
* 👍 - upvote
* 👎 - downvote
When you start working on an issue, we encourage you to tell others about it in an issue comment. If other contributors know that this issue is already being worked on, they might decide to tackle another issue instead.
When you add `TODO` (nice to have) and `FIXME` (should fix) comments in the code, we encourage you to create a corresponding issue and reference it as follows:
* `TODO(#XX): <description>` where `#XX` corresponds to the GitHub issue.
* `FIXME(#XX): <description>` where `#XX` corresponds to the GitHub issue.
### Labels
We use labels to indicate what component the issue relates to (`component/...`). We use some special labels:
- `broken` to indicate that something in the repo is seriously broken and needs to be fixed.
- `discussion` to indicate the issue is to discuss and decide on something.
- `good-first-issue` to indicate that the issue is suitable for those who want to contribute but don't know where to start.
By default, issues represent "work to be done" -- that might be features, improvements, non-critical bug fixes, and so on.
The DAML Language team uses labels to indicate priority (the DAML Runtime team does not):
- `language/now`
- `language/soon`
- `language/later`
You can see all labels [here](https://github.com/digital-asset/daml/labels).
2019-04-04 11:33:38 +03:00
### Milestones
In addition to labels, we group issues into *milestones*. The DAML Language team has all issues in a single *Language* milestone; the DAML Runtime team uses them to group work efforts (*Add PostgreSQL backend to the Ledger* for example). *Maintenance* and *Backlog* are special milestones.
Issues without a milestone are treated as in need of triaging.
You can see all the active milestones [here](https://github.com/digital-asset/daml/milestones).
2019-04-04 11:33:38 +03:00
## Discussions
Please hold discussions that are relevant to DAML development and not confidential in GitHub issues. That way, anyone who wants to contribute or follow along can do so. If you have private discussions, please summarise them in an issue or comment to an issue.
You can also join a `#daml-contributors` channel on our Slack: [damldriven.slack.com](https://damldriven.slack.com/sso/saml/start).
# Thank you!
Thank you for taking the time to contribute!