Skip to content

Commit 616602e

Browse files
authored
add changelog and changelog generator (filecoin-project#95)
1 parent 7a9858e commit 616602e

File tree

3 files changed

+350
-0
lines changed

3 files changed

+350
-0
lines changed

Diff for: CHANGELOG.md

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# filecoin-ffi changelog
2+
3+
## 0.26.2
4+
5+
This release contains a fix for a bug which prevented unmodified miners from
6+
generating Winning PoSts for 64GiB sectors. It also contains a fix for a bug
7+
which was an occasional source of `bad file descriptor` errors observed during
8+
CommP generation (our hypothesis is that the `*os.File` was being GC'ed before
9+
the CGO call returned).
10+
11+
### Changelog
12+
13+
- github.com/filecoin-project/filecoin-ffi:
14+
- don't let Go garbage collect FD until FFI call returns ([filecoin-project/filecoin-ffi#84](https://github.com/filecoin-project/filecoin-ffi/pull/84))
15+
- fix: error if there is already a logger
16+
- add winning PoSt for 64 GiB (#93) ([filecoin-project/filecoin-ffi#93](https://github.com/filecoin-project/filecoin-ffi/pull/93))
17+
18+
### Contributors
19+
20+
| Contributor | Commits | Lines ± | Files Changed |
21+
|-------------|---------|---------|---------------|
22+
| Volker Mische | 1 | +24/-7 | 1 |
23+
| laser | 1 | +5/-5 | 1 |
24+
| shannon-6block | 1 | +2/-0 | 1 |
25+
26+
## 0.26.1
27+
28+
This release updates to version 0.4.1 of specs-actors, which (among other
29+
things) extends the `RegisteredProof` types to include 64GiB sector sizes. It
30+
also includes a fix for Window PoSt (multiple proofs were being flattened into
31+
a single byte array) and various fixes for bellperson and neptune Rust crates.
32+
33+
### Changelog
34+
35+
- github.com/filecoin-project/filecoin-ffi:
36+
- Update deps revisited ([filecoin-project/filecoin-ffi#91](https://github.com/filecoin-project/filecoin-ffi/pull/91))
37+
- newest upstream (#88) ([filecoin-project/filecoin-ffi#88](https://github.com/filecoin-project/filecoin-ffi/pull/88))
38+
- update rust-filecoin-proofs-api to include PoSt fix (#87) ([filecoin-project/filecoin-ffi#87](https://github.com/filecoin-project/filecoin-ffi/pull/87))
39+
- upgrade to specs-actors 0.4.1 (64GiB sector support) ([filecoin-project/filecoin-ffi#85](https://github.com/filecoin-project/filecoin-ffi/pull/85))
40+
- Upgrade to specs-actors v0.3.0 (#81) ([filecoin-project/filecoin-ffi#81](https://github.com/filecoin-project/filecoin-ffi/pull/81))
41+
- github.com/filecoin-project/go-amt-ipld (v2.0.1-0.20200131012142-05d80eeccc5e -> v2.0.1-0.20200424220931-6263827e49f2):
42+
- implement method to get first index in amt ([filecoin-project/go-amt-ipld#11](https://github.com/filecoin-project/go-amt-ipld/pull/11))
43+
- implement ForEachAt method to support iteration starting at a given i… ([filecoin-project/go-amt-ipld#10](https://github.com/filecoin-project/go-amt-ipld/pull/10))
44+
- github.com/filecoin-project/specs-actors (v0.2.0 -> v0.4.1-0.20200509020627-3c96f54f3d7d):
45+
- Minting function maintainability (#356) ([filecoin-project/specs-actors#356](https://github.com/filecoin-project/specs-actors/pull/356))
46+
- support for 64GiB sectors (#355) ([filecoin-project/specs-actors#355](https://github.com/filecoin-project/specs-actors/pull/355))
47+
- Temporary param update (#352) ([filecoin-project/specs-actors#352](https://github.com/filecoin-project/specs-actors/pull/352))
48+
- document reward minting function tests (#348) ([filecoin-project/specs-actors#348](https://github.com/filecoin-project/specs-actors/pull/348))
49+
- puppet type and method for failed marshal to cbor (#347) ([filecoin-project/specs-actors#347](https://github.com/filecoin-project/specs-actors/pull/347))
50+
- Unit tests for prove commit sector (#351) ([filecoin-project/specs-actors#351](https://github.com/filecoin-project/specs-actors/pull/351))
51+
- Fix failure to detect faults of exactly-full top partition (#350) ([filecoin-project/specs-actors#350](https://github.com/filecoin-project/specs-actors/pull/350))
52+
- Fix checking of fault/recovery declaration deadlines (#349) ([filecoin-project/specs-actors#349](https://github.com/filecoin-project/specs-actors/pull/349))
53+
- Set ConsensusMinerMinPower to 10TiB (#344) ([filecoin-project/specs-actors#344](https://github.com/filecoin-project/specs-actors/pull/344))
54+
- improve deal accounting performance (#309) ([filecoin-project/specs-actors#309](https://github.com/filecoin-project/specs-actors/pull/309))
55+
- DeadlineInfo handles expired proving period (#343) ([filecoin-project/specs-actors#343](https://github.com/filecoin-project/specs-actors/pull/343))
56+
- document reward-minting taylorSeriesExpansion (#338) ([filecoin-project/specs-actors#338](https://github.com/filecoin-project/specs-actors/pull/338))
57+
- implement puppet actor (#290) ([filecoin-project/specs-actors#290](https://github.com/filecoin-project/specs-actors/pull/290))
58+
- Fix the 32GiB Window PoSt partition size again (#337) ([filecoin-project/specs-actors#337](https://github.com/filecoin-project/specs-actors/pull/337))
59+
- Fix seal proof type in miner actor and parameterize WPoSt partition size by it (#336) ([filecoin-project/specs-actors#336](https://github.com/filecoin-project/specs-actors/pull/336))
60+
- Change WPoStPartitionSectors to 2349 (#332) ([filecoin-project/specs-actors#332](https://github.com/filecoin-project/specs-actors/pull/332))
61+
- Remove unused SectorSize from VerifyDealsOnSectorProveCommitParams (#328) ([filecoin-project/specs-actors#328](https://github.com/filecoin-project/specs-actors/pull/328))
62+
- require success in reward actor send reward (#331) ([filecoin-project/specs-actors#331](https://github.com/filecoin-project/specs-actors/pull/331))
63+
- Power actor CreateMiner passes on value received to new actor (#327) ([filecoin-project/specs-actors#327](https://github.com/filecoin-project/specs-actors/pull/327))
64+
- Specify cron genesis entries (#326) ([filecoin-project/specs-actors#326](https://github.com/filecoin-project/specs-actors/pull/326))
65+
- Remove SysErrInternal definition, use of which is always a bug (#304) ([filecoin-project/specs-actors#304](https://github.com/filecoin-project/specs-actors/pull/304))
66+
67+
### Contributors
68+
69+
| Contributor | Commits | Lines ± | Files Changed |
70+
|-------------|---------|---------|---------------|
71+
| Alex North | 13 | +654/-280 | 35 |
72+
| Whyrusleeping | 2 | +273/-437 | 13 |
73+
| Frrist | 3 | +455/-6 | 7 |
74+
| davidad (David A. Dalrymple) | 3 | +245/-46 | 5 |
75+
| Jeromy | 2 | +166/-4 | 4 |
76+
| laser | 4 | +110/-48 | 6 |
77+
| Erin Swenson-Healey | 3 | +50/-30 | 5 |
78+
| ZX | 1 | +48/-20 | 5 |
79+
| nemo | 1 | +4/-56 | 2 |
80+
81+
## 0.26.0
82+
83+
This release migrates from v25 to v26 Groth parameters, which allows us to use
84+
64GiB sectors. It also adds some safety to the CGO bindings, which were
85+
previously sharing Go memory with C, resulting in some errors when running with
86+
`cgocheck=2`.
87+
88+
### Changelog
89+
90+
- github.com/filecoin-project/filecoin-ffi:
91+
- update to v26 Groth parameters (#83) ([filecoin-project/filecoin-ffi#83](https://github.com/filecoin-project/filecoin-ffi/pull/83))
92+
- handle allocations for problematic structs to avoid sharing pointers-to-pointers with C (from Go) (#82) ([filecoin-project/filecoin-ffi#82](https://github.com/filecoin-project/filecoin-ffi/pull/82))
93+
94+
### Contributors
95+
96+
| Contributor | Commits | Lines ± | Files Changed |
97+
|-------------|---------|---------|---------------|
98+
| Erin Swenson-Healey | 2 | +514/-375 | 15 |

Diff for: README.md

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ and committed to Git. To generate bindings yourself, install the c-for-go
5555
binary, ensure that it's on your path, and then run `make cgo-gen`. CI builds
5656
will fail if generated CGO diverges from what's checked into Git.
5757

58+
## Updating the Changelog
59+
60+
The `mkreleaselog` script (in the project root) can be used to generate a good
61+
portion of the filecoin-ffi changelog. For historical reasons, the script must
62+
be run from the root of a filecoin-ffi checkout which is in your `$GOPATH`.
63+
64+
Run it like so:
65+
66+
```shell
67+
./mkreleaselog v0.25.0 v0.26.0 > /tmp/v0.26.0.notes.txt
68+
```
69+
5870
## License
5971

6072
MIT or Apache 2.0

Diff for: mkreleaselog

+240
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
#!/bin/zsh
2+
3+
# Note: This script is a modified version of the mkreleaselog script used by
4+
# the go-ipfs team.
5+
#
6+
# Usage: ./mkreleaselog v0.25.0 v0.26.0 > /tmp/release.log
7+
8+
set -euo pipefail
9+
export GO111MODULE=on
10+
export GOPATH="$(go env GOPATH)"
11+
12+
alias jq="jq --unbuffered"
13+
14+
REPO_SUFFIXES_TO_STRIP=(
15+
"/v2"
16+
"/v3"
17+
"/v4"
18+
"/v5"
19+
"/v6"
20+
)
21+
22+
AUTHORS=(
23+
# orgs
24+
filecoin-project
25+
26+
# Authors of personal repos used by filecoin-ffi that should be mentioned in the
27+
# release notes.
28+
xlab
29+
)
30+
31+
[[ -n "${REPO_FILTER+x}" ]] || REPO_FILTER="github.com/(${$(printf "|%s" "${AUTHORS[@]}"):1})"
32+
33+
[[ -n "${IGNORED_FILES+x}" ]] || IGNORED_FILES='^\(\.gx\|package\.json\|\.travis\.yml\|go.mod\|go\.sum|\.github|\.circleci\)$'
34+
35+
NL=$'\n'
36+
37+
msg() {
38+
echo "$*" >&2
39+
}
40+
41+
statlog() {
42+
rpath="$GOPATH/src/$1"
43+
for s in $REPO_SUFFIXES_TO_STRIP; do
44+
rpath=${rpath%$s}
45+
done
46+
47+
start="${2:-}"
48+
end="${3:-HEAD}"
49+
50+
git -C "$rpath" log --shortstat --no-merges --pretty="tformat:%H%n%aN%n%aE" "$start..$end" | while
51+
read hash
52+
read name
53+
read email
54+
read _ # empty line
55+
read changes
56+
do
57+
changed=0
58+
insertions=0
59+
deletions=0
60+
while read count event; do
61+
if [[ "$event" =~ ^file ]]; then
62+
changed=$count
63+
elif [[ "$event" =~ ^insertion ]]; then
64+
insertions=$count
65+
elif [[ "$event" =~ ^deletion ]]; then
66+
deletions=$count
67+
else
68+
echo "unknown event $event" >&2
69+
exit 1
70+
fi
71+
done<<<"${changes//,/$NL}"
72+
73+
jq -n \
74+
--arg "hash" "$hash" \
75+
--arg "name" "$name" \
76+
--arg "email" "$email" \
77+
--argjson "changed" "$changed" \
78+
--argjson "insertions" "$insertions" \
79+
--argjson "deletions" "$deletions" \
80+
'{Commit: $hash, Author: $name, Email: $email, Files: $changed, Insertions: $insertions, Deletions: $deletions}'
81+
done
82+
}
83+
84+
# Returns a stream of deps changed between $1 and $2.
85+
dep_changes() {
86+
{
87+
<"$1"
88+
<"$2"
89+
} | jq -s 'JOIN(INDEX(.[0][]; .Path); .[1][]; .Path; {Path: .[0].Path, Old: (.[1] | del(.Path)), New: (.[0] | del(.Path))}) | select(.New.Version != .Old.Version)'
90+
}
91+
92+
# resolve_commits resolves a git ref for each version.
93+
resolve_commits() {
94+
jq '. + {Ref: (.Version|capture("^((?<ref1>.*)\\+incompatible|v.*-(0\\.)?[0-9]{14}-(?<ref2>[a-f0-9]{12})|(?<ref3>v.*))$") | .ref1 // .ref2 // .ref3)}'
95+
}
96+
97+
pr_link() {
98+
local repo="$1"
99+
local prnum="$2"
100+
local ghname="${repo##github.com/}"
101+
printf -- "[%s#%s](https://%s/pull/%s)" "$ghname" "$prnum" "$repo" "$prnum"
102+
}
103+
104+
# Generate a release log for a range of commits in a single repo.
105+
release_log() {
106+
setopt local_options BASH_REMATCH
107+
108+
local repo="$1"
109+
local start="$2"
110+
local end="${3:-HEAD}"
111+
local dir="$GOPATH/src/$repo"
112+
113+
local commit pr
114+
git -C "$dir" log \
115+
--format='tformat:%H %s' \
116+
--first-parent \
117+
"$start..$end" |
118+
while read commit subject; do
119+
# Skip gx-only PRs.
120+
git -C "$dir" diff-tree --no-commit-id --name-only "$commit^" "$commit" |
121+
grep -v "${IGNORED_FILES}" >/dev/null || continue
122+
123+
if [[ "$subject" =~ '^Merge pull request #([0-9]+) from' ]]; then
124+
local prnum="${BASH_REMATCH[2]}"
125+
local desc="$(git -C "$dir" show --summary --format='tformat:%b' "$commit" | head -1)"
126+
printf -- "- %s (%s)\n" "$desc" "$(pr_link "$repo" "$prnum")"
127+
elif [[ "$subject" =~ '\(#([0-9]+)\)$' ]]; then
128+
local prnum="${BASH_REMATCH[2]}"
129+
printf -- "- %s (%s)\n" "$subject" "$(pr_link "$repo" "$prnum")"
130+
else
131+
printf -- "- %s\n" "$subject"
132+
fi
133+
done
134+
}
135+
136+
indent() {
137+
sed -e 's/^/ /'
138+
}
139+
140+
mod_deps() {
141+
go list -json -m all | jq 'select(.Version != null)'
142+
}
143+
144+
ensure() {
145+
local repo="$1"
146+
for s in $REPO_SUFFIXES_TO_STRIP; do
147+
repo=${repo%$s}
148+
done
149+
150+
local commit="$2"
151+
152+
local rpath="$GOPATH/src/$repo"
153+
if [[ ! -d "$rpath" ]]; then
154+
msg "Cloning $repo..."
155+
git clone "http://$repo" "$rpath" >&2
156+
fi
157+
158+
if ! git -C "$rpath" rev-parse --verify "$commit" >/dev/null; then
159+
msg "Fetching $repo..."
160+
git -C "$rpath" fetch --all >&2
161+
fi
162+
163+
git -C "$rpath" rev-parse --verify "$commit" >/dev/null || return 1
164+
}
165+
166+
statsummary() {
167+
jq -s 'group_by(.Author)[] | {Author: .[0].Author, Commits: (. | length), Insertions: (map(.Insertions) | add), Deletions: (map(.Deletions) | add), Files: (map(.Files) | add)}' |
168+
jq '. + {Lines: (.Deletions + .Insertions)}'
169+
}
170+
171+
recursive_release_log() {
172+
local start="${1:-$(git tag -l | sort -V | grep -v -- '-rc' | grep 'v'| tail -n1)}"
173+
local end="${2:-$(git rev-parse HEAD)}"
174+
local repo_root="$(git rev-parse --show-toplevel)"
175+
local package="$(cd "$repo_root" && go list)"
176+
177+
if ! [[ "${GOPATH}/${package}" != "${repo_root}" ]]; then
178+
echo "This script requires the target package and all dependencies to live in a GOPATH."
179+
return 1
180+
fi
181+
182+
(
183+
local result=0
184+
local workspace="$(mktemp -d)"
185+
trap "$(printf 'rm -rf "%q"' "$workspace")" INT TERM EXIT
186+
cd "$workspace"
187+
188+
echo "Computing old deps..." >&2
189+
git -C "$repo_root" show "$start:go.mod" >go.mod
190+
mod_deps | resolve_commits | jq -s > old_deps.json
191+
192+
echo "Computing new deps..." >&2
193+
git -C "$repo_root" show "$end:go.mod" >go.mod
194+
mod_deps | resolve_commits | jq -s > new_deps.json
195+
196+
rm -f go.mod go.sum
197+
198+
printf -- "Generating Changelog for %s %s..%s\n" "$package" "$start" "$end" >&2
199+
200+
printf -- "- %s:\n" "$package"
201+
release_log "$package" "$start" "$end" | indent
202+
203+
statlog "$package" "$start" "$end" > statlog.json
204+
205+
dep_changes old_deps.json new_deps.json |
206+
jq --arg filter "$REPO_FILTER" 'select(.Path | match($filter))' |
207+
# Compute changelogs
208+
jq -r '"\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // "")"' |
209+
while read repo new new_ref old old_ref; do
210+
for s in $REPO_SUFFIXES_TO_STRIP; do
211+
repo=${repo%$s}
212+
done
213+
214+
if ! ensure "$repo" "$new_ref"; then
215+
result=1
216+
local changelog="failed to fetch repo"
217+
else
218+
statlog "$repo" "$old_ref" "$new_ref" >> statlog.json
219+
local changelog="$(release_log "$repo" "$old_ref" "$new_ref")"
220+
fi
221+
if [[ -n "$changelog" ]]; then
222+
printf -- "- %s (%s -> %s):\n" "$repo" "$old" "$new"
223+
echo "$changelog" | indent
224+
fi
225+
done
226+
227+
echo
228+
echo "Contributors"
229+
echo
230+
231+
echo "| Contributor | Commits | Lines ± | Files Changed |"
232+
echo "|-------------|---------|---------|---------------|"
233+
statsummary <statlog.json |
234+
jq -s 'sort_by(.Lines) | reverse | .[]' |
235+
jq -r '"| \(.Author) | \(.Commits) | +\(.Insertions)/-\(.Deletions) | \(.Files) |"'
236+
return "$status"
237+
)
238+
}
239+
240+
recursive_release_log "$@"

0 commit comments

Comments
 (0)