Skip to content

Commit

Permalink
Merge branch 'main' into ed25519-support
Browse files Browse the repository at this point in the history
Merged because some integration-test parameters,
like CouchDB version, were outdated. I took the
opportunity to resolve some conflicts with main.

Signed-off-by: Johann Westphall <johannwestphall@gmail.com>
  • Loading branch information
johannww committed Nov 25, 2022
2 parents 272fa3e + dd63f08 commit ff4eb12
Show file tree
Hide file tree
Showing 1,798 changed files with 124,736 additions and 151,721 deletions.
103 changes: 103 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: Release
on:
workflow_dispatch:
inputs:
release:
description: 'Fabric Release, e.g. 2.4.7'
required: true
type: string
two_digit_release:
description: 'Fabric Two Digit Release, e.g. 2.4'
required: true
type: string
commit_hash:
description: 'Commit hash, e.g. df9c661a192f8cf11376d9d643a0021f1a76c34b'
required: true
type: string

env:
GO_VER: 1.18.7

permissions:
contents: read

jobs:
build-binaries:
name: Build Fabric Binaries
strategy:
matrix:
include:
- image: ubuntu-20.04
target: linux
arch: amd64
- image: macos-11
target: darwin
arch: amd64
- image: windows-2022
target: windows
arch: amd64
runs-on: ubuntu-20.04
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VER }}
- name: Checkout Fabric Code
uses: actions/checkout@v3
- name: Compile Binary and Create Tarball
run: ./ci/scripts/create_binary_package.sh
env:
TARGET: ${{ matrix.target }}-${{ matrix.arch }}
RELEASE: ${{ inputs.release }}
- name: Publish Release Artifact
uses: actions/upload-artifact@v3
with:
name: hyperledger-fabric-${{ matrix.target }}-${{ matrix.arch }}-${{ inputs.release }}.tar.gz
path: release/${{ matrix.target }}-${{ matrix.arch }}/hyperledger-fabric-${{ matrix.target }}-${{ matrix.arch }}-${{ inputs.release }}.tar.gz
build-and-push-docker-images:
name: Build and Push Fabric Docker Images
runs-on: ubuntu-20.04
steps:
- name: Run APT Clean
run: sudo apt clean
- name: Run Apt Update
run: sudo apt update
- name: Install Dependencies
run: sudo apt install -y gcc haveged libtool make
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VER }}
- name: Checkout Fabric Code
uses: actions/checkout@v3
- name: Publish Docker Images
run: ./ci/scripts/publish_docker.sh
env:
RELEASE: ${{ inputs.release }}
TWO_DIGIT_RELEASE: ${{ inputs.two_digit_release }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
create-release:
name: Create GitHub Release
needs: [ build-binaries, build-and-push-docker-images ]
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Checkout Fabric Code
uses: actions/checkout@v3
- name: Download Artifacts
id: download
uses: actions/download-artifact@v3
- name: Release Fabric Version
uses: ncipollo/release-action@v1
with:
artifacts: "*.tar.gz/*.tar.gz"
bodyFile: release_notes/v${{ inputs.release }}.md
commit: ${{ inputs.commit_hash }}
tag: v${{ inputs.release }}
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/slash-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ on:
types:
- created
- edited
permissions: {}
jobs:
notify:
permissions:
issues: write # to comment on or close issue

name: Invalid Issue Usage
if: contains(github.event.comment.body, '/invalid') && github.event.issue.state == 'open'
runs-on: ubuntu-latest
Expand All @@ -23,7 +27,7 @@ jobs:
GitHub Issues is a tool for tracking bugs, feature requests, and work in general that relates directly to the Fabric codebase. It is not for general help requests. Please use one of the following forums to request help for your issue:
- RocketChat: https://chat.hyperledger.org
- Discord: https://discord.com/servers/hyperledger-foundation-905194001349627914
- Fabric Mailing List: fabric@lists.hyperledger.org
- name: Close Issue
uses: lindluni/issue-manager@v1.0.0
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/trigger.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: Verify Build
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
workflow_dispatch:

env:
GOPATH: /opt/go
PATH: /opt/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GO_VER: 1.18

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
basic-checks:
name: Basic Checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
with:
fetch-depth: 0
- run: make basic-checks
name: Run Basic Checks
unit-tests:
name: Unit Tests
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make unit-test
name: Run Unit Tests
integration-tests:
name: Integration Tests
needs: basic-checks
strategy:
matrix:
INTEGRATION_TEST_SUITE: ["raft","pvtdata","ledger","lifecycle","e2e","discovery gossip devmode pluggable","gateway idemix pkcs11 configtx configtxlator","sbe nwo msp"]
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="${{matrix.INTEGRATION_TEST_SUITE}}"
name: Run Integration Tests
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,25 @@ Please visit the
[contributors guide](http://hyperledger-fabric.readthedocs.io/en/latest/CONTRIBUTING.html) in the
docs to learn how to make contributions to this exciting project.

## Running Unit tests

An example of using the script as used in the CI pipeline to run Unit Tests

```
TEST_PKGS=github.com/hyperledger/fabric/core/chaincode/... ./scripts/run-unit-tests.sh
```

## Creating the mocks for unit tests

A number of mock implementations of interfaces are used within the unit tests. For historical reasons there are two tools
with the repo to generate these mocks. [mockery](https://github.com/vektra/mockery) and [counterfeiter](https://github.com/maxbrunsfeld/counterfeiter)

- look in the already created mock - the first line will indicate which tool it was created with
- for counterfieter, run `go generate ./<dir>/...` in the <dir> where you want the mocks directory to be created

- for mockery the command is `mockery --name ApplicationCapabilities --dir ~/github.com/hyperledger/fabric/common/channelconfig --filename application_capabilities.go`
- this will create the mock with the filename given in the mocks directory based of the cwd
- the `--name` and `--dir` indicate where the 'source' interface is to be mocked

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
s
6 changes: 3 additions & 3 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ See [the documentation on Maintainers](https://hyperledger-fabric.readthedocs.io
| Name | GitHub | Chat | email
|------|--------|------|----------------------
| Chris Gabriel | [denali49][denali49] | cmgabriel | <alaskadd@gmail.com>
| Joe Alewine | [joealewine][joealewine] | joe-alewine | <joe.alewine@ibm.com>
| Nikhil Gupta | [nikhil550][nikhil550] | nikhilgupta | <nikhilg550@gmail.com>
| Anthony O'Dowd | [odowdaibm][odowdaibm] | odowdaibm | <a_o-dowd@uk.ibm.com>
| Pam Andrejko | [pamandrejko][pamandrejko] | pandrejko | <pama@ibm.com>

**Release Managers**

Expand All @@ -36,6 +33,7 @@ See [the documentation on Maintainers](https://hyperledger-fabric.readthedocs.io

| Name | GitHub | Chat | email
|------|--------|------|----------------------
| Anthony O'Dowd | [odowdaibm][odowdaibm] | odowdaibm | <a_o-dowd@uk.ibm.com>
| Binh Nguyen | [binhn][binhn] | binhn | <binh1010010110@gmail.com>
| Brett Logan | [lindluni][lindluni] | BrettLogan | <development.brett@gmail.com>
| Chris Ferris | [christo4ferris][christo4ferris] | cbf | <chris.ferris@gmail.com>
Expand All @@ -45,10 +43,12 @@ See [the documentation on Maintainers](https://hyperledger-fabric.readthedocs.io
| Greg Haskins | [ghaskins][ghaskins] | ghaskins | <gregory.haskins@gmail.com>
| Jason Yellick | [jyellick][jyellick] | jyellick | <jason-github@unaddressable.org>
| Jim Zhang | [jimthematrix][jimthematrix] | jimthematrix | <jim_the_matrix@hotmail.com>
| Joe Alewine | [joealewine][joealewine] | joe-alewine | <joe.alewine@ibm.com>
| Jonathan Levi | [hacera][hacera] |JonathanLevi | <jonathan@hacera.com>
| Keith Smith | [smithbk][smithbk] | smithbk | <bksmith@us.ibm.com>
| Kostas Christidis | [kchristidis][kchristidis] | kostas | <kostas@gmail.com>
| Matthew Sykes | [sykesm][sykesm] | sykesm | <matthew.sykes@gmail.com>
| Pam Andrejko | [pamandrejko][pamandrejko] | pandrejko | <pama@ibm.com>
| Sheehan Anderson | [srderson][srderson] | sheehan | <sranderson@gmail.com>
| Srinivasan Muralidharan | [muralisrini][muralisrini] | muralisr | <srinivasan.muralidharan99@gmail.com>
| Tamas Blummer | [tamasblummer][tamasblummer] | tamas | <tamas@digitalasset.com>
Expand Down

0 comments on commit ff4eb12

Please sign in to comment.