OILS / devtools / release-note.sh View on Github | oilshell.org

282 lines, 61 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# devtools/release-note.sh <function name>
5#
6# Example:
7# $0 fetch-issues
8# $0 write-template
9
10set -o nounset
11set -o pipefail
12set -o errexit
13
14source build/dev-shell.sh # PYTHONPATH
15source devtools/release-version.sh # for escape-segments
16
17readonly OILS_VERSION=$(head -n 1 oil-version.txt)
18readonly PREV_VERSION='0.23.0'
19
20# adapted from release-version.sh
21_git-changelog-body() {
22 local commit=$1
23
24 # - a trick for HTML escaping (avoid XSS): surround %s with unlikely bytes,
25 # \x00 and \x01. Then pipe Python to escape.
26 # --reverse makes it go in forward chronlogical order.
27
28 # %x00 generates the byte \x00
29 local format='<tr>
30 <td><a class="checksum"
31 href="https://github.com/oils-for-unix/oils/commit/%H">%h</a>
32 </td>
33 <td>%x00%an%x01</td>
34 <td class="subject">%x00%s%x01</td>
35 </tr>'
36 git log \
37 --reverse \
38 --pretty="format:$format" \
39 --date=short \
40 -n 1 \
41 $commit \
42 | escape-segments
43}
44
45contrib-commit-table() {
46 # Filter out my commits, then pass back to git log
47
48 # 2023-07: Deoptimized due to git breakage
49 # https://stackoverflow.com/questions/6889830/equivalence-of-git-log-exclude-author
50
51 git log --format='%H %an' "release/$PREV_VERSION..release/$OILS_VERSION" |
52 grep -v 'Andy C' |
53 cut -d ' ' -f 1 |
54 xargs -n 1 $0 _git-changelog-body
55
56 #xargs -n 1 -- git log -n 1
57}
58
59fetch-issues() {
60 local url='https://api.github.com/repos/oils-for-unix/oils/issues?labels=pending-release'
61 # For Oils 0.24.0
62 #local url='https://api.github.com/repos/oils-for-unix/oils/issues?labels=pending-release-2'
63 curl "$url" > _tmp/issues.json
64}
65
66issues-table() {
67 cat _tmp/issues.json | devtools/services/github_issues.py
68}
69
70readonly DATE_DIR=$(date +%Y/%m)
71readonly BLOG_DIR="../oilshell.org/blog/$DATE_DIR"
72
73write-template() {
74 ### New blog post
75
76 local out=$BLOG_DIR/_release-$OILS_VERSION.md
77 print-template > $out
78 echo "Wrote $out"
79}
80
81write-zulip-thread() {
82 local bot_email=$1
83 local bot_api_key=$2
84
85 local out=$BLOG_DIR/release-thread.txt
86 devtools/services/zulip.sh print-thread \
87 "$bot_email" "$bot_api_key" oil-dev "Oils $OILS_VERSION Release" \
88 | tee $out
89
90 echo
91 echo "Wrote $out"
92}
93
94preview-template() {
95 local out=_tmp/release-note.html
96
97 # This isn't right because it doesn't split the --- front matter
98 # But good enough for now
99
100 print-template | doctools/cmark.py > $out
101 log "Wrote $out"
102}
103
104print-template() {
105 local metric_prev=${1:-$PREV_VERSION}
106
107 cat <<EOF
108---
109title: Oils $OILS_VERSION - Foo Foo
110date: $(date +%Y/%m/%d)
111css_file: blog-bundle-v6.css
112body_css_class: width35
113default_highlighter: oil-sh
114tags: oil-release
115comments_url: TODO
116published: no
117---
118
119This is the latest version of Oils, a Unix shell that's our upgrade path from
120[bash][]:
121
122[bash]: \$xref
123
124<div class="attention">
125
126[Oils version $OILS_VERSION][release-index] - Source tarballs and documentation.
127
128</div>
129
130To build and run it, follow the instructions in [INSTALL.txt][]. The wiki has
131tips on [How To Test OSH](\$wiki).
132
133If you're new to the project, see [Why Create a New Shell?][why-oil] and posts
134tagged #[FAQ](\$blog-tag).
135
136[INSTALL.txt]: /release/$OILS_VERSION/doc/INSTALL.html
137[github-bugs]: https://github.com/oils-for-unix/oils/issues
138[why-oil]: ../../2021/01/why-a-new-shell.html
139[release-index]: /release/$OILS_VERSION/
140
141[oilshell.zulipchat.com]: http://oilshell.zulipchat.com/
142
143<div id="toc">
144</div>
145
146I'm trying something different this release. These release notes are
147semi-automated with a shell script! See the [last
148post](../02/good-parts-sketch.html) in #[shell-the-good-parts](\$blog-tag).
149
150## Closed Issues
151
152<table>
153EOF
154
155 issues-table
156
157 cat <<EOF
158</table>
159
160## Commit Log
161
162Here are the commits from other contributors. You can also view the [full
163changelog][changelog].
164
165[changelog]: /release/$OILS_VERSION/changelog.html
166
167<table>
168EOF
169
170 contrib-commit-table
171
172 cat <<EOF
173</table>
174
175## Documentation Updated
176
177- [Known Differences](/release/$OILS_VERSION/doc/known-differences.html)
178- [Interpreter State](/release/$OILS_VERSION/doc/interpreter-state.html) - still
179 a draft.
180
181### Wiki Pages
182
183- [How Interactive Shells Work](https://github.com/oils-for-unix/oils/wiki/How-Interactive-Shells-Work)
184
185
186## What's Next?
187
188Here are some notable Open Issues
189
190- [Provide APIs to allow users to write their own line editor / interactive
191interface](\$issue:663)
192
193## Appendix: Metrics for the $OILS_VERSION Release
194
195These metrics help me keep track of the project. Let's compare this release
196with the previous one, version [$metric_prev](/release/$metric_prev).
197
198[spec-test]: \$xref:spec-test
199
200### Spec Tests
201
202The Python reference implementation foo foo
203
204- [OSH spec tests for $metric_prev](https://www.oilshell.org/release/$metric_prev/test/spec.wwz/osh-py/index.html): **2023** tests,
205**1789** passing, **91** failing
206- [OSH spec tests for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/test/spec.wwz/osh-py/index.html): **2042** tests, **1814** passing, **89** failing
207
208And the C++ translation foo foo
209
210- [C++ spec tests for $metric_prev](https://www.oilshell.org/release/$metric_prev/test/spec.wwz/osh-cpp/compare.html) - **1684** of **1792** passing
211- [C++ spec tests for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/test/spec.wwz/osh-cpp/compare.html) - **1801** of **1817** passing
212
213YSH got a lot of new behavior:
214
215- [YSH spec tests for $metric_prev](https://www.oilshell.org/release/$metric_prev/test/spec.wwz/ysh-py/index.html): **561** tests, **514** passing, **47** failing
216- [YSH spec tests for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/test/spec.wwz/ysh-py/index.html): **630** tests, **571** passing, **59** failing
217
218And the C++ tarball is catching up rapidly:
219
220- [YSH C++ spec tests for $metric_prev](https://www.oilshell.org/release/$metric_prev/test/spec.wwz/ysh-cpp/compare.html): **357** of **514** passing, delta **157**
221- [YSH C++ spec tests for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/test/spec.wwz/ysh-cpp/compare.html): **492** of **569** passing, delta **77**
222
223
224### Benchmarks
225
226Bar Bar
227
228- [Parser Performance for $metric_prev](https://www.oilshell.org/release/$metric_prev/benchmarks.wwz/osh-parser/): **21.8**
229 thousand irefs per line
230- [Parser Performance for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/benchmarks.wwz/osh-parser/): **26.0**
231 thousand irefs per line
232
233G G
234
235- [benchmarks/gc for $metric_prev](https://www.oilshell.org/release/$metric_prev/benchmarks.wwz/gc/): \`parse.configure-coreutils\`
236 **1.83 M** objects comprising **62.1 MB**, max RSS **68.9 MB**
237- [benchmarks/gc for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/benchmarks.wwz/gc/): \`parse.configure-coreutils\` **1.83 M** objects comprising **65.0 MB**, max RSS **69.3 MB**
238
239G G
240
241- [benchmarks/gc-cachegrind for $metric_prev](https://www.oilshell.org/release/$metric_prev/benchmarks.wwz/gc-cachegrind/) - \`fib\` takes **61.6** million irefs, mut+alloc+free+gc
242- [benchmarks/gc-cachegrind for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/benchmarks.wwz/gc-cachegrind/) - \`fib\` takes **65.4** million irefs, mut+alloc+free+gc
243
244
245
246Foo Foo
247
248- [Runtime Performance for $metric_prev](https://www.oilshell.org/release/$metric_prev/benchmarks.wwz/osh-runtime/): **68.7** and **56.9** seconds running CPython's \`configure\`
249- [Runtime Performance for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/benchmarks.wwz/osh-runtime/):
250 **35.2** and **22.5** seconds running CPython's \`configure\`
251- [bash](\$xref): **26.8** and **16.2** seconds running CPython's \`configure\`
252
253
254### Code Size
255
256The executable spec foo foo
257
258Significant lines:
259
260- [cloc for $metric_prev](https://www.oilshell.org/release/$metric_prev/pub/metrics.wwz/line-counts/cloc-report.txt):
261 **19,581** lines of Python and C, **355** lines of ASDL
262- [cloc for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/pub/metrics.wwz/line-counts/cloc-report.txt):
263 **19,491** lines of Python and C, **363** lines of ASDL
264
265Code in the \`oils-for-unix\` C++ tarball, much of which is generated:
266
267- [oil-cpp for $metric_prev](https://www.oilshell.org/release/$metric_prev/pub/metrics.wwz/line-counts/oil-cpp.txt) - **86,985** lines
268- [oil-cpp for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/pub/metrics.wwz/line-counts/oil-cpp.txt) - **90,682** lines
269
270Compiled binary size:
271
272- [ovm-build for $metric_prev](https://www.oilshell.org/release/$metric_prev/benchmarks.wwz/ovm-build/):
273 **1.18 MB** of native code (under GCC)
274- [ovm-build for $OILS_VERSION](https://www.oilshell.org/release/$OILS_VERSION/benchmarks.wwz/ovm-build/):
275 **1.23 MB** of native code (under GCC)
276
277&nbsp;
278
279EOF
280}
281
282"$@"