Skip to content

Commit

Permalink
Merge pull request #1 from S-Coyle/update_thierry_ci_pr
Browse files Browse the repository at this point in the history
Update thierry ci pr
  • Loading branch information
Thierry61 committed Jan 20, 2021
2 parents 34273bc + ab9a548 commit 263d4d9
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto_merge_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on: pull_request

jobs:
merge:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ env:

jobs:
update_changelog:
if: ${{ github.repository_owner == 'maidsafe' }}
runs-on: ubuntu-20.04
# Dont run if we're on a release commit
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
if: |
github.repository_owner == 'maidsafe' &&
!startsWith(github.event.head_commit.message, 'chore(release):')
steps:
- uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [pull_request]

jobs:
lint:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ on:

jobs:
release:
if: ${{ github.repository_owner == 'maidsafe' }}
# only if we have a tag
name: Release
runs-on: ubuntu-20.04
if: "startsWith(github.event.head_commit.message, 'chore(release):')"
if: |
github.repository_owner == 'maidsafe' &&
startsWith(github.event.head_commit.message, 'chore(release):')
steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

jobs:
build:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Build
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -35,10 +35,6 @@ jobs:
toolchain: stable
override: true

# Generate Cargo.lock, needed for the cache.
- name: Generate lockfile
run: cargo generate-lockfile

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2
Expand All @@ -57,11 +53,12 @@ jobs:

# Publish if we're on a release commit
publish:
if: ${{ github.repository_owner == 'maidsafe' }}
if: |
github.repository_owner == 'maidsafe' &&
startsWith(github.event.head_commit.message, 'chore(release):')
name: Publish
runs-on: ubuntu-latest
needs: build
if: "startsWith(github.event.head_commit.message, 'chore(release):')"
steps:
- uses: actions/checkout@v2
# checkout with fetch-depth: '0' to be sure to retrieve all commits to look for the semver commit message
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:

jobs:
checks:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Clippy & fmt
runs-on: ubuntu-latest
steps:
Expand All @@ -30,10 +30,6 @@ jobs:
override: true
components: rustfmt, clippy

# Generate Cargo.lock, needed for the cache.
- name: Generate lockfile
run: cargo generate-lockfile

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2
Expand All @@ -53,7 +49,7 @@ jobs:
run: cargo clippy --workspace --all-targets --all-features

coverage:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Code coverage check
runs-on: ubuntu-latest
steps:
Expand All @@ -65,10 +61,6 @@ jobs:
toolchain: stable
override: true

# Generate Cargo.lock, needed for the cache.
- name: Generate Cargo.lock
run: cargo generate-lockfile

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2
Expand Down Expand Up @@ -97,7 +89,7 @@ jobs:
parallel-finished: true

cargo-udeps:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Unused dependency check
runs-on: ubuntu-latest
steps:
Expand All @@ -115,8 +107,20 @@ jobs:
cargo install cargo-udeps --locked
cargo +nightly udeps --all-targets
cargo-deny:
if: github.repository_owner == 'maidsafe'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# wget the shared deny.toml file from the QA repo
- shell: bash
run: wget https://raw.githubusercontent.com/maidsafe/QA/master/misc-scripts/deny.toml

- uses: EmbarkStudios/cargo-deny-action@v1

test:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Test
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -132,10 +136,6 @@ jobs:
toolchain: stable
override: true

# Generate Cargo.lock, needed for the cache.
- name: Generate lockfile
run: cargo generate-lockfile

# Cache.
- name: Cargo cache registry, index and build
uses: actions/cache@v2
Expand All @@ -152,7 +152,7 @@ jobs:

# Test publish using --dry-run.
test-publish:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
name: Test Publish
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
- cron: '0 0 * * *'
jobs:
audit:
if: ${{ github.repository_owner == 'maidsafe' }}
if: github.repository_owner == 'maidsafe'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ env:

jobs:
tag:
if: ${{ github.repository_owner == 'maidsafe' }}
runs-on: ubuntu-latest
# Only run on a release commit
if: "startsWith(github.event.head_commit.message, 'chore(release):')"
if: |
github.repository_owner == 'maidsafe' &&
startsWith(github.event.head_commit.message, 'chore(release):')
steps:
- uses: actions/checkout@v2
with:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.9.10](https://github.com/maidsafe/qp2p/compare/v0.9.9...v0.9.10) (2021-01-20)


### Features

* get peer's cached connection ([1d8f4ab](https://github.com/maidsafe/qp2p/commit/1d8f4abda9bb8b7485a94e0bed7e5f9c4ea76c1e))

### [0.9.9](https://github.com/maidsafe/qp2p/compare/v0.9.8...v0.9.9) (2021-01-14)

### [0.9.8](https://github.com/maidsafe/qp2p/compare/v0.9.7...v0.9.8) (2021-01-13)

### [0.9.7](https://github.com/maidsafe/qp2p/compare/v0.9.6...v0.9.7) (2020-12-29)

### [0.9.6](https://github.com/maidsafe/qp2p/compare/v0.9.5...v0.9.6) (2020-12-10)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage = "https://maidsafe.net"
license = "MIT OR BSD-3-Clause"
readme = "README.md"
repository = "https://github.com/maidsafe/qp2p"
version = "0.9.7"
version = "0.9.10"
authors = [ "MaidSafe Developers <dev@maidsafe.net>" ]
keywords = [ "quic" ]
edition = "2018"
Expand All @@ -23,7 +23,7 @@ thiserror = "1.0.23"
webpki = "~0.21.3"

[dependencies.bytes]
version = "~0.5.5"
version = "1.0.1"
features = [ "serde" ]

[dependencies.igd]
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl SerialisableCertificate {
/// Parses DER encoded binary key material to a format that can be used by Quinn
///
/// # Errors
/// Returns [CertificateParseError](enum.Error.html#variant.CertificateParseError) if the inputs
/// Returns [CertificateParseError](Error::CertificateParseError) if the inputs
/// cannot be parsed
pub fn obtain_priv_key_and_cert(&self) -> Result<(quinn::PrivateKey, quinn::Certificate)> {
Ok((
Expand Down
10 changes: 10 additions & 0 deletions src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ impl Endpoint {
}
}

/// Get an existing connection for the peer address.
pub fn get_connection(&self, peer_addr: &SocketAddr) -> Option<Connection> {
if let Some((conn, guard)) = self.connection_pool.get(peer_addr) {
trace!("Using cached connection to peer: {}", peer_addr);
Some(Connection::new(conn, guard))
} else {
None
}
}

/// Connects to another peer.
///
/// Returns `Connection` which is a handle for sending messages to the peer and
Expand Down
1 change: 1 addition & 0 deletions src/peer_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn new_our_cfg(
our_cert: quinn::Certificate,
our_key: quinn::PrivateKey,
) -> Result<quinn::ServerConfig> {
#[allow(clippy::field_reassign_with_default)]
let mut our_cfg_builder = {
let mut our_cfg = quinn::ServerConfig::default();
our_cfg.transport = Arc::new(new_transport_cfg(
Expand Down

0 comments on commit 263d4d9

Please sign in to comment.