Skip to content

Commit

Permalink
Merge remote-tracking branch 'pokt/main' into feat/session-manager-im…
Browse files Browse the repository at this point in the history
…plementation

* pokt/main: (28 commits)
  [Miner] feat: add supplier client (#42)
  [Off-chain] refactor: keyring errors & helpers (#131)
  [Miner] feat: add `TxClient` (#94)
  [CI] Build container images (#107)
  fix: flaky block client test (#132)
  [Tooling] add `go_lint` & `go_imports` make targets & CI step (#129)
  Update README.md
  [Code Health] Support `godoc` by replacing the `pocket `module name with `github.com/pokt-network/poktroll` (#128)
  [Miner] feat: add `TxContext` (#118)
  [Testing] fix: flaky tests in observable & client pkgs (#124)
  Added first roadmap change
  [AppGate] Implement UndelegateFromGateway with Extensive Tests (#125)
  [Miner] feat: add block client (#65)
  [Supplier] Add `ServiceConfigs` to `SupplierStaking` (#114)
  [AppGate] Add the MaxDelegatedGateways parameter (#109)
  [Test] Temporarily skip a flaky test `TestEventsQueryClient_Subscribe_Succeeds` (#121)
  [AppGate] Implement DelegateToGateway and add Tests (#90)
  [E2E] Add (Un)Stake Tests (#88)
  refactor: add `either.Bytes` alias (#117)
  feat: add either.AsyncErr type & helpers (#115)
  ...
  • Loading branch information
bryanchriswhite committed Nov 7, 2023
2 parents f770d5a + 5b3fd95 commit 7e563e6
Show file tree
Hide file tree
Showing 331 changed files with 9,058 additions and 1,618 deletions.
35 changes: 35 additions & 0 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# When `devnet-e2e-test` is added, also assign `devnet` to the PR.
devnet-e2e-test:
prs:
comment: The CI will now also run the e2e tests on devnet, which increases the time it takes to complete all CI checks.
label:
- devnet

# When `devnet-e2e-test` is removed, also delete `devnet` from the PR.
-devnet-e2e-test:
prs:
unlabel:
- devnet

# When `devnet` is added, also assign `push-image` to the PR.
devnet:
prs:
label:
- push-image

# When `devnet` is removed, also delete `devnet-e2e-test` from the PR.
-devnet:
prs:
unlabel:
- devnet-e2e-test

# Let the developer know that they need to push another commit after attaching the label to PR.
push-image:
prs:
comment: The image is going to be pushed after the next commit. If you want to run an e2e test, it is necessary to push another commit. You can use `make trigger_ci` to push an empty commit.

# When `push-image` is removed, also delete `devnet` from the PR.
-push-image:
prs:
unlabel:
- devnet
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Select one or more:

## Testing

- [ ] **Run all unit tests**: `make go_test`
- [ ] **Run all unit tests**: `make go_develop_and_test`
- [ ] **Verify Localnet manually**: See the instructions [here](TODO: add link to instructions)

## Sanity Checklist
Expand Down
57 changes: 56 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ on:
branches: ["main"]
pull_request:

concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: install ignite
# If this step fails due to ignite.com failing, see #116 for a temporary workaround
run: |
curl https://get.ignite.com/cli! | bash
ignite version
Expand All @@ -35,8 +40,58 @@ jobs:
- name: Generate mocks
run: make go_mockgen

- name: Run golangci-lint
run: make go_lint

- name: Build
run: ignite chain build --debug --skip-proto
run: ignite chain build -v --debug --skip-proto

- name: Test
run: make go_test

- name: Set up Docker Buildx
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image'))
uses: docker/setup-buildx-action@v3

- name: Docker Metadata action
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image'))
id: meta
uses: docker/metadata-action@v5
env:
DOCKER_METADATA_PR_HEAD_SHA: "true"
with:
images: |
ghcr.io/pokt-network/pocketd
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=sha,format=long
- name: Login to GitHub Container Registry
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image'))
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Copy binary to inside of the Docker context
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image'))
run: |
mkdir -p ./bin # Make sure the bin directory exists
cp $(go env GOPATH)/bin/poktrolld ./bin # Copy the binary to the repo's bin directory
- name: Build and push Docker image
if: (github.ref == 'refs/heads/main') || (contains(github.event.pull_request.labels.*.name, 'push-image'))
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# NB: Uncomment below if arm64 build is needed; arm64 builds are off by default because build times are significant.
platforms: linux/amd64 #,linux/arm64
file: Dockerfile.dev
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
21 changes: 21 additions & 0 deletions .github/workflows/label-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Label Actions'

on:
issues:
types: [labeled, unlabeled]
pull_request_target:
types: [labeled, unlabeled]
discussion:
types: [labeled, unlabeled]

permissions:
contents: read
issues: write
pull-requests: write
discussions: write

jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v3
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ go.work

# Don't commit binaries
bin
!bin/.keep

# Before we provision the localnet, `ignite` creates the accounts, genesis, etc. for us
# As many of the files are dynamic, we only preserve the config files in git history.
Expand Down Expand Up @@ -57,4 +56,7 @@ ts-client/
**/*_mock.go

# Localnet config
localnet_config.yaml
localnet_config.yaml

# Relase artifacts produced by `ignite chain build --release`
release
56 changes: 56 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
linters-settings:
govet:
check-shadowing: true

# TODO_TECHDEBT: Enable each linter listed, 1 by 1, fixing issues as they appear.
# Don't forget to delete the `disable-all: true` line as well.
linters:
disable-all: true
enable:
# - govet
# - revive
# - errcheck
# - unused
- goimports

issues:
exclude-use-default: true
max-issues-per-linter: 0
max-same-issues: 0
# TODO_CONSIDERATION/TODO_TECHDEBT: Perhaps we should prefer enforcing the best
# practices suggested by the linters over convention or the default in generated
# code (where possible). The more exceptions we have, the bigger the gaps will be
# in our linting coverage. We could eliminate or reduce these exceptions step-
# by-step.
exclude-rules:
# Exclude cosmos-sdk module genesis.go files as they are generated with an
# empty import block containing a comment used by ignite CLI.
- path: ^x/.+/genesis\.go$
linters:
- goimports
# Exclude cosmos-sdk module module.go files as they are generated with unused
# parameters and unchecked errors.
- path: ^x/.+/module\.go$
linters:
- revive
- errcheck
# Exclude cosmos-sdk module tx.go files as they are generated with unused
# constants.
- path: ^x/.+/cli/tx\.go$
linters:
- unused
# Exclude simulation code as it's generated with lots of unused parameters.
- path: .*/simulation/.*|_simulation\.go$
linters:
- revive
# Exclude cosmos-sdk module codec files as they are scaffolded with a unused
# paramerters and a comment used by ignite CLI.
- path: ^x/.+/codec.go$
linters:
- revive
- path: _test\.go$
linters:
- errcheck
# TODO_IMPROVE: see https://golangci-lint.run/usage/configuration/#issues-configuration
#new: true,
#fix: true,
23 changes: 23 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This Dockerfile is used to build container image for development purposes.
# It intentionally contains no security features, ships with code and troubleshooting tools.

FROM golang:1.20 as base

RUN apt update && \
apt-get install -y \
ca-certificates \
curl jq make

# enable faster module downloading.
ENV GOPROXY https://proxy.golang.org

COPY . /poktroll

WORKDIR /poktroll

RUN mv /poktroll/bin/poktrolld /usr/bin/poktrolld

EXPOSE 8545
EXPOSE 8546

ENTRYPOINT ["ignite"]
Loading

0 comments on commit 7e563e6

Please sign in to comment.