2019-04-04 12:55:22 +03:00
# Making a Release
2020-12-27 16:19:07 +03:00
Valid commits for a release should come from either the `main` branch or one
trigger all releases from master (#6016)
trigger all releases from master
The 1.1.0 release went wrong and we had to trash it and release 1.1.1
instead. This is an attempt at identifying and correcting the root
cause behind that incident.
To understand the situation, we need to know how releases worked before
1.0. We had a one-line file called `LATEST` that specifies the git SHA and
version tag for the latest release. A change to that file triggered a
release with the specified release tag, built from the source tree of
the specified commit. The `LATEST` file looked something like:
```
f050da78c9c8727b889bdac286156f19e2f938c4 1.0.0-snapshot.20200411.3905.0.f050da78
```
To mark a release as stable, we would change it to look like this:
```
f050da78c9c8727b889bdac286156f19e2f938c4 1.0.0
```
i.e. simply drop the `-snapshot...` suffix. Even though the commit (and
thus the entire source tree we build from) is the same, we would need to
rebuild almost all of our release artifacts, as they embed the version
tag in various places and ways. That worked well as long as we could
assume we were doing trunk-based development, i.e. all releases would
always come from the same (`master`) branch.
When we released 1.0, and started work on 1.1, we had a few bug reports
for 1.0 that we decided should be resolved in a point release. We
decided that the best way to handle that would be to have a branch
starting on the release commit for 1.0, and then backport patches from
`master` to that branch. We adapted our build process to also watch the
`release/1.0.x` branch and, in particular, trigger a new release build if
the `LATEST` file in that branch changed. That worked well.
The plan going forward was to keep doing regular snapshot releases from
the `master` branch, and create support, point releases ("patch" releases
in semver) from dedicated branches.
On April 30, we made a snapshot release as an RC for 1.1.0, by changing
the `LATEST` file in the `master` branch. That release was built on commit
681c862d. On May 6, we decided to take a new snapshot as the RC for
1.1.0; we changed `LATEST` in `master` to designate 7e448d81 as the new
latest release.
On May 11, we noticed an issue that broke our builds. Without going into
details, an external artifact we depend on had changed in incompatible
ways. After fixing that on `master`, we reasoned that this would also
break the build of the final 1.1.0 release if we just tried to build
7e448d81 again. But as the target release date was May 13, we did not
want to take a new snapshot after that fix, as that would have included
one more week of work in the release, and given us no time to test it.
So we did what we did for the 1.0 branch, as it had worked well: we
created a branch that forked from `master` at commit 7e448d81 and called
it `release/1.1.x`, then cherry-picked the one fix to our build process to
work around the broken download. When the time came to make the final
1.1.0 build on May 13, we naturally picked the `LATEST` file from the
`release/1.1.x` branch and dropped the `-snapshot...` suffix. Importantly,
we did not need to update the target commit to include the "broken
download" fix as, in the meantime, the internet had fixed itself, and we
thus reasoned we should go for the exact code of the RC rather than
include an unnecessary, albeit seemingly harmless, change.
Everything went well with the release process. Tests went well too. Then
we got a report that an application that worked against the latest RC
broke with the final 1.1.0. The issue was that we had built the wrong
commit: by branching off at the point of the _target_ commit for the
latest snapshot, we did not have the change to the `LATEST` file that
designated that commit as the target. So the `LATEST` file in
`release/1.1.x` was still pointing to 681c862d.
I believe the root cause for this issue is the fact that we have
scattered our release process over multiple branches, meaning there is
no linear history of what was released and we are relying on people
being able to mentally manage multiple timelines. Therefore, I propose
to fix our release process so this should not happen again by
linearizing the release process, i.e. getting back to a situation where
all releases are made from a single branch, `master`.
Because we do want to be able to release _for_ multiple release branches
(to provide backports and bugfixes), we still need some way to
accommodate that. Having a single `LATEST` file in the same format as
before would not really work well: keeping track of interleaved release
streams on a single file would not really be easier than keeping track
of multiple branches.
My proposed solution is to instead have a multiline LATEST file, so that
all the release branch "tips" can be observed at the same time, and, as
long as we take care to only advance one release branch at a time, we
can easily keep track of each of them. This is what this PR does.
This required a few changes to our release process. Most notably:
- Obviously, as this is the main point of this PR, the build process has
once again been restricted to only trigger new releases from the
`master` branch.
- As our CI machinery cannot easily be made to produce multiple releases
from a single build, the `check_for_release` step will only recognize
a commit as a release trigger if it changes a single line in the
`LATEST` file. This restriction comes in addition to the existing one
that a release commit is only allowed to change either just the
`LATEST` file or both the `LATEST` and
`docs/source/support/release-notes.rst` files.
- The docs publication process has been changed to update _all_
published versions to display the _latest_ release notes page. This
means that the release notes page will always show you all published
versions, regardless of which version of the documentation you're
looking at. This also means that interleaving release notes correctly on
that page is a manual exercise.
- As per the intention of the new process, the `LATEST` file has been
updated to contained all existing post-1.0 stable releases. It should
also include all existing snapshot releases should we have more than one
at a time (say, should we discover an issue with 1.1.1 that required us
to work on a 1.1.2).
- The `release.sh` script has been dramatically simplified as I felt it
was trying to do too much and porting its existing functionality to a
multi-line `LATEST` file would be too hard.
CHANGELOG_BEGIN
CHANGELOG_END
2020-05-19 20:18:10 +03:00
of the support `release/a.b.x` branches (e.g. `release/1.0.x` branch is for
patches we backport to the 1.0 release branch).
introduce new release process (#4513)
Context
=======
After multiple discussions about our current release schedule and
process, we've come to the conclusion that we need to be able to make a
distinction between technical snapshots and marketing releases. In other
words, we need to be able to create a bundle for early adopters to test
without making it an officially-supported version, and without
necessarily implying everyone should go through the trouble of
upgrading. The underlying goal is to have less frequent but more stable
"official" releases.
This PR is a proposal for a new release process designed under the
following constraints:
- Reuse as much as possible of the existing infrastructure, to minimize
effort but also chances of disruptions.
- Have the ability to create "snapshot"/"nightly"/... releases that are
not meant for general public consumption, but can still be used by savvy
users without jumping through too many extra hoops (ideally just
swapping in a slightly-weirder version string).
- Have the ability to promote an existing snapshot release to "official"
release status, with as few changes as possible in-between, so we can be
confident that the official release is what we tested as a prerelease.
- Have as much of the release pipeline shared between the two types of
releases, to avoid discovering non-transient problems while trying to
promote a snapshot to an official release.
- Triggerring a release should still be done through a PR, so we can
keep the same approval process for SOC2 auditability.
The gist of this proposal is to replace the current `VERSION` file with
a `LATEST` file, which would have the following format:
```
ef5d32b7438e481de0235c5538aedab419682388 0.13.53-alpha.20200214.3025.ef5d32b7
```
This file would be maintained with a script to reduce manual labor in
producing the version string. Other than that, the process will be
largely the same, with releases triggered by changes to this `LATEST`
and the release notes files.
Version numbers
===============
Because one of the goals is to reduce the velocity of our published
version numbers, we need a different version scheme for our snapshot
releases. Fortunately, most version schemes have some support for that;
unfortunately, the SDK sits at the intersection of three different
version schemes that have made incompatible choices. Without going into
too much detail:
- Semantic versioning (which we chose as the version format for the SDK
version number) allows for "prerelease" version numbers as well as
"metadata"; an example of a complete version string would be
`1.2.3-nightly.201+server12.43`. The "main" part of the version string
always has to have 3 numbers separated by dots; the "prerelease"
(after the `-` but before the `+`) and the "metadata" (after the `+`)
parts are optional and, if present, must consist of one or more segments
separated by dots, where a segment can be either a number or an
alphanumeric string. In terms of ordering, metadata is irrelevant and
any version with a prerelease string is before the corresponding "main"
version string alone. Amongst prereleases, segments are compared in
order with purely numeric ones compared as numbers and mixed ones
compared lexicographically. So 1.2.3 is more recent than 1.2.3-1,
which is itself less recent than 1.2.3-2.
- Maven version strings are any number of segments separated by a `.`, a
`-`, or a transition between a number and a letter. Version strings
are compared element-wise, with numeric segments being compared as
numbers. Alphabetic segments are treated specially if they happen to be
one of a handful of magic words (such as "alpha", "beta" or "snapshot"
for example) which count as "qualifiers"; a version string with a
qualifier is "before" its prefix (`1.2.3` is before `1.2.3-alpha.3`,
which is the same as `1.2.3-alpha3` or `1.2.3-alpha-3`), and there is a
special ordering amongst qualifiers. Other alphabetic segments are
compared alphabetically and count as being "after" their prefix
(`1.2.3-really-final-this-time` counts as being released after `1.2.3`).
- GHC package numbers are comprised of any number of numeric segments
separated by `.`, plus an optional (though deprecated) alphanumeric
"version tag" separated by a `-`. I could not find any official
documentation on ordering for the version tag; numeric segments are
compared as numbers.
- npm uses semantic versioning so that is covered already.
After much more investigation than I'd care to admit, I have come up
with the following compromise as the least-bad solution. First,
obviously, the version string for stable/marketing versions is going to
be "standard" semver, i.e. major.minor.patch, all numbers, which works,
and sorts as expected, for all three schemes. For snapshot releases, we
shall use the following (semver) format:
```
0.13.53-alpha.20200214.3025.ef5d32b7
```
where the components are, respectively:
- `0.13.53`: the expected version string of the next "stable" release.
- `alpha`: a marker that hopefully scares people enough.
- `20200214`: the date of the release commit, which _MUST_ be on
master.
- `3025`: the number of commits in master up to the release commit
(included). Because we have a linear, append-only master branch, this
uniquely identifies the commit.
- `ef5d32b7ù : the first 8 characters of the release commit sha. This is
not strictly speaking necessary, but makes it a lot more convenient to
identify the commit.
The main downsides of this format are:
1. It is not a valid format for GHC packages. We do not publish GHC
packages from the SDK (so far we have instead opted to release our
Haskell code as separate packages entirely), so this should not be an
issue. However, our SDK version currently leaks to `ghc-pkg` as the
version string for the stdlib (and prim) packages. This PR addresses
that by tweaking the compiler to remove the offending bits, so `ghc-pkg`
would see the above version number as `0.13.53.20200214.3025`, which
should be enough to uniquely identify it. Note that, as far as I could
find out, this number would never be exposed to users.
2. It is rather long, which I think is good from a human perspective as
it makes it more scary. However, I have been told that this may be
long enough to cause issues on Windows by pushing us past the max path
size limitation of that "OS". I suggest we try it and see what
happens.
The upsides are:
- It clearly indicates it is an unstable release (`alpha`).
- It clearly indicates how old it is, by including the date.
- To humans, it is immediately obvious which version is "later" even if
they have the same date, allowing us to release same-day patches if
needed. (Note: that is, commits that were made on the same day; the
release date itself is irrelevant here.)
- It contains the git sha so the commit built for that release is
immediately obvious.
- It sorts correctly under all schemes (modulo the modification for
GHC).
Alternatives I considered:
- Pander to GHC: 0.13.53-alpha-20200214-3025-ef5d32b7. This format would
be accepted by all schemes, but will not sort as expected under semantic
versioning (though Maven will be fine). I have no idea how it will sort
under GHC.
- Not having any non-numeric component, e.g. `0.13.53.20200214.3025`.
This is not valid semantic versioning and is therefore rejected by
npm.
- Not having detailed info: just go with `0.13.53-snapshot`. This is
what is generally done in the Java world, but we then lose track of what
version is actually in use and I'm concerned about bug reports. This
would also not let us publish to the main Maven repo (at least not more
than once), as artifacts there are supposed to be immutable.
- No having a qualifier: `0.13.53-3025` would be acceptable to all three
version formats. However, it would not clearly indicate to humans that
it is not meant as a stable version, and would sort differently under
semantic versioning (which counts it as a prerelease, i.e. before
`0.13.53`) than under maven (which counts it as a patch, so after
`0.13.53`).
- Just counting releases: `0.13.53-alpha.1`, where we just count the
number of prereleases in-between `0.13.52` and the next. This is
currently the fallback plan if Windows path length causes issues. It
would be less convenient to map releases to commits, but it could still
be done via querying the history of the `LATEST` file.
Release notes
=============
> Note: We have decided not to have release notes for snapshot releases.
Release notes are a bit tricky. Because we want the ability to make
snapshot releases, then later on promote them to stable releases, it
follows that we want to build commits from the past. However, if we
decide post-hoc that a commit is actually a good candidate for a
release, there is no way that commit can have the appropriate release
notes: it cannot know what version number it's getting, and, moreover,
we now track changes in commit messages. And I do not think anyone wants
to go back to the release notes file being a merge bottleneck.
But release notes need to be published to the releases blog upon
releasing a stable version, and the docs website needs to be updated and
include them.
The only sensible solution here is to pick up the release notes as of
the commit that triggers the release. As the docs cron runs
asynchronously, this means walking down the git history to find the
relevant commit.
> Note: We could probably do away with the asynchronicity at this point.
> It was originally included to cover for the possibility of a release
> failing. If we are releasing commits from the past after they have been
> tested, this should not be an issue anymore. If the docs generation were
> part of the synchronous release step, it would have direct access to the
> correct release notes without having to walk down the git history.
>
> However, I think it is more prudent to keep this change as a future step,
> after we're confident the new release scheme does indeed produce much more
> reliable "stable" releases.
New release process
===================
Just like releases are currently controlled mostly by detecting
changes to the `VERSION` file, the new process will be controlled by
detecting changes to the `LATEST` file. The format of that file will
include both the version string and the corresponding SHA.
Upon detecting a change to the `LATEST` file, CI will run the entire
release process, just like it does now with the VERSION file. The main
differences are:
1. Before running the release step, CI will checkout the commit
specified in the LATEST file. This requires separating the release
step from the build step, which in my opinion is cleaner anyway.
2. The `//:VERSION` Bazel target is replaced by a repository rule
that gets the version to build from an environment variable, with a
default of `0.0.0` to remain consistent with the current `daml-head`
behaviour.
Some of the manual steps will need to be skipped for a snapshot release.
See amended `release/RELEASE.md` in this commit for details.
The main caveat of this approach is that the official release will be a
different binary from the corresponding snapshot. It will have been
built from the same source, but with a different version string. This is
somewhat mitigated by Bazel caching, meaning any build step that does
not depend on the version string should use the cache and produce
identical results. I do not think this can be avoided when our artifact
includes its own version number.
I must note, though, that while going through the changes required after
removing the `VERSION` file, I have been quite surprised at the sheer number of
things that actually depend on the SDK version number. I believe we should
look into reducing that over time.
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-25 19:01:23 +03:00
2021-02-25 20:49:07 +03:00
> **IMPORTANT**: If the release fails, please delete it from the [releases page]
2020-08-13 16:36:32 +03:00
> and write how it failed on the PR.
2020-05-04 16:35:58 +03:00
2022-03-25 20:02:51 +03:00
First, you need to know which type of release you are making. At this point in
time, these are the options, in rough order of likelihood/frequency:
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
1. The weekly snapshot.
2. A release candidate for a 2.x release.
3. A stable 2.x release.
4. A release candidate for a 1.x release.
5. A stable 1.x release.
2022-03-15 13:27:36 +03:00
2022-09-08 16:49:53 +03:00
If you don't know which of these fit your current case, or you think it
2022-03-25 20:02:51 +03:00
doesn't fit in any, please reach out on `#team-daml` on Slack, preferably
mentioning `@gary` .
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
## The weekly snapshot
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
> Note: You should not have to make any change to this repo.
2022-03-15 13:27:36 +03:00
2022-08-11 12:13:11 +03:00
1. On Wednesday morning, a cron should create a release PR on the [assembly]
repo, mentioning you. Please reach out to `@gary` on Slack if that's
missing.
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
2. Merge the PR and wait for the corresponding `main` build to finish.
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
3. Go to the [Testing ](#testing ) section of this file.
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
## 2.x release candidate
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
In a perfect world, there is no need for a separate RC: the latest weekly
2022-09-08 16:49:53 +03:00
snapshot can work. In the world we live in though, we frequently want to add a
few things, or patch previous minor releases.
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
In those cases, we create `release/` branches (e.g. `release/2.0.x` ). Those are
special branches, protected by GitHub rules and treated specially by CI.
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
When making a release candidate, you generally want to pick the tip of one of
those release branches. The release itself is always triggered from `main` .
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
The process is similar to the weekly snapshot, except that both the [daml] and
[canton] bundles have to be manually triggered. Specifically:
2022-03-15 13:27:36 +03:00
2022-03-25 20:02:51 +03:00
1. Make sure all the changes you want are in the release branch.
2. Start _from latest `main`_ and run
```
$ ./release.sh snapshot origin/release/2.0.x 2.0.1
```
The output will be a line that starts with a commit sha, followed by a
2022-04-21 13:43:34 +03:00
snapshot release number. You need to take that line and add it to the [ `LATEST` ]
2022-03-25 20:02:51 +03:00
file, adding ` SPLIT_RELEASE` at the end of that line. You should put that line
2022-09-08 16:49:53 +03:00
in the file in order to preserve semver ordering, and overwrite any existing
2022-03-25 20:02:51 +03:00
snapshot with the same prefix.
3. Make a PR against the `main` branch with just that one line added, touching
no other file. Add the `Standard-Change` label to that PR.
4. When the PR is merged, the build of the corresponding commit on `main` will
create a "split release" bundle and push it to Artifactory. It should notify
on `#ci-failures-daml` on Slack.
5. The next step is to request a build from the [Canton] team (on
`#team-canton` ) that relies on the RC snapshot. Once you have a [canton]
release, you can proceed.
6. Go to the [assembly] repo, and follow the instructions there to make a release
using the [Canton] version that was just created. The `LATEST` file on the
[assembly] repo only contains one version; it is safe to overwrite it, and to
"go backwards" if needed.
7. Once the `main` build of the [assembly] repo has finished, you should
proceed with testing. You should open up this document _in the branch of
the release you're making_, as testing instructions change over time.
2022-06-22 14:24:23 +03:00
8. If this was a main-branch release, bump the `NIGHTLY_PREFIX` file in the
daml repo.
9. After testing, if everything went well, you should go on to turning the RC
2022-03-25 20:02:51 +03:00
into a stable release. If something went wrong, make appropriate changes to
the release branch and start over.
## Stable 2.x
2022-05-18 15:50:36 +03:00
The overall process of coordinating a stable release is documented in the
[release planning] document, including the relevant stakeholders and roles.
Cutting and testing a release as documented here is part of that process.
2022-03-25 20:02:51 +03:00
Making a stable release follows the same steps as a snapshot RC, except that:
- You should not be choosing an arbitrary commit, you should pick the latest RC
for the branch.
- Instead of adding a line to [`LATEST`], remove the `-snapshot` part of the
version number for the existing RC.
- Similarly, modifying the `LATEST` file on the assembly repo _should_ amount
to just removing the `-` parts of the version numbers for both Canton and
daml, but follow the instructions there.
- You need a team lead to approve the PR on both the [daml] and [assembly] repos.
2022-05-18 15:50:36 +03:00
Once you have finished testing the release, communicate this to the relevant
stakeholder (send a message on `#team-daml` if unsure) so that the process can
move on by removing the `prerelease` marker on the [releases page]. (This is what
makes it available to `daml install` .)
2022-03-25 20:02:51 +03:00
## 1.x release candidate
1. Make sure all the changes you want are in the release branch.
2. Start _from latest `main`_ and run
2022-03-15 13:27:36 +03:00
```
$ ./release.sh snapshot origin/release/1.18.x 1.18.3
```
2022-03-25 20:02:51 +03:00
The output will be a line that starts with a commit sha, followed by a
snapshot release number. You need to take that line and add it to the [`LATEST`]
2022-09-08 16:49:53 +03:00
file. You should put that line in the file in order to preserve semver
2022-03-25 20:02:51 +03:00
ordering, and overwrite any existing snapshot with the same prefix.
3. Make a PR against the `main` branch with just that one line added, touching
no other file. Add the `Standard-Change` label to that PR.
4. Once the PR has built, check that it was considered a release build by our
2022-03-15 13:27:36 +03:00
CI. You can look at the output of the `check_for_release` job.
2022-03-25 20:02:51 +03:00
5. When the PR is merged, the build of the `main` branch will create the
release, push it to GitHub releases, and announce it is ready for testing on
`#team-daml` .
6. Follow the testing instructions in this document, but from the tip of the
release branch.
7. After testing, if everything went well, you should go on to turning the RC
into a stable release. If something went wrong, make appropriate changes to
the release branch and start over.
## Stable 1.x
Making a stable release follows the same steps as a snapshot RC, except that:
- You should not be choosing an arbitrary commit, you should pick the latest RC
for the branch.
- Go through the [checklist] before making the release. Note that
the checklist is not available publicly. Since 1.x are old patch releases at
2022-09-08 16:49:53 +03:00
this point, you may have to adapt the checklist a bit. Use your best
2022-03-25 20:02:51 +03:00
judgement; if we're making a patch release on 1.x at this point there should be
a specific reason for it, which should suggest specific additional tests (e.g.
2022-09-08 16:49:53 +03:00
a specific bug we want to fix).
2022-03-25 20:02:51 +03:00
- Instead of adding a line to [`LATEST`], remove the `-snapshot` part of the
version number for the existing RC.
- You need a team lead to approve the PR.
Once you have finished testing the release, coordinate with Product to decide
how to communicate around it and when to remove the `prerelease` marker on the
[releases page]. (This is what makes it available to `daml install` .)
2022-03-15 13:27:36 +03:00
## Testing
2022-09-15 12:16:35 +03:00
This testing procedure starts once the release is listed on the [releases page].
2022-08-31 18:37:28 +03:00
In the following notes, we assume that `$VERSION` contains
2022-09-15 12:16:35 +03:00
the full version tag for the release you are testing - in other words, the full version as recorded on the Slack
2022-08-31 18:37:28 +03:00
`#team-daml` message that is generated when closing the `main` build PR.
For example, for the Slack message:
> team_daml_notifs
>
> Just published `2.4.0-snapshot.20220830.10494.0.4622de48`.
>
> For testing:
>
> - Follow the [instructions](https://github.com/digital-asset/daml/blob/v2.4.0-snapshot.20220830.10494.0.4622de48/release/RELEASE.md).
> - Install on macOS/Linux with `curl -sSL https://get.daml.com/ | sh -s 2.4.0-snapshot.20220830.10494.0.4622de48`.
> - Install on Windows using this [link](https://github.com/digital-asset/daml/releases/download/v2.4.0-snapshot.20220830.10494.0.4622de48/daml-sdk-2.4.0-snapshot.20220830.10494.0.4622de48-windows.exe).
we set `$VERSION` to be `2.4.0-snapshot.20220830.10494.0.4622de48` .
1.
2022-09-15 12:16:35 +03:00
- On Windows, install the new SDK using the installer on the [releases page]. This will typically be the asset
named `daml-sdk-$VERSION-windows.exe` (located on the [DAML releases ](https://github.com/digital-asset/daml/releases ) page).
2022-08-31 18:37:28 +03:00
Please ensure that `$VERSION` is expanded correctly!.
- On MacOS/Linux (please ensure that `$VERSION` is expanded correctly!):
2020-04-20 17:29:22 +03:00
```
2020-05-28 01:24:00 +03:00
curl -sSL https://get.daml.com/ | sh -s "$VERSION"
2020-04-20 17:29:22 +03:00
```
2022-09-15 12:16:35 +03:00
2020-08-20 18:26:21 +03:00
> ## Tips for Windows testing in an ad-hoc machine
>
> If you are part of the release rotation, you can create Windows VMs
> through the [ad-hoc] project. The created machine is a bit raw, though, so
> here are a few tips to help you along.
2022-09-15 12:16:35 +03:00
>
2022-08-31 18:37:28 +03:00
> First we should clone the git repository https://github.com/DACH-NY/daml-language-ad-hoc and then enter the cloned
> repo.
2022-09-15 12:16:35 +03:00
>
> If this is your first time doing this, edit `tf/main.tf` and add your username to the `members` field of the
> `google_project_iam_binding.machine_managers` resource. Generate and submit a PR with these changes. Once the PR
2022-08-31 18:37:28 +03:00
> has been accepted, you should now have permission to create GCP compute instances.
2022-09-15 12:16:35 +03:00
>
> Assuming `direnv` is installed, entering the `daml-language-ad-hoc` project directory will be sufficient to
2022-09-08 16:49:53 +03:00
> configure and install the extra software (e.g. the GCP SDK) required for your environment. Note that this could
> take a few minutes.
2020-08-20 18:26:21 +03:00
>
2022-09-15 12:16:35 +03:00
> A new GCP windows instance can be created by running `./ad-hoc.sh temp windows` inside the `daml-language-ad-hoc`
2022-09-08 16:49:53 +03:00
> project. This command prints IP address, username and password for the created Windows VM. Save this output.
> You will need this information later when you create an RDP connection.
2022-02-08 21:12:11 +03:00
>
2022-02-03 19:37:50 +03:00
> ‼️ After starting, it's going to take some time for the machine to be configured (see notes below).
2022-02-08 21:12:11 +03:00
>
2022-09-15 12:16:35 +03:00
> Before you may connect to this windows instance, you need to ensure that the VPN is connected. On Mac OSX you can
2022-08-31 18:37:28 +03:00
> do this by selecting the preconfigured _Connect GCP Frankfurt full tunnel_ VPN profile.
2022-09-15 12:16:35 +03:00
>
2022-09-08 16:49:53 +03:00
> If you're on a Mac, you can use Microsoft Remote Desktop to connect. This can be installed via the Mac App Store
> or directly [here](https://go.microsoft.com/fwlink/?linkid=868963).
2022-09-15 12:16:35 +03:00
>
2022-09-08 16:49:53 +03:00
> If you're on Linux, you can use [Remmina].
2020-08-20 18:26:21 +03:00
>
2020-08-28 16:14:38 +03:00
> Remmina notes: when creating an RDP connection, you may want to specify custom
2020-09-16 19:07:44 +03:00
> resolution. The default setting is to `use client resolution`. You may notice a
> failure due to color depth settings. You can adjust those in the settings panel
> right below the resolution settings.
>
> The ad-hoc machines take a bit of time to be available after being reported as
> created, so be patient for a bit if your first connection attempt(s) fail.
2020-08-28 16:14:38 +03:00
>
2022-09-15 12:16:35 +03:00
> Once the Windows machine is up and running, use Firefox (in Windows) to download and install
2022-09-08 16:49:53 +03:00
> `daml-sdk-$VERSION-windows.exe` from https://github.com/digital-asset/daml/releases
2022-08-31 18:37:28 +03:00
> (please ensure `$VERSION` is expanded correctly!.
2022-09-15 12:16:35 +03:00
>
> NOTE 1: **Use Firefox for testing.** Windows machines come with both Internet Explorer and Firefox installed. Do
2022-08-31 18:37:28 +03:00
> not make the mistake of trying to use Internet Explorer.
2020-08-20 18:26:21 +03:00
>
2020-11-18 19:37:19 +03:00
> Ad-hoc machines also come with Node, VSCode and OpenJDK preinstalled, so
> you don't need to worry about those.
2020-08-20 18:26:21 +03:00
>
2022-09-15 12:16:35 +03:00
> NOTE 2: After logging in, **it takes some time for the machine to be configured.** The script that installs Firefox,
> Node, VSCode and OpenJDK runs once the machine is available for login. The software you need should appear within
> about 10 minutes (an easy way to check is to try to open `D:\` , as this volume is created after all the software
2022-08-31 18:37:28 +03:00
> is installed).
2021-03-04 13:41:21 +03:00
>
2022-09-08 16:49:53 +03:00
> All the commands mentioned in this testing section can be run from a simple
2020-08-20 18:26:21 +03:00
> DOS prompt (start menu -> type "cmd" -> click "Command prompt").
2022-09-15 12:16:35 +03:00
>
> At the end of your Windows testing session, please be sure to terminate the GCP instance by running
> `./ad-hoc.sh destroy $ID`. Here `$ID` is the identity for your GCP instance - this is printed when you create your
2022-08-31 18:37:28 +03:00
> Windows instance.
2020-08-20 18:26:21 +03:00
2020-08-13 16:36:32 +03:00
1. Prerequisites for running the tests:
2020-04-22 20:54:49 +03:00
- [Visual Studio Code, Java-SDK ](https://docs.daml.com/getting-started/installation.html )
- [Node.js ](https://nodejs.org/en/download/ )
2020-08-13 16:36:32 +03:00
- Just the bare install; no need to build C dependencies.
2021-12-06 14:48:18 +03:00
If you have `nix` installed, you can use a suitable version of nodejs by
2022-09-15 12:16:35 +03:00
running `nix-shell -p nodejs-18_x` before running the `npm` commands below.
2022-08-31 18:37:28 +03:00
- [Maven ](https://maven.apache.org )
2020-04-22 20:54:49 +03:00
2020-04-20 17:29:22 +03:00
1. Run `daml version --assistant=yes` and verify that the new version is
selected as the assistant version and the default version for new projects.
2020-08-13 16:36:32 +03:00
1. Tests for the getting started guide (macOS/Linux **and** Windows). Note: if
using a remote Windows VM and an RDP client that supports copy/paste, you
can run through this on both Windows and your local unix in parallel fairly
easily.
2020-04-15 12:51:09 +03:00
2022-04-29 14:06:31 +03:00
1. For these steps you will need the getting started documentation for the
2022-09-15 12:16:35 +03:00
release that you are about to make. This documentation (for the release that you are testing) is published
at `https://docs.daml.com/$VERSION/getting-started/index.html` . Please ensure that `$VERSION` is expanded
2022-08-31 18:37:28 +03:00
correctly before trying this link!
2020-04-15 12:51:09 +03:00
2020-08-13 16:36:32 +03:00
1. `daml new create-daml-app --template create-daml-app`
2020-04-15 12:51:09 +03:00
2020-08-13 16:36:32 +03:00
1. `cd create-daml-app`
2020-04-15 12:51:09 +03:00
2022-02-02 12:46:34 +03:00
1. `daml start`
2020-08-13 16:36:32 +03:00
2022-08-31 18:37:28 +03:00
1. In a new terminal (with nodejs configured as above), from the `ui` folder:
2020-08-13 16:36:32 +03:00
2020-09-08 13:07:04 +03:00
1. `npm install`
2022-09-15 12:16:35 +03:00
- if this command returns with an exit code of 0, errors may be safely ignored.
2020-04-15 12:51:09 +03:00
2020-09-08 13:07:04 +03:00
1. `npm start`
2020-04-15 12:51:09 +03:00
1. Open two browser windows (you want to see them simultaneously ideally) at `localhost:3000` .
2022-02-02 19:40:52 +03:00
1. Log in as `alice` in the first window, log in as `bob` in the second window.
2020-04-15 12:51:09 +03:00
2022-02-02 19:40:52 +03:00
1. In the first window, where you are logged in as `Alice` , follow
2022-09-08 16:49:53 +03:00
`Bob` by typing their name in the dropdown (note that it will
2022-02-02 19:40:52 +03:00
be `Bob` not `bob` , the former is the global alias, the latter
is the participant-local username). Verify that `Bob` appears
in the list of users `Alice` is following. Verify in the other
2020-04-15 12:51:09 +03:00
browser window that `Alice` shows up in `Bob` ’ s network.
2020-10-08 12:00:48 +03:00
1. In the second window, where you are logged in as `Bob` ,
2022-09-08 16:49:53 +03:00
follow `Alice` by selecting it in the dropdown.
2020-10-08 12:00:48 +03:00
Verify that `Alice` appears in
2020-04-15 12:51:09 +03:00
the list of users `Bob` is following. Verify in the other
browser window that `Bob` shows up in `Alice` ’ s network.
2022-09-08 16:49:53 +03:00
1. Open the *"Your first feature"* section of the Getting Started Guide, e.g., from
2022-08-31 18:37:28 +03:00
`https://docs.daml.com/$VERSION/getting-started/first-feature.html`
2020-04-15 12:51:09 +03:00
if you did not build docs locally.
2022-08-31 18:37:28 +03:00
1. In a third terminal window, run `daml studio --replace=always` from the project root
2022-09-08 16:49:53 +03:00
directory. This should open Visual Studio Code. In the editor, open `daml/User.daml` .
2020-04-15 12:51:09 +03:00
1. Copy the `Message` template from the documentation to the end of `User.daml` .
1. Copy the `SendMessage` choice from the documentation to the
2022-08-31 18:37:28 +03:00
`User` template below the `Follow` choice.
2020-04-15 12:51:09 +03:00
2022-08-31 18:37:28 +03:00
1. Save your changes and close VSCode.
2020-04-15 12:51:09 +03:00
2022-08-31 18:37:28 +03:00
1. In the first terminal window (where `daml start` is running), press 'r'
(respectively 'r' + 'Enter' on Windows).
2020-04-15 12:51:09 +03:00
2022-08-31 18:37:28 +03:00
1. In the third terminal window, run `daml studio` .
2020-04-15 12:51:09 +03:00
1. Create `MessageList.tsx` , `MessageEdit.tsx` and modify
2022-08-31 18:37:28 +03:00
`MainView.tsx` as described in the documentation.
2020-04-15 12:51:09 +03:00
1. Verify that you do not see errors in the typescript code in VSCode.
2022-08-31 18:37:28 +03:00
1. Save your changes and close VSCode.
2020-04-15 12:51:09 +03:00
1. As before, open two browser windows at `localhost:3000` and log
2022-08-31 18:37:28 +03:00
in as `alice` and `bob` .
2020-04-15 12:51:09 +03:00
1. Make `Alice` follow `Bob` .
2022-09-08 16:49:53 +03:00
1. From `Bob` , select Alice in the `Select a follower` dropdown,
2022-08-31 18:37:28 +03:00
insert `hi alice` in the message field and click on `Send` .
2020-04-15 12:51:09 +03:00
1. Verify that `Alice` has received the message in the other window.
1. Make `Bob` follow `Alice` .
2022-09-08 16:49:53 +03:00
1. From `Alice` , select Bob in the `Select a follower` dropdown,
2022-08-31 18:37:28 +03:00
insert `hi bob` in the message field and click on `Send` .
2020-04-15 12:51:09 +03:00
1. Verify that `Bob` has received the message in the other window.
2020-04-20 17:29:22 +03:00
1. You can now close both browser windows and both running processes (`daml
2022-08-31 18:37:28 +03:00
start` and `npm start` ).
2020-03-26 16:30:55 +03:00
2020-04-20 17:29:22 +03:00
1. Don't forget to run this on the other platform! E.g. if you just ran
2022-08-31 18:37:28 +03:00
through on Linux or macOS, you still need to run on Windows, and vice
2022-09-15 12:16:35 +03:00
versa. For testing on Windows instances, please refer to the _Tips for Windows testing in an ad-hoc machine_
2022-08-31 18:37:28 +03:00
notes above.
2020-03-26 16:30:55 +03:00
2021-02-25 20:49:07 +03:00
1. Run through the following test plan on Windows. This is slightly shortened to
make testing faster and since most issues are not platform specific.
2022-01-18 13:11:15 +03:00
1. Run `daml new myproject` to create a new project and switch to it using
`cd myproject` .
2022-02-02 12:46:34 +03:00
1. Run `daml start` .
2022-09-08 16:49:53 +03:00
1. Open your browser at `http://localhost:7500` , verify that you can log in as
2022-02-16 23:38:31 +03:00
alice and there is one contract, and that the template list contains
2022-01-20 13:35:07 +03:00
`Main:Asset` among other templates.
2021-02-25 20:49:07 +03:00
1. Kill `daml start` with `Ctrl-C` .
1. Run `daml studio --replace=always` and open `daml/Main.daml` . Verify that
the script result appears within 30 seconds.
2022-08-31 18:37:28 +03:00
- you will need to click on the _Script results_ link in the open VS code window in order to verify this
2022-03-07 23:48:57 +03:00
1. Add `+` at the end of line 26 after `(PartyIdHint "Alice")` and verify that
you get an error on line 27.
2021-02-25 20:49:07 +03:00
2022-03-15 13:27:36 +03:00
1. On your PR (the one that triggered the release process: on
2022-03-25 20:02:51 +03:00
[daml] for 1.x releases, and on [assembly] for 2.x
2022-03-15 13:27:36 +03:00
releases), add the comment:
2021-02-25 20:49:07 +03:00
> Manual tests passed on Windows.
2020-04-20 17:29:22 +03:00
1. Tests for `quickstart-java` (Linux/macOS)
2020-04-15 12:51:09 +03:00
2022-08-31 18:37:28 +03:00
While this is no longer the default in the Getting Started Guide, we still test it
since the process covers things not covered by the new Getting Started Guide
(e.g. Navigator, Scripts, Maven artifacts, etc.)
2020-04-15 12:51:09 +03:00
2020-07-27 17:30:48 +03:00
1. Create a new project with `daml new quickstart --template quickstart-java`
2020-04-20 17:29:22 +03:00
and switch to it using `cd quickstart` .
2020-04-15 12:51:09 +03:00
2020-04-20 17:29:22 +03:00
1. Verify the new version is specified in `daml.yaml` as the `sdk-version` .
2020-04-15 12:51:09 +03:00
2022-01-18 12:10:58 +03:00
1. Run `daml start` . Your browser should be opened automatically at
2022-09-08 16:49:53 +03:00
`http://localhost:7500` .
1. Login as `alice` and verify that there is 1 contract.
1. In the templates section, verify that the templates list contains `Iou:Iou` , `Iou:IouTransfer` ,
2022-01-18 14:49:52 +03:00
and `IouTrade:IouTrade` among other templates.
1. Close the tab and kill `daml start` using `Ctrl-C` .
2020-04-15 12:51:09 +03:00
2020-04-20 17:29:22 +03:00
1. Run `daml build` .
2020-04-15 12:51:09 +03:00
2022-08-31 18:37:28 +03:00
1. In 3 separate terminals (each being in the `quickstart-java` project directory), run:
2022-01-18 14:49:52 +03:00
2022-09-08 16:49:53 +03:00
1. In Terminal 1 run `daml sandbox --port 6865`
2022-01-18 14:49:52 +03:00
2022-09-08 16:49:53 +03:00
1. In Terminal 2, run each of the following:
2022-01-18 14:49:52 +03:00
1. `daml ledger upload-dar --host localhost --port 6865 .daml/dist/quickstart-0.0.1.dar`
2022-09-15 12:16:35 +03:00
1.
2022-09-08 16:49:53 +03:00
```sh
daml script --ledger-host localhost --ledger-port 6865 --dar .daml/dist/quickstart-0.0.1.dar --script-name Main:initialize --output-file output.json
```
2022-01-18 14:49:52 +03:00
1. `cat output.json` and verify that the output looks like this:
2022-09-08 16:49:53 +03:00
```json
2022-01-18 14:49:52 +03:00
["Alice::NAMESPACE", "EUR_Bank::NAMESPACE"]
```
where `NAMESPACE` is some randomly generated series of hex digits.
1. `daml navigator server localhost 6865 --port 7500`
2022-09-08 16:49:53 +03:00
1. In Terminal 3, run:
```sh
daml codegen java && mvn compile exec:java@run-quickstart -Dparty=$(cat output.json | sed 's/\[\"//' | sed 's/".*//')
```
2022-01-18 14:49:52 +03:00
Note that this step scrapes the `Alice::NAMESPACE` party name from the `output.json` produced in the previous steps.
> Note: It takes some time (typically around half-an-hour) for our artifacts
> to be available on Maven Central. If you try running the last command before
> the artifacts are available, you will get a "not found" error. Trying to
> build again _in the next 24 hours_ will result in:
>
> ```
> Failure to find ... was cached in the local repository, resolution will not be reattempted until the update interval of digitalasset-releases has elapsed or updates are forced
> ```
>
> This is Maven telling you it has locally cached that "not found" result
> and will consider it valid for 24h. To bypass that and force Maven to
> try the network call again, add a `-U` option, as in
> `mvn compile exec:java@run-quickstart -U`. Note that this is required to
> bypass your local cache of the failure; it will not be required for a
> user trying to run the quickstart after the artifacts have been
> published.
>
> Another common problem is that artifacts fail to resolve because of custom
> Maven settings. Check your `~/.m2/settings.xml` configuration and try
> disabling them temporarily.
2020-04-15 12:51:09 +03:00
2022-02-16 23:38:31 +03:00
1. Point your browser to `http://localhost:7500` , login as `alice` and verify
2022-01-18 14:49:52 +03:00
that there is 1 contract, 1 owned IOU, and the templates list contains `Iou:Iou` , `Iou:IouTransfer` ,
and `IouTrade:IouTrade` among other templates.
2020-04-15 12:51:09 +03:00
2020-04-20 17:29:22 +03:00
1. Check that `curl http://localhost:8080/iou` returns:
```
2022-01-18 14:49:52 +03:00
{"0":{"issuer":"EUR_Bank::NAMESPACE","owner":"Alice::NAMESPACE","currency":"EUR","amount":100.0000000000,"observers":[]}}
2020-04-20 17:29:22 +03:00
```
2022-01-18 14:49:52 +03:00
where NAMESPACE is again the series of hex digits that you saw before.
2020-03-26 16:30:55 +03:00
2020-04-20 17:29:22 +03:00
1. Kill all processes.
2020-03-26 16:30:55 +03:00
2020-04-20 17:29:22 +03:00
1. Run `daml studio --replace=always` . This should open VSCode and trigger
2021-01-08 15:50:15 +03:00
the Daml extension that's bundled with the new SDK version. (The new
2020-04-20 17:29:22 +03:00
VSCode extension will not be in the marketplace at this point.)
2020-03-26 16:30:55 +03:00
2020-04-20 17:29:22 +03:00
1. Open `daml/Main.daml` .
2020-03-26 16:30:55 +03:00
2022-09-08 16:49:53 +03:00
1. Click on `Script results` above `initialize` (in the code) and wait for the script
2020-04-20 17:29:22 +03:00
results to appear.
2020-03-26 16:30:55 +03:00
2022-03-25 20:02:51 +03:00
1. Add `+` at the end of line 14, after `(PartyIdHint "Alice")` and
2022-03-17 20:56:03 +03:00
confirm you get an error in line 15.
2020-03-26 16:30:55 +03:00
2020-10-08 12:00:48 +03:00
1. Add `1` after the `+` and confirm you get a type error in line 14,
which says that `Script Party` does not match `Int` .
2020-03-26 16:30:55 +03:00
2020-09-25 09:46:35 +03:00
1. Delete the `+1` and the `e` in the second `"Alice"` and verify
that the script results are updated to the misspelled name.
2020-03-26 16:30:55 +03:00
2022-02-16 23:38:31 +03:00
1. Right click on `eurBank` in line 28 and verify that "Go to Definition"
2020-09-25 09:46:35 +03:00
takes you to the definition in line 17.
2020-03-26 16:30:55 +03:00
2020-04-20 17:29:22 +03:00
1. Close all files.
2019-05-10 18:14:22 +03:00
2021-06-21 20:11:35 +03:00
> Note: when running `daml studio --replace=always`, you force the
> installation of the VSCode extension bundled with the Daml SDK, and
2022-09-08 16:49:53 +03:00
> _disable the auto-upgrade mechanism in VSCode_. To instruct VSCode to go
2021-06-21 20:11:35 +03:00
> back to the published version of the extension, including auto-upgrades,
> you can run `daml studio --replace=published`.
2022-03-15 13:27:36 +03:00
1. On your PR (the one that triggered the release process: on
2022-03-25 20:02:51 +03:00
[daml] for 1.x releases, and on [assembly] for 2.x
2022-03-15 13:27:36 +03:00
releases), add the comment:
2020-03-09 14:50:18 +03:00
> Manual tests passed on [Linux/macOS].
specifying which platform you tested on.
2021-02-25 20:49:07 +03:00
1. If the release is bad, delete the release from the [releases page]. Mention
2020-08-13 16:36:32 +03:00
why it is bad as a comment on your PR, and **stop the process here** .
2019-12-20 13:12:12 +03:00
2021-10-06 13:12:11 +03:00
Note that **the Standard-Change label must remain on the PR** , even if the
release has failed.
2022-02-10 18:07:44 +03:00
1. Announce the release on `#product-daml` on Slack. For a stable release,
direct people to the release blog post; for a prerelease, you can include
the raw output of the `unreleased.sh` script in a thread after the
announcement. If there were any errors during testing, but we decided to keep
the release anyway, report those on the PR and include a link to the PR in the
announcement.
2020-08-13 16:36:32 +03:00
2022-02-08 21:12:11 +03:00
For a stable release, you need to additionally:
1. Go to the [releases page] and remove the prerelease marker on
2020-08-13 16:36:32 +03:00
the release. Also change the text to
```See [the release notes blog]() for details.```
adding in the direct link to this version's [release notes]. Documentation
for this release will be added to docs.daml.com on the next hour.
2020-03-10 14:45:31 +03:00
2022-02-08 21:12:11 +03:00
1. Coordinate with product (& marketing) for the relevant public
2021-01-08 15:50:15 +03:00
announcements (Daml Forum, Twitter, etc.).
introduce new release process (#4513)
Context
=======
After multiple discussions about our current release schedule and
process, we've come to the conclusion that we need to be able to make a
distinction between technical snapshots and marketing releases. In other
words, we need to be able to create a bundle for early adopters to test
without making it an officially-supported version, and without
necessarily implying everyone should go through the trouble of
upgrading. The underlying goal is to have less frequent but more stable
"official" releases.
This PR is a proposal for a new release process designed under the
following constraints:
- Reuse as much as possible of the existing infrastructure, to minimize
effort but also chances of disruptions.
- Have the ability to create "snapshot"/"nightly"/... releases that are
not meant for general public consumption, but can still be used by savvy
users without jumping through too many extra hoops (ideally just
swapping in a slightly-weirder version string).
- Have the ability to promote an existing snapshot release to "official"
release status, with as few changes as possible in-between, so we can be
confident that the official release is what we tested as a prerelease.
- Have as much of the release pipeline shared between the two types of
releases, to avoid discovering non-transient problems while trying to
promote a snapshot to an official release.
- Triggerring a release should still be done through a PR, so we can
keep the same approval process for SOC2 auditability.
The gist of this proposal is to replace the current `VERSION` file with
a `LATEST` file, which would have the following format:
```
ef5d32b7438e481de0235c5538aedab419682388 0.13.53-alpha.20200214.3025.ef5d32b7
```
This file would be maintained with a script to reduce manual labor in
producing the version string. Other than that, the process will be
largely the same, with releases triggered by changes to this `LATEST`
and the release notes files.
Version numbers
===============
Because one of the goals is to reduce the velocity of our published
version numbers, we need a different version scheme for our snapshot
releases. Fortunately, most version schemes have some support for that;
unfortunately, the SDK sits at the intersection of three different
version schemes that have made incompatible choices. Without going into
too much detail:
- Semantic versioning (which we chose as the version format for the SDK
version number) allows for "prerelease" version numbers as well as
"metadata"; an example of a complete version string would be
`1.2.3-nightly.201+server12.43`. The "main" part of the version string
always has to have 3 numbers separated by dots; the "prerelease"
(after the `-` but before the `+`) and the "metadata" (after the `+`)
parts are optional and, if present, must consist of one or more segments
separated by dots, where a segment can be either a number or an
alphanumeric string. In terms of ordering, metadata is irrelevant and
any version with a prerelease string is before the corresponding "main"
version string alone. Amongst prereleases, segments are compared in
order with purely numeric ones compared as numbers and mixed ones
compared lexicographically. So 1.2.3 is more recent than 1.2.3-1,
which is itself less recent than 1.2.3-2.
- Maven version strings are any number of segments separated by a `.`, a
`-`, or a transition between a number and a letter. Version strings
are compared element-wise, with numeric segments being compared as
numbers. Alphabetic segments are treated specially if they happen to be
one of a handful of magic words (such as "alpha", "beta" or "snapshot"
for example) which count as "qualifiers"; a version string with a
qualifier is "before" its prefix (`1.2.3` is before `1.2.3-alpha.3`,
which is the same as `1.2.3-alpha3` or `1.2.3-alpha-3`), and there is a
special ordering amongst qualifiers. Other alphabetic segments are
compared alphabetically and count as being "after" their prefix
(`1.2.3-really-final-this-time` counts as being released after `1.2.3`).
- GHC package numbers are comprised of any number of numeric segments
separated by `.`, plus an optional (though deprecated) alphanumeric
"version tag" separated by a `-`. I could not find any official
documentation on ordering for the version tag; numeric segments are
compared as numbers.
- npm uses semantic versioning so that is covered already.
After much more investigation than I'd care to admit, I have come up
with the following compromise as the least-bad solution. First,
obviously, the version string for stable/marketing versions is going to
be "standard" semver, i.e. major.minor.patch, all numbers, which works,
and sorts as expected, for all three schemes. For snapshot releases, we
shall use the following (semver) format:
```
0.13.53-alpha.20200214.3025.ef5d32b7
```
where the components are, respectively:
- `0.13.53`: the expected version string of the next "stable" release.
- `alpha`: a marker that hopefully scares people enough.
- `20200214`: the date of the release commit, which _MUST_ be on
master.
- `3025`: the number of commits in master up to the release commit
(included). Because we have a linear, append-only master branch, this
uniquely identifies the commit.
- `ef5d32b7ù : the first 8 characters of the release commit sha. This is
not strictly speaking necessary, but makes it a lot more convenient to
identify the commit.
The main downsides of this format are:
1. It is not a valid format for GHC packages. We do not publish GHC
packages from the SDK (so far we have instead opted to release our
Haskell code as separate packages entirely), so this should not be an
issue. However, our SDK version currently leaks to `ghc-pkg` as the
version string for the stdlib (and prim) packages. This PR addresses
that by tweaking the compiler to remove the offending bits, so `ghc-pkg`
would see the above version number as `0.13.53.20200214.3025`, which
should be enough to uniquely identify it. Note that, as far as I could
find out, this number would never be exposed to users.
2. It is rather long, which I think is good from a human perspective as
it makes it more scary. However, I have been told that this may be
long enough to cause issues on Windows by pushing us past the max path
size limitation of that "OS". I suggest we try it and see what
happens.
The upsides are:
- It clearly indicates it is an unstable release (`alpha`).
- It clearly indicates how old it is, by including the date.
- To humans, it is immediately obvious which version is "later" even if
they have the same date, allowing us to release same-day patches if
needed. (Note: that is, commits that were made on the same day; the
release date itself is irrelevant here.)
- It contains the git sha so the commit built for that release is
immediately obvious.
- It sorts correctly under all schemes (modulo the modification for
GHC).
Alternatives I considered:
- Pander to GHC: 0.13.53-alpha-20200214-3025-ef5d32b7. This format would
be accepted by all schemes, but will not sort as expected under semantic
versioning (though Maven will be fine). I have no idea how it will sort
under GHC.
- Not having any non-numeric component, e.g. `0.13.53.20200214.3025`.
This is not valid semantic versioning and is therefore rejected by
npm.
- Not having detailed info: just go with `0.13.53-snapshot`. This is
what is generally done in the Java world, but we then lose track of what
version is actually in use and I'm concerned about bug reports. This
would also not let us publish to the main Maven repo (at least not more
than once), as artifacts there are supposed to be immutable.
- No having a qualifier: `0.13.53-3025` would be acceptable to all three
version formats. However, it would not clearly indicate to humans that
it is not meant as a stable version, and would sort differently under
semantic versioning (which counts it as a prerelease, i.e. before
`0.13.53`) than under maven (which counts it as a patch, so after
`0.13.53`).
- Just counting releases: `0.13.53-alpha.1`, where we just count the
number of prereleases in-between `0.13.52` and the next. This is
currently the fallback plan if Windows path length causes issues. It
would be less convenient to map releases to commits, but it could still
be done via querying the history of the `LATEST` file.
Release notes
=============
> Note: We have decided not to have release notes for snapshot releases.
Release notes are a bit tricky. Because we want the ability to make
snapshot releases, then later on promote them to stable releases, it
follows that we want to build commits from the past. However, if we
decide post-hoc that a commit is actually a good candidate for a
release, there is no way that commit can have the appropriate release
notes: it cannot know what version number it's getting, and, moreover,
we now track changes in commit messages. And I do not think anyone wants
to go back to the release notes file being a merge bottleneck.
But release notes need to be published to the releases blog upon
releasing a stable version, and the docs website needs to be updated and
include them.
The only sensible solution here is to pick up the release notes as of
the commit that triggers the release. As the docs cron runs
asynchronously, this means walking down the git history to find the
relevant commit.
> Note: We could probably do away with the asynchronicity at this point.
> It was originally included to cover for the possibility of a release
> failing. If we are releasing commits from the past after they have been
> tested, this should not be an issue anymore. If the docs generation were
> part of the synchronous release step, it would have direct access to the
> correct release notes without having to walk down the git history.
>
> However, I think it is more prudent to keep this change as a future step,
> after we're confident the new release scheme does indeed produce much more
> reliable "stable" releases.
New release process
===================
Just like releases are currently controlled mostly by detecting
changes to the `VERSION` file, the new process will be controlled by
detecting changes to the `LATEST` file. The format of that file will
include both the version string and the corresponding SHA.
Upon detecting a change to the `LATEST` file, CI will run the entire
release process, just like it does now with the VERSION file. The main
differences are:
1. Before running the release step, CI will checkout the commit
specified in the LATEST file. This requires separating the release
step from the build step, which in my opinion is cleaner anyway.
2. The `//:VERSION` Bazel target is replaced by a repository rule
that gets the version to build from an environment variable, with a
default of `0.0.0` to remain consistent with the current `daml-head`
behaviour.
Some of the manual steps will need to be skipped for a snapshot release.
See amended `release/RELEASE.md` in this commit for details.
The main caveat of this approach is that the official release will be a
different binary from the corresponding snapshot. It will have been
built from the same source, but with a different version string. This is
somewhat mitigated by Bazel caching, meaning any build step that does
not depend on the version string should use the cache and produce
identical results. I do not think this can be avoided when our artifact
includes its own version number.
I must note, though, that while going through the changes required after
removing the `VERSION` file, I have been quite surprised at the sheer number of
things that actually depend on the SDK version number. I believe we should
look into reducing that over time.
CHANGELOG_BEGIN
CHANGELOG_END
2020-02-25 19:01:23 +03:00
2022-02-08 21:12:11 +03:00
1. Documentation is published automatically once the release is
2020-08-13 16:36:32 +03:00
public on GitHub, though this runs on an hourly cron.
2019-12-20 13:12:12 +03:00
Thanks for making a release!
2020-08-13 16:36:32 +03:00
2022-03-25 20:02:51 +03:00
[assembly]: https://github.com/DACH-NY/assembly
[canton]: https://github.com/DACH-NY/canton
2022-03-15 13:27:36 +03:00
[`LATEST`]: https://github.com/digital-asset/daml/blob/main/LATEST
2020-08-13 16:36:32 +03:00
[checklist]: https://docs.google.com/document/d/1RY2Qe9GwAUiiSJmq1lTzy6wu1N2ZSEILQ68M9n8CHgg
2022-05-18 15:50:36 +03:00
[release planning]: https://docs.google.com/document/d/1FaBFuYweYt0hx6fVg9rhufCtDNPiATXu5zwN2NWp2s4/edit#
2022-03-25 20:02:51 +03:00
[daml]: https://github.com/digital-asset/daml
2020-08-13 16:36:32 +03:00
[release notes]: https://daml.com/release-notes/
2022-03-15 13:27:36 +03:00
[releases page]: https://github.com/digital-asset/daml/releases
2022-03-25 20:02:51 +03:00
[testing]: #testing
2022-09-08 16:49:53 +03:00
[Remmina]: https://remmina.org