Skip to content

Commit

Permalink
Merge pull request #8208 from ipfs/release-v0.9.0
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
aschmahmann authored Jun 22, 2021
2 parents ce693d7 + e5b02b3 commit 179d1d1
Show file tree
Hide file tree
Showing 148 changed files with 6,636 additions and 4,948 deletions.
11 changes: 6 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ default_environment: &default_environment
executors:
golang:
docker:
- image: circleci/golang:1.14.4
- image: circleci/golang:1.15.2
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
Expand All @@ -44,13 +44,13 @@ executors:
TEST_VERBOSE: 1
node:
docker:
- image: circleci/node:12
- image: circleci/node:14
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
node-browsers:
docker:
- image: circleci/node:12-browsers
- image: circleci/node:14-browsers
working_directory: ~/ipfs/go-ipfs
environment:
<<: *default_environment
Expand All @@ -60,7 +60,7 @@ executors:
E2E_IPFSD_TYPE: go
dockerizer:
docker:
- image: circleci/golang:1.14.4
- image: circleci/golang:1.15.2
environment:
IMAGE_NAME: ipfs/go-ipfs
WIP_IMAGE_TAG: wip
Expand Down Expand Up @@ -129,7 +129,8 @@ jobs:
GOPATH: /home/circleci/go
TEST_VERBOSE: 1
steps:
- run: sudo apt install socat
- run: sudo apt update
- run: sudo apt install socat net-tools
- checkout

- run:
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
labels:
- "topic/dependencies"
40 changes: 40 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '30 12 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
710 changes: 710 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Note: when updating the go minor version here, also update the go-channel in snap/snapcraft.yml
FROM golang:1.14.4-buster
FROM golang:1.15.2-buster
LABEL maintainer="Steven Allen <[email protected]>"

# Install deps
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# go-ipfs

![banner](https://ipfs.io/ipfs/QmVk7srrwahXLNmcDYvyUEJptyoxpndnRa57YJ11L4jV26/ipfs.go.png)
![banner](https://ipfs.io/ipfs/bafykbzacecaesuqmivkauix25v6i6xxxsvsrtxknhgb5zak3xxsg2nb4dhs2u/ipfs.go.png)

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/room/#ipfs:matrix.org)
Expand Down Expand Up @@ -160,7 +160,7 @@ PS> scoop install go-ipfs

### Build from Source

go-ipfs's build system requires Go 1.14.4 and some standard POSIX build tools:
go-ipfs's build system requires Go 1.15.2 and some standard POSIX build tools:

* GNU make
* Git
Expand All @@ -170,7 +170,7 @@ To build without GCC, build with `CGO_ENABLED=0` (e.g., `make build CGO_ENABLED=

#### Install Go

The build process for ipfs requires Go 1.14.4 or higher. If you don't have it: [Download Go 1.14+](https://golang.org/dl/).
The build process for ipfs requires Go 1.15.2 or higher. If you don't have it: [Download Go 1.15+](https://golang.org/dl/).

You'll need to add Go's bin directories to your `$PATH` environment variable e.g., by adding these lines to your `/etc/profile` (for a system-wide installation) or `$HOME/.profile`:

Expand Down Expand Up @@ -288,29 +288,33 @@ Basic proof of 'ipfs working' locally:
SUBCOMMANDS
BASIC COMMANDS
init Initialize ipfs local configuration
add <path> Add a file to ipfs
cat <ref> Show ipfs object data
get <ref> Download ipfs objects
init Initialize local IPFS configuration
add <path> Add a file to IPFS
cat <ref> Show IPFS object data
get <ref> Download IPFS objects
ls <ref> List links from an object
refs <ref> List hashes of links from an object
DATA STRUCTURE COMMANDS
dag Interact with IPLD DAG nodes
files Interact with files as if they were a unix filesystem
block Interact with raw blocks in the datastore
object Interact with raw dag nodes
files Interact with objects as if they were a unix filesystem
ADVANCED COMMANDS
daemon Start a long-running daemon process
mount Mount an ipfs read-only mount point
mount Mount an IPFS read-only mount point
resolve Resolve any type of name
name Publish or resolve IPNS names
name Publish and resolve IPNS names
key Create and list IPNS name keypairs
dns Resolve DNS links
pin Pin objects to local storage
repo Manipulate an IPFS repository
repo Manipulate the IPFS repository
stats Various operational stats
p2p Libp2p stream mounting
filestore Manage the filestore (experimental)
NETWORK COMMANDS
id Show info about ipfs peers
id Show info about IPFS peers
bootstrap Add or remove bootstrap peers
swarm Manage connections to the p2p network
dht Query the DHT for values or peers
Expand All @@ -319,9 +323,11 @@ SUBCOMMANDS
TOOL COMMANDS
config Manage configuration
version Show ipfs version information
version Show IPFS version information
update Download and apply go-ipfs updates
commands List all available commands
cid Convert and discover properties of CIDs
log Manage and show logs of running daemon
Use 'ipfs <command> --help' to learn more about each command.
Expand Down
4 changes: 2 additions & 2 deletions assets/assets.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//go:generate git submodule update --init ./dir-index-html
//go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt
//go:generate gofmt -w bindata.go
//go:generate gofmt -s -w bindata.go
//go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go"
//go:generate gofmt -w bindata_version_hash.go
//go:generate gofmt -s -w bindata_version_hash.go
package assets

import (
Expand Down
22 changes: 11 additions & 11 deletions assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions bin/check_version
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ check_at_least_version() {
# We expect a version to be of form X.X.X
# if the second dot doesn't match, we consider it a prerelease

if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9]\+\)"); then
if MIN_MIN=$(expr "$MIN_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
# this captured digit is necessary, since expr returns code 1 if the output is empty
if expr "$MIN_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
MIN_PRERELEASE="0"
else
MIN_PRERELEASE="1"
fi
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || MIN_FIX="0"
MIN_FIX=$(expr "$MIN_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || MIN_FIX="0"
else
MIN_MIN="0"
MIN_PRERELEASE="0"
MIN_FIX="0"
fi
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9]\+\)"); then
if CUR_MIN=$(expr "$CUR_VERS" : "[^.]*\.\([0-9][0-9]*\)"); then
# this captured digit is necessary, since expr returns code 1 if the output is empty
if expr "$CUR_VERS" : "[^.]*\.[0-9]*\([0-9]\.\|[0-9]\$\)" >/dev/null; then
CUR_PRERELEASE="0"
else
CUR_PRERELEASE="1"
fi
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9]\+[^0-9]\+\([0-9]\+\)") || CUR_FIX="0"
CUR_FIX=$(expr "$CUR_VERS" : "[^.]*\.[0-9][0-9]*[^0-9][^0-9]*\([0-9][0-9]*\)") || CUR_FIX="0"
else
CUR_MIN="0"
CUR_PRERELEASE="0"
Expand Down
43 changes: 27 additions & 16 deletions bin/mkreleaselog
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ msg() {
}

statlog() {
local rpath="$GOPATH/src/$1"
local module="$1"
local rpath="$GOPATH/src/$(strip_version "$module")"
local start="${2:-}"
local end="${3:-HEAD}"
local mailmap_file="$rpath/.mailmap"
Expand Down Expand Up @@ -106,9 +107,10 @@ pr_link() {
release_log() {
setopt local_options BASH_REMATCH

local repo="$1"
local module="$1"
local start="$2"
local end="${3:-HEAD}"
local repo="$(strip_version "$1")"
local dir="$GOPATH/src/$repo"

local commit pr
Expand Down Expand Up @@ -139,11 +141,11 @@ indent() {
}

mod_deps() {
go list -json -m all | jq 'select(.Version != null)'
go list -mod=mod -json -m all | jq 'select(.Version != null)'
}

ensure() {
local repo="$1"
local repo="$(strip_version "$1")"
local commit="$2"
local rpath="$GOPATH/src/$repo"
if [[ ! -d "$rpath" ]]; then
Expand All @@ -164,14 +166,23 @@ statsummary() {
jq '. + {Lines: (.Deletions + .Insertions)}'
}

strip_version() {
local repo="$1"
if [[ "$repo" =~ '.*/v[0-9]+$' ]]; then
repo="$(dirname "$repo")"
fi
echo "$repo"
}

recursive_release_log() {
local start="${1:-$(git tag -l | sort -V | grep -v -- '-rc' | grep 'v'| tail -n1)}"
local end="${2:-$(git rev-parse HEAD)}"
local repo_root="$(git rev-parse --show-toplevel)"
local package="$(cd "$repo_root" && go list)"
local module="$(go list -m)"
local dir="$(go list -m -f '{{.Dir}}')"

if ! [[ "${GOPATH}/${package}" != "${repo_root}" ]]; then
echo "This script requires the target package and all dependencies to live in a GOPATH."
if [[ "${GOPATH}/${module}" -ef "${dir}" ]]; then
echo "This script requires the target module and all dependencies to live in a GOPATH."
return 1
fi

Expand All @@ -191,28 +202,28 @@ recursive_release_log() {

rm -f go.mod go.sum

printf -- "Generating Changelog for %s %s..%s\n" "$package" "$start" "$end" >&2
printf -- "Generating Changelog for %s %s..%s\n" "$module" "$start" "$end" >&2

printf -- "- %s:\n" "$package"
release_log "$package" "$start" "$end" | indent
printf -- "- %s:\n" "$module"
release_log "$module" "$start" "$end" | indent


statlog "$package" "$start" "$end" > statlog.json
statlog "$module" "$start" "$end" > statlog.json

dep_changes old_deps.json new_deps.json |
jq --arg filter "$REPO_FILTER" 'select(.Path | match($filter))' |
# Compute changelogs
jq -r '"\(.Path) \(.New.Version) \(.New.Ref) \(.Old.Version) \(.Old.Ref // "")"' |
while read repo new new_ref old old_ref; do
if ! ensure "$repo" "$new_ref"; then
while read module new new_ref old old_ref; do
if ! ensure "$module" "$new_ref"; then
result=1
local changelog="failed to fetch repo"
else
statlog "$repo" "$old_ref" "$new_ref" >> statlog.json
local changelog="$(release_log "$repo" "$old_ref" "$new_ref")"
statlog "$module" "$old_ref" "$new_ref" >> statlog.json
local changelog="$(release_log "$module" "$old_ref" "$new_ref")"
fi
if [[ -n "$changelog" ]]; then
printf -- "- %s (%s -> %s):\n" "$repo" "$old" "$new"
printf -- "- %s (%s -> %s):\n" "$module" "$old" "$new"
echo "$changelog" | indent
fi
done
Expand Down
8 changes: 6 additions & 2 deletions bin/push-docker-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# A bit like dockerhub autobuild config, but somewhere we can version control it.
#
# The `docker-build` job in .circleci/config.yml builds the current commit
# in docker and tags it as ipfs/go-ipfs:wip
# in docker and tags it as ipfs/go-ipfs:wip
#
# Then the `docker-publish` job runs this script to decide what tag, if any,
# to publish to dockerhub.
Expand Down Expand Up @@ -59,9 +59,13 @@ pushTag () {
fi
}

if [[ $GIT_TAG =~ ^v[0-9]+ ]]; then
if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then
pushTag "$GIT_TAG"

elif [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
pushTag "$GIT_TAG"
pushTag "latest"
pushTag "release" # see: https://github.com/ipfs/go-ipfs/issues/3999#issuecomment-742228981

elif [ "$GIT_BRANCH" = "feat/stabilize-dht" ]; then
pushTag "bifrost-${BUILD_NUM}-${GIT_SHA1_SHORT}"
Expand Down
2 changes: 1 addition & 1 deletion bin/test-go-fmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ T="$(mktemp)"
find . \
-path ./test/sharness -prune \
-o -path ./plugin/loader/preload.go -prune \
-o -name '*.go' -print0 | xargs -0 gofmt -l > "$T"
-o -name '*.go' -print0 | xargs -0 gofmt -s -l > "$T"

if [ -n "$(cat $T)" ]; then
echo "Following Go code is not formatted."
Expand Down
Loading

0 comments on commit 179d1d1

Please sign in to comment.