Skip to content

Commit 6cb0770

Browse files
authored
Merge pull request #1711 from tgodzik/add-post-mortem
docs: Add Scala 3.6.0 postmortem blog post
2 parents 8fa013a + f37d18a commit 6cb0770

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
category: announcement
3+
permalink: /news/post-mortem-3.6.0.html
4+
title: "Postmortem of Scala 3.6.0"
5+
by: Scala Core Team
6+
---
7+
8+
Incident Date: _October 18th, 2024_
9+
Nature of the incident: _Accidental release of 3.6.0-RC1 under 3.6.0 on Maven
10+
Central_
11+
12+
On Friday, 18th of October 2024, during the publication process of **3.6.0-RC1**
13+
an incident occurred that ended up in publishing Scala **3.6.0** instead. After
14+
an internal investigation, we pinpointed the incident to be technical in nature.
15+
16+
Within one hour of the issue being reported, the
17+
[Scala Core Team](https://scala-lang.org/scala-core/) mitigated the problem by
18+
starting the Scala **3.6.1** release – which is to be treated like an RC; it has
19+
been available since Saturday 19th October. Scala **3.6.0** was abandoned and
20+
promptly announced to the public as broken.
21+
22+
We apologize to the Scala users for any inconvenience it might have caused. We
23+
are working on better understanding what led up to this accident and ensuring it
24+
doesn’t happen again.
25+
26+
We invite you to follow the recommendations below and find out more details
27+
about our findings of what happened and what is done to prevent future accidents
28+
of this kind.
29+
30+
## Recommendations
31+
32+
Use version 3.5.2, the current stable Next version, recommended for general
33+
use.
34+
Use version 3.6.1 as an RC version, to be used only for testing.
35+
DO NOT USE 3.6.0, not for testing, not for anything, it’s considered broken.
36+
37+
We are working on 3.6.2 as the new stable release, which will be available
38+
sometime in the second half of November.
39+
40+
## How does it affect users?
41+
42+
Scala 3.6.0 is a broken release \- it should never be used by users of Scala.
43+
The results of the compilation might not be consumable by stable versions of the
44+
compiler or TASTy based tooling.
45+
Tooling that automatically uses the latest available version of Scala will use
46+
the hot-fix release 3.6.1, which should be treated as a Release Candidate
47+
version. We don’t encourage most users to upgrade yet, unless for testing
48+
purposes. Instead, use the stable 3.5.2 and wait to upgrade until 3.6.2 is out.
49+
50+
## What happened?
51+
52+
During the publication of Scala **3.6.0-RC1** to the Sonatype Maven repository,
53+
a mistake occurred and we released **a misconfigured 3.6.0** instead. As a
54+
result, the released version of the compiler produces TASTy files in the
55+
experimental version that cannot be consumed by stable TASTy consumers (e.g. the
56+
Scala compiler, tasty-query, Scaladoc). Setting the TASTy version to an
57+
experimental one is a standard procedure when releasing a new release candidate
58+
of a minor version of Scala 3.
59+
60+
## What immediate steps were taken?
61+
62+
On the evening of Friday the 18th of October 2024 the internal compiler team was
63+
informed of the erroneous release and the following immediate steps were taken:
64+
65+
- We announced on social media that Scala 3.6.0 was released unintentionally and
66+
is discouraged from being used.
67+
- We prevented `scala-steward` from automatically upgrading repositories using
68+
Scala Next to the 3.6.x line.
69+
- We followed up with a hotfix release in the form of Scala 3.6.1 on the
70+
following day.
71+
72+
## Why did we need 3.6.1?
73+
74+
Some tools in the Scala ecosystem can refer to the latest stable Scala version
75+
that’s been published on Maven Central. Those include:
76+
77+
- Scala CLI / the `scala` runner (via `-S 3` from the command line or with the
78+
`//> using scala 3` using directive)
79+
- coursier (with `cs setup` and `cs install scala` sub-commands)
80+
- potentially other tooling integrating with `coursier`
81+
82+
We were concerned Scala users might use this unknowingly broken version of the
83+
compiler to produce artifacts with the experimental version of TASTy. In
84+
particular, we wanted to prevent publishing Scala libraries from being published
85+
to the (immutable) Maven repository using a broken Scala release. It could also
86+
potentially affect applications using Scala 3.6.0 that would try to use
87+
libraries produced by Scala 3.6.1 or later.
88+
89+
We decided to publish Scala 3.6.1 as a follow-up ASAP so that the most recent
90+
version doesn’t include the experimental TASTy flag nor RC settings. With 3.6.1
91+
we ensured tooling will, at the very least, refer to a Scala version that
92+
actually could be considered reasonably stable.
93+
94+
We don’t yet encourage users to upgrade to Scala 3.6.1 on their own, except for
95+
testing purposes. Users should wait with upgrades until a future announcement.
96+
For now we advise users to stay on Scala 3.5.2 until further notice.
97+
98+
## Why did it happen?
99+
100+
The accidental release under the incorrect version happened due to a combination
101+
of multiple factors:
102+
103+
- Scala 3 uses an `sbt` plugin to automatically release artifacts to Sonatype
104+
Maven repositories. The automation happens without manual confirmation of the
105+
release. This factor prevented us from auditing published artifacts and
106+
removing the artifacts from the staging repository. Removing artifacts from
107+
Maven Central after they’ve been published is also essentially impossible.
108+
- We introduced changes to the algorithm for calculating versions of the
109+
compiler to mitigate problems with creating `.msi` installer files. As the
110+
change did not alter SNAPSHOT/NIGHTLY behavior, we did not detect the issue in
111+
time. We now realize similar changes require extra testing procedures, which
112+
will be implemented as an improvement. The change was added in
113+
[scala3\#21011](https://github.com/scala/scala3/pull/21011).
114+
- The change introducing the issue was merged on the 11th of July. Now, three
115+
months later, at the time of the release the side effects were not properly
116+
considered as in the meantime there was a change in staff coupled with
117+
insufficient documentation.
118+
- We experienced unrelated downtime on the side of our infrastructure, which
119+
delayed the (as it was meant to be) release of 3.6.0-RC1 from Wednesday 16th
120+
to Friday 18th of October. Given that it was an RC, we continued the queued
121+
job on Friday. We now realize we should have postponed it further until Monday
122+
21st. Resolving the incident would have been a lot easier for the Core and
123+
Compiler teams on a weekday rather than on a Friday night.
124+
125+
## How do we stop it from repeating?
126+
127+
In conclusion, after all that we learned from this incident, we are introducing
128+
the following processes as preventative measures:
129+
130+
- Extra checks to the release procedure to ensure the correct versioning of
131+
published Scala artifacts.
132+
- Any changes related to either release scripts or compiler versioning will be
133+
tested using a custom Maven repository before the start of a public release.
134+
- Additional, manual approval of published artifacts to the staging Maven
135+
repository.
136+
- We will be mindful of the day of week for releases, and avoid Thursdays and
137+
Fridays.
138+
- We will ensure that every change associated with the release process is well
139+
documented internally.

0 commit comments

Comments
 (0)