Skip to content

Commit b0b7f99

Browse files
committed
Merge branch 'master' of github.com:ozkanonur/rust-libp2p into gossipsub-wasm
2 parents 399b02c + 8c0c9cc commit b0b7f99

File tree

109 files changed

+4641
-629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+4641
-629
lines changed

.github/mergify.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ defaults:
44
method: squash
55
commit_message_template: |
66
{{ title }}
7-
7+
88
{{ body | get_section("## Description", "") }}
9-
9+
1010
Pull-Request: #{{ number }}.
11-
{# Here comes some fancy Jinja2 stuff for correctly attributing co-authorship: #}
12-
{% for commit in (commits | unique(False, 'email_author')) | rejectattr("author", "==", author) %}
13-
{% if commit.parents|length == 1 %}
14-
Co-Authored-By: {{ commit.author }} <{{ commit.email_author }}>
15-
{% endif %}
16-
{% endfor %}
17-
{# GitHub requires that the `Co-authored-by` lines are AT THE VERY END of a commit, hence nothing must come after this. #}
11+
12+
{{ body | get_section("## Attributions", "") }}
1813
1914
pull_request_rules:
2015
- name: Ask to resolve conflict
@@ -38,6 +33,14 @@ pull_request_rules:
3833
actions:
3934
queue:
4035

36+
- name: Add approved dependabot PRs to merge queue
37+
conditions:
38+
# All branch protection rules are implicit: https://docs.mergify.com/conditions/#about-branch-protection
39+
- author=dependabot[bot]
40+
- base=master
41+
actions:
42+
queue:
43+
4144
- name: Remove reviews on updates after PR is queued for merging
4245
conditions:
4346
- base=master
@@ -57,6 +60,15 @@ pull_request_rules:
5760
actions:
5861
review:
5962

63+
- name: Approve dependabot PRs of semver-compatible updates
64+
conditions:
65+
- author=dependabot[bot]
66+
- or:
67+
- title~=bump [^\s]+ from ([1-9]+)\..+ to \1\. # For major >= 1 versions, only approve updates with the same major version.
68+
- title~=bump [^\s]+ from 0\.([\d]+)\..+ to 0\.\1\. # For major == 0 versions, only approve updates with the same minor version.
69+
actions:
70+
review:
71+
6072
queue_rules:
6173
- name: default
6274
conditions: []

.github/workflows/cache-factory.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: dtolnay/rust-toolchain@stable
2424

25-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
25+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
2626
with:
2727
shared-key: stable-cache
2828

.github/workflows/ci.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- uses: dtolnay/rust-toolchain@stable
3939

40-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
40+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
4141
with:
4242
shared-key: stable-cache
4343
save-if: false
@@ -76,12 +76,41 @@ jobs:
7676
run: |
7777
PACKAGE_VERSION=$(cargo metadata --format-version=1 --no-deps | jq -e -r '.packages[] | select(.name == "'"$CRATE"'") | .version')
7878
SPECIFIED_VERSION=$(tomlq "workspace.dependencies.$CRATE.version" --file ./Cargo.toml)
79-
79+
8080
echo "Package version: $PACKAGE_VERSION";
8181
echo "Specified version: $SPECIFIED_VERSION";
8282
8383
test "$PACKAGE_VERSION" = "$SPECIFIED_VERSION"
8484
85+
wasm_tests:
86+
name: Run all WASM tests
87+
runs-on: ubuntu-latest
88+
env:
89+
CHROMEDRIVER_VERSION: '114.0.5735.90'
90+
steps:
91+
- uses: actions/checkout@v3
92+
93+
- uses: dtolnay/rust-toolchain@stable
94+
with:
95+
target: wasm32-unknown-unknown
96+
97+
- uses: taiki-e/cache-cargo-install-action@v1
98+
with:
99+
100+
101+
- name: Install Google Chrome
102+
run: |
103+
curl -o /tmp/google-chrome-stable_amd64.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROMEDRIVER_VERSION}-1_amd64.deb
104+
sudo dpkg -i /tmp/google-chrome-stable_amd64.deb
105+
106+
- name: Install chromedriver
107+
uses: nanasess/setup-chromedriver@v2
108+
with:
109+
chromedriver-version: ${{ env.CHROMEDRIVER_VERSION }}
110+
111+
- name: Run all tests
112+
run: ./wasm-tests/run-all.sh
113+
85114
cross:
86115
name: Compile on ${{ matrix.target }}
87116
strategy:
@@ -107,7 +136,7 @@ jobs:
107136

108137
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
109138

110-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
139+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
111140
with:
112141
key: ${{ matrix.target }}
113142
save-if: ${{ github.ref == 'refs/heads/master' }}
@@ -132,7 +161,7 @@ jobs:
132161

133162
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
134163

135-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
164+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
136165
with:
137166
save-if: ${{ github.ref == 'refs/heads/master' }}
138167

@@ -153,7 +182,7 @@ jobs:
153182

154183
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
155184

156-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
185+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
157186
with:
158187
key: ${{ matrix.features }}
159188
save-if: ${{ github.ref == 'refs/heads/master' }}
@@ -170,7 +199,7 @@ jobs:
170199

171200
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
172201

173-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
202+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
174203
with:
175204
save-if: ${{ github.ref == 'refs/heads/master' }}
176205

@@ -196,7 +225,7 @@ jobs:
196225

197226
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
198227

199-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
228+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
200229
with:
201230
save-if: ${{ github.ref == 'refs/heads/master' }}
202231

@@ -213,7 +242,7 @@ jobs:
213242

214243
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
215244

216-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
245+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
217246
with:
218247
save-if: ${{ github.ref == 'refs/heads/master' }}
219248

@@ -229,7 +258,7 @@ jobs:
229258

230259
- uses: r7kamura/rust-problem-matchers@d58b70c4a13c4866d96436315da451d8106f8f08 #v1.3.0
231260

232-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
261+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
233262
with:
234263
shared-key: stable-cache
235264
save-if: false
@@ -284,6 +313,8 @@ jobs:
284313
steps:
285314
- uses: actions/checkout@v3
286315

316+
- uses: dtolnay/rust-toolchain@stable
317+
287318
- id: cargo-metadata
288319
run: |
289320
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | map(select(.publish == null) | .name)')
@@ -295,7 +326,7 @@ jobs:
295326
steps:
296327
- uses: actions/checkout@v3
297328

298-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
329+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
299330

300331
- run: cargo install --version 0.10.0 pb-rs --locked
301332

@@ -321,5 +352,5 @@ jobs:
321352
runs-on: ubuntu-latest
322353
steps:
323354
- uses: actions/checkout@v3
324-
- uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
355+
- uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
325356
- run: cargo metadata --locked --format-version=1 > /dev/null

.github/workflows/interop-test.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ concurrency:
1212
jobs:
1313
run-multidim-interop:
1414
name: Run multidimensional interoperability tests
15-
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "xlarge"]' || '"ubuntu-latest"') }}
15+
runs-on: ${{ fromJSON(github.repository == 'libp2p/rust-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
16+
strategy:
17+
matrix:
18+
flavour: [chromium, native]
1619
steps:
1720
- uses: actions/checkout@v3
1821
- uses: docker/setup-buildx-action@v2
19-
- name: Build image
20-
run: docker buildx build --load -t rust-libp2p-head . -f interop-tests/Dockerfile
21-
- uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
22+
- name: Build ${{ matrix.flavour }} image
23+
run: docker buildx build --load -t ${{ matrix.flavour }}-rust-libp2p-head . -f interop-tests/Dockerfile.${{ matrix.flavour }}
24+
- name: Run ${{ matrix.flavour }} tests
25+
uses: libp2p/test-plans/.github/actions/run-interop-ping-test@master
2226
with:
23-
test-filter: rust-libp2p-head
24-
extra-versions: ${{ github.workspace }}/interop-tests/ping-version.json
27+
test-filter: ${{ matrix.flavour }}-rust-libp2p-head
28+
extra-versions: ${{ github.workspace }}/interop-tests/${{ matrix.flavour }}-ping-version.json
2529
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
2630
s3-access-key-id: ${{ vars.TEST_PLANS_BUILD_CACHE_KEY_ID }}
2731
s3-secret-access-key: ${{ secrets.TEST_PLANS_BUILD_CACHE_KEY }}
32+
worker-count: 16

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing Guidelines
2+
3+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
4+
[![](https://img.shields.io/badge/project-libp2p-blue.svg?style=flat-square)](https://libp2p.io/)
5+
6+
Welcome to the rust-libp2p contribution guide! We appreciate your interest in improving our library.
7+
8+
## Looking for ways to contribute?
9+
10+
There are several ways you can contribute to rust-libp2p:
11+
- Start contributing immediately via the opened [help wanted](https://github.com/libp2p/rust-libp2p/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) or [difficulty:easy](https://github.com/libp2p/rust-libp2p/issues?q=is%3Aissue+is%3Aopen+label%3Adifficulty%3Aeasy) issues on GitHub.
12+
These issues are suitable for newcomers and provide an excellent starting point.
13+
- Reporting issues, bugs, mistakes, or inconsistencies.
14+
As many open source projects, we are short-staffed, we thus kindly ask you to be open to contribute a fix for discovered issues.
15+
16+
### We squash-merge pull Requests
17+
18+
We always squash merge submitted pull requests.
19+
This means that we discourage force pushes, in order to make the diff between pushes easier for us to review.
20+
Squash merging allows us to maintain a clean and organized commit history.
21+
22+
The PR title, which will become the commit message after the squashing process, should follow [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/).
23+
24+
### Write changelog entries for user-facing changes
25+
26+
When making user-facing changes, it is important to include corresponding entries in the changelog, providing a comprehensive summary for the users.
27+
For detailed instructions on how to write changelog entries, please refer to the documentation in [`docs/release.md`](https://github.com/libp2p/rust-libp2p/blob/master/docs/release.md).
28+
29+
30+
### Merging of PRs is automated
31+
32+
To streamline our workflow, we utilize Mergify and the "send-it" label.
33+
Mergify automates merging actions and helps us manage pull requests more efficiently.
34+
The "send-it" label indicates that a pull request is ready to be merged.
35+
Please refrain from making further commits after the "send-it" label has been applied otherwise your PR will be dequeued from merging automatically.
36+
37+
### Treat CI as a self-service platform
38+
39+
We have a lot of automated CI checks for common errors.
40+
Please treat our CI as a self-service platform and try to fix any issues before requesting a review.

0 commit comments

Comments
 (0)