Skip to content

Commit

Permalink
Merge branch 'main' into fix-all-dht-and-trackerless-hanging-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
teogeb committed Jan 11, 2024
2 parents 7030a8b + ad242b4 commit 23ac374
Show file tree
Hide file tree
Showing 288 changed files with 3,125 additions and 2,827 deletions.
27 changes: 26 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@ module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'eslint-config-streamr-ts'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.jest.json'],
tsconfigRootDir: __dirname,
},
root: true,
env: {
node: true
},
Expand Down Expand Up @@ -62,6 +69,24 @@ module.exports = {
'promise/no-promise-in-callback': ['error'],
//'@typescript-eslint/no-empty-function': 'error',
'no-multi-spaces': ["error", { ignoreEOLComments: true }],
'default-case': ['error']
'default-case': ['error'],
// TODO: in follow up PRs, select which rules we should enable and fix the code. When all recommended rules
// have been enabled, consider enabling the "strict" preset.
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off'
}
}
65 changes: 38 additions & 27 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
---
test:
- '*test*'
ci:
- '.github/*'
- '.github/**/*'
- changed-files:
- any-glob-to-any-file: '.github/*'
- any-glob-to-any-file: '.github/**/*'
docs:
- '**.md'
- '*.md'
- changed-files:
- any-glob-to-any-file: '**.md'
- any-glob-to-any-file: '*.md'
broker:
- 'packages/broker/*'
- 'packages/broker/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/broker/*'
- any-glob-to-any-file: 'packages/broker/**/*'
browser-test-runner:
- 'package/browser-test-runner/*'
- 'package/browser-test-runner/**/*'
- changed-files:
- any-glob-to-any-file: 'package/browser-test-runner/*'
- any-glob-to-any-file: 'package/browser-test-runner/**/*'
network:
- 'packages/trackerless-network/*'
- 'packages/trackerless-network/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/trackerless-network/*'
- any-glob-to-any-file: 'packages/trackerless-network/**/*'
dht:
- 'packages/dht/*'
- 'packages/dht/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/dht/*'
- any-glob-to-any-file: 'packages/dht/**/*'
proto-rpc:
- 'packages/proto-rpc/*'
- 'packages/proto-rpc/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/proto-rpc/*'
- any-glob-to-any-file: 'packages/proto-rpc/**/*'
client:
- 'packages/client/*'
- 'packages/client/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/client/*'
- any-glob-to-any-file: 'packages/client/**/*'
protocol:
- 'packages/protocol/*'
- 'packages/protocol/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/protocol/*'
- any-glob-to-any-file: 'packages/protocol/**/*'
test-utils:
- 'packages/test-utils/*'
- 'packages/test-utils/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/test-utils/*'
- any-glob-to-any-file: 'packages/test-utils/**/*'
utils:
- 'packages/utils/*'
- 'packages/utils/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/utils/*'
- any-glob-to-any-file: 'packages/utils/**/*'
cli-tools:
- 'packages/cli-tools/*'
- 'packages/cli-tools/**/*'
- changed-files:
- any-glob-to-any-file: 'packages/cli-tools/*'
- any-glob-to-any-file: 'packages/cli-tools/**/*'
changelog:
- 'packages/*/CHANGELOG.md'
- changed-files:
- any-glob-to-any-file: 'packages/*/CHANGELOG.md'
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,22 @@ jobs:
- name: Docker meta
id: docker_meta_success
uses: docker/metadata-action@v5.3.0
uses: docker/metadata-action@v5.5.0
if: ${{inputs.push_image}}
with:
images: ${{inputs.image_name}}
flavor: |
latest=false
tags: |
type=match,pattern=broker/(v.*),group=1,value=${{ env.broker_head_tag }}
type=raw,value=dev,enable=${{ inputs.branch == 'main' }}
type=raw,value=dev-tatum,enable=${{ inputs.branch == 'streamr-1.0' }}
type=raw,value=pretestnet,enable=${{ inputs.branch == 'pretestnet' }}
type=raw,value=testnet-one,enable=${{ inputs.branch == 'testnet-one' }}
type=raw,value=dev,enable=${{ inputs.branch == 'brubeck' }}
type=raw,value=dev-tatum,enable=${{ inputs.branch == 'main' }}
type=raw,value=testnet-two,enable=${{ inputs.branch == 'testnet-two' }}
type=raw,value=testnet-three,enable=${{ inputs.branch == 'testnet-three' }}
- name: Build
if: ${{!inputs.push_image}}
uses: docker/build-push-action@v5.0.0
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ${{inputs.docker_file}}
Expand All @@ -112,7 +110,7 @@ jobs:

- name: Build & Push
if: ${{inputs.push_image}}
uses: docker/build-push-action@v5.0.0
uses: docker/build-push-action@v5.1.0
with:
context: .
file: ${{inputs.docker_file}}
Expand All @@ -134,7 +132,7 @@ jobs:

- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-logs-node${{ matrix.node-version }}--${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt}}
path: 'logs'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Label
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
14 changes: 13 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
name: release
on:
workflow_run:
branches: [main, streamr-1.0, pretestnet, testnet-one, testnet-two, testnet-three]
branches: [main, brubeck, testnet-two, testnet-three]
workflows: [validate]
types:
- completed
workflow_dispatch:
jobs:
tracker-docker-image:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'refs/heads/brubeck' }}
uses: ./.github/workflows/docker-build.yml
with:
docker_file: Dockerfile.tracker
image_name: streamr/tracker
build_platforms: linux/amd64
branch: ${{ github.event.workflow_run.head_branch }}
push_image: true
secrets:
dockerhub_username: ${{secrets.DOCKERHUB_USERNAME}}
dockerhub_token: ${{secrets.DOCKERHUB_TOKEN}}
broker-docker-image:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: ./.github/workflows/docker-build.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test Building Documentation

on:
pull_request:
branches: [ main ]
branches: [ main, brubeck ]

jobs:
deploy:
Expand All @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
- uses: actions/checkout@v4
- name: build (cached)
uses: ./.github/workflows/reusable/cached-build
- run: npm run check
working-directory: 'packages/${{ inputs.package }}'
- name: start docker services
if: ${{ inputs.docker-services != '' }}
uses: streamr-dev/streamr-docker-dev-action@v1.0.1
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- brubeck
pull_request:
branches:
- '*'
Expand All @@ -20,9 +21,15 @@ jobs:
- uses: actions/checkout@v4
- name: build
uses: ./.github/workflows/reusable/cached-build
- run: npm run versions
- run: npm run check
lint:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build (cached)
uses: ./.github/workflows/reusable/cached-build
- run: npm run eslint
- run: npm run versions
test-utils:
needs: build
uses: ./.github/workflows/test-setup.yml
Expand Down
17 changes: 17 additions & 0 deletions .idea/dataSources.xml

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

3 changes: 3 additions & 0 deletions .idea/network-monorepo.iml

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

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.10.0
2 changes: 1 addition & 1 deletion Dockerfile.broker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye as build
FROM node:20-bullseye as build
WORKDIR /usr/src/network
COPY . .
RUN --mount=type=cache,target=/root/.npm \
Expand Down
12 changes: 11 additions & 1 deletion internal-docs/index.md → developer-docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Streamr Network Technical Documentation
# Streamr Network Developer Documentation

## Conventions

### Counts

- Functions and methods for getting counts should be named `getFooCount`
- Variables and fields which store counts should be named `fooCount`

Examples:
- `getConnectionCount`, `neighborCount`

## Topics
- [Testing Best Practices](testing-best-practices.md)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 23ac374

Please sign in to comment.