Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • parity/mirrors/polkadot-sdk
1 result
Show changes
Commits on Source (1456)
Showing
with 323 additions and 19 deletions
......@@ -8,3 +8,8 @@ rustdocflags = [
# Needed for musl builds so user doesn't have to install musl-tools.
CC_x86_64_unknown_linux_musl = { value = ".cargo/musl-gcc", force = true, relative = true }
CXX_x86_64_unknown_linux_musl = { value = ".cargo/musl-g++", force = true, relative = true }
CARGO_WORKSPACE_ROOT_DIR = { value = "", relative = true }
[net]
retry = 5
# git-fetch-with-cli = true # commented because there is a risk that a runner can be banned by github
......@@ -2,9 +2,9 @@
# Run with `lychee -c .config/lychee.toml ./**/*.rs ./**/*.prdoc`
cache = true
max_cache_age = "1d"
max_cache_age = "10d"
max_redirects = 10
max_retries = 6
max_retries = 3
# Exclude localhost et.al.
exclude_all_private = true
......@@ -18,14 +18,17 @@ accept = [
"429",
]
exclude_path = ["./target"]
exclude_path = [
"./prdoc",
"./target",
]
exclude = [
# Place holders (no need to fix these):
"http://visitme/",
"https://visitme/",
# TODO <https://github.com/paritytech/polkadot-sdk/issues/134>
# TODO meta issue: <https://github.com/paritytech/polkadot-sdk/issues/134>
"https://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs",
"https://docs.substrate.io/rustdocs/latest/sp_api/macro.decl_runtime_apis.html",
"https://github.com/ipfs/js-ipfs-bitswap/blob/",
......@@ -33,22 +36,26 @@ exclude = [
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot.network/the-path-of-a-parachain-block/",
"https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results",
"https://research.web3.foundation/en/latest/polkadot/NPoS/3.%20Balancing.html",
"https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html#-6.-practical-results",
"https://research.web3.foundation/en/latest/polkadot/networking/3-avail-valid.html#topology",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/slashing/npos.html",
"https://rpc.polkadot.io/",
"https://try-runtime.polkadot.io/",
"https://w3f.github.io/parachain-implementers-guide/node/approval/approval-distribution.html",
"https://w3f.github.io/parachain-implementers-guide/node/index.html",
"https://w3f.github.io/parachain-implementers-guide/protocol-chain-selection.html",
"https://w3f.github.io/parachain-implementers-guide/runtime/session_info.html",
# Behind a captcha (code 403):
"https://chainlist.org/chain/*",
"https://iohk.io/en/blog/posts/2023/11/03/partner-chains-are-coming-to-cardano/",
"https://www.reddit.com/r/rust/comments/3spfh1/does_collect_allocate_more_than_once_while/",
# 403 rate limited:
"https://etherscan.io/block/11090290",
"https://subscan.io/",
"https://substrate.stackexchange.com/.*",
]
......@@ -21,7 +21,6 @@ retries = 5
# The number of threads to run tests with. Supported values are either an integer or
# the string "num-cpus". Can be overridden through the `--test-threads` option.
# test-threads = "num-cpus"
test-threads = 20
# The number of threads required for each test. This is generally used in overrides to
......@@ -124,3 +123,10 @@ serial-integration = { max-threads = 1 }
[[profile.default.overrides]]
filter = 'test(/(^ui$|_ui|ui_)/)'
test-group = 'serial-integration'
# Running eth-rpc tests sequentially
# These tests rely on a shared resource (the RPC and Node)
# and would cause race conditions due to transaction nonces if run in parallel.
[[profile.default.overrides]]
filter = 'package(pallet-revive-eth-rpc) and test(/^tests::/)'
test-group = 'serial-integration'
......@@ -33,3 +33,17 @@ keys = ["build"]
[rule.formatting]
reorder_arrays = false
[[rule]]
include = ["Cargo.toml"]
keys = ["workspace.dependencies"]
[rule.formatting]
reorder_keys = true
[[rule]]
include = ["**/Cargo.toml"]
keys = ["build-dependencies", "dependencies", "dev-dependencies"]
[rule.formatting]
reorder_keys = true
......@@ -25,9 +25,13 @@ workflows:
'--show-path',
'--quiet',
]
# Same as `check`, but with the `--fix` flag.
# The umbrella crate uses more features, so we to check those too:
check_umbrella:
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
# Same as `check_*`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
- [ $check_umbrella.0, '--fix' ]
# Will be displayed when any workflow fails:
help:
......
[compression]
type = "zstd"
[compression.zstd]
compressionLevel = 3
[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6
[cache]
extraEnv = ["RUNTIME_METADATA_HASH"]
[metrics]
enabled = true
pushEndpoint = "placeholder"
[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"
[storage]
type = "s3"
[storage.s3]
accessKeyId = "placeholder"
bucketName = "placeholder"
concurrency = 10
endpointUrl = "placeholder"
secretAccessKey = "placeholder"
[compression]
type = "zstd"
[compression.zstd]
compressionLevel = 3
[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6
[cache]
extraEnv = ["RUNTIME_METADATA_HASH"]
[metrics]
enabled = true
pushEndpoint = "placeholder"
[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"
[storage]
type = "gcs"
[storage.gcs]
bucketName = "parity-ci-forklift"
......@@ -64,7 +64,8 @@
/substrate/primitives/merkle-mountain-range/ @acatangiu
# Contracts
/substrate/frame/contracts/ @athei @paritytech/docs-audit
/substrate/frame/contracts/ @paritytech/smart-contracts @paritytech/docs-audit
/substrate/frame/revive/ @paritytech/smart-contracts @paritytech/docs-audit
# NPoS and election
/substrate/frame/election-provider-multi-phase/ @paritytech/staking-core @paritytech/docs-audit
......
name: 'build and push image'
inputs:
dockerfile:
description: "dockerfile to build"
required: true
image-name:
description: ""
required: true
outputs:
branch:
description: 'Branch name for the PR'
value: ${{ steps.branch.outputs.branch }}
runs:
using: "composite"
steps:
# gcloud
# https://github.com/paritytech/ci_cd/wiki/GitHub:-Push-Docker-image-to-GCP-Registry
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: "gcloud info"
shell: bash
run: "gcloud info"
- name: "Auth in gcloud registry"
shell: bash
run: "gcloud auth configure-docker europe-docker.pkg.dev --quiet"
- name: build
shell: bash
env:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.105"
run: |
export BRANCH_NAME=${{ github.head_ref || github.ref_name }}
export DOCKER_IMAGES_VERSION=${BRANCH_NAME/\//-}
if [[ ${{ github.event_name }} == "merge_group" ]]; then export DOCKER_IMAGES_VERSION="${GITHUB_SHA::8}"; fi
docker build \
--build-arg VCS_REF="${GITHUB_SHA}" \
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
--build-arg IMAGE_NAME="${{ inputs.image-name }}" \
--build-arg ZOMBIENET_IMAGE="${ZOMBIENET_IMAGE}" \
-t "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION" \
-f ${{ inputs.dockerfile }} \
.
docker push "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION"
name: 'cargo check runtimes'
description: 'Runs `cargo check` for every directory in provided root.'
inputs:
root:
description: "Root directory. Expected to contain several cargo packages inside."
required: true
runs:
using: "composite"
steps:
- name: Check
shell: bash
run: |
mkdir -p ~/.forklift
cp .forklift/config.toml ~/.forklift/config.toml
cd ${{ inputs.root }}
for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 forklift cargo check --locked;
cd ..;
done
name: "install gh"
description: "Install the gh cli in a debian based distro and switches to the PR branch."
inputs:
pr-number:
description: "Number of the PR"
required: true
GH_TOKEN:
description: "GitHub token"
required: true
outputs:
branch:
description: "Branch name for the PR"
value: ${{ steps.branch.outputs.branch }}
runs:
using: "composite"
steps:
- name: Set up git
shell: bash
# Here it would get the script from previous step
run: git config --global --add safe.directory '*'
- run: gh pr checkout ${{ inputs.pr-number }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
- name: Export branch name
shell: bash
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
id: branch
name: "stop all workflows"
description: "Action stops all workflows in a PR to save compute resources."
inputs:
app-id:
description: "App id"
required: true
app-key:
description: "App token"
required: true
runs:
using: "composite"
steps:
- name: Worfklow stopper - Generate token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ inputs.app-id }}
private-key: ${{ inputs.app-key }}
owner: "paritytech"
repositories: "workflow-stopper"
- name: Workflow stopper - Stop all workflows
uses: octokit/request-action@v2.x
with:
route: POST /repos/paritytech/workflow-stopper/actions/workflows/stopper.yml/dispatches
ref: main
inputs: '${{ format(''{{ "github_sha": "{0}", "github_repository": "{1}", "github_ref_name": "{2}", "github_workflow_id": "{3}", "github_job_name": "{4}" }}'', github.event.pull_request.head.sha, github.repository, github.ref_name, github.run_id, github.job) }}'
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
coverage:
precision: 2
round: down
range: "1...100"
status:
project:
default:
target: 1.0
threshold: 2.0
comment:
behavior: new
fixes:
- "/__w/polkadot-sdk/polkadot-sdk/::"
\ No newline at end of file
......@@ -5,13 +5,17 @@ updates:
directory: '/'
labels: ["A1-insubstantial", "R0-silent"]
schedule:
interval: daily
interval: weekly
groups:
ci_dependencies:
patterns:
- "*"
# Update Rust dependencies:
- package-ecosystem: "cargo"
directory: "/"
labels: ["A1-insubstantial", "R0-silent"]
schedule:
interval: "daily"
interval: "weekly"
groups:
# We assume these crates to be semver abiding and can therefore group them together.
known_good_semver:
......
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-11-19-v202411281558"
../docs/contributor/PULL_REQUEST_TEMPLATE.md
\ No newline at end of file
......@@ -9,6 +9,7 @@ rules:
- ^\.gitlab/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
- ^\.forklift/.*
exclude:
- ^\.gitlab/pipeline/zombienet.*
type: "or"
......@@ -28,11 +29,12 @@ rules:
# excluding files from 'Runtime files' and 'CI files' rules
exclude:
- ^cumulus/parachains/common/src/[^/]+\.rs$
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^\.gitlab-ci\.yml
- ^docker/.*
- ^\.github/.*
- ^\.gitlab/.*
- ^\.forklift/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
minApprovals: 2
......@@ -54,7 +56,7 @@ rules:
- name: FRAME coders substrate
condition:
include:
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
type: "and"
reviewers:
- minApprovals: 2
......@@ -64,6 +66,17 @@ rules:
teams:
- frame-coders
# Smart Contracts
- name: Smart Contracts
type: basic
condition:
include:
- ^substrate/frame/contracts/.*
- ^substrate/frame/revive/.*
minApprovals: 2
teams:
- smart-contracts
# Protection of THIS file
- name: Review Bot
countAuthor: true
......
......@@ -9,6 +9,7 @@
#
# - `target_group`: Integer starting from 1, the group this script should execute.
# - `groups_total`: Integer starting from 1, total number of groups.
# - `disable_forklift`: Boolean, whether to disable forklift or not.
import subprocess, sys
......@@ -31,6 +32,9 @@ crates.sort()
target_group = int(sys.argv[1]) - 1
groups_total = int(sys.argv[2])
disable_forklift = bool(sys.argv[3] if len(sys.argv) > 3 else False)
print(f"Target group: {target_group}, Total groups: {groups_total}, Disable forklift: {disable_forklift}", file=sys.stderr)
if len(crates) == 0:
print("No crates detected!", file=sys.stderr)
......@@ -55,7 +59,11 @@ for i in range(0, crates_per_group + overflow_crates):
print(f"Checking {crates[crate][0]}", file=sys.stderr)
res = subprocess.run(["forklift", "cargo", "check", "--locked"], cwd = crates[crate][1])
cmd = ["cargo", "check", "--locked"]
cmd.insert(0, 'forklift') if not disable_forklift else None
res = subprocess.run(cmd, cwd = crates[crate][1])
if res.returncode != 0:
sys.exit(1)
#!/bin/bash
echo "Running script relative to `pwd`"
# Find all README.docify.md files
DOCIFY_FILES=$(find . -name "README.docify.md")
# Initialize a variable to track directories needing README regeneration
NEED_REGENERATION=""
for file in $DOCIFY_FILES; do
echo "Processing $file"
# Get the directory containing the docify file
DIR=$(dirname "$file")
# Go to the directory and run cargo build
cd "$DIR"
cargo check --features generate-readme || { echo "Readme generation for $DIR failed. Ensure the crate compiles successfully and has a `generate-readme` feature which guards markdown compilation in the crate as follows: https://docs.rs/docify/latest/docify/macro.compile_markdown.html#conventions." && exit 1; }
# Check if README.md has any uncommitted changes
git diff --exit-code README.md
if [ $? -ne 0 ]; then
echo "Error: Found uncommitted changes in $DIR/README.md"
NEED_REGENERATION="$NEED_REGENERATION $DIR"
fi
# Return to the original directory
cd - > /dev/null
done
# Check if any directories need README regeneration
if [ -n "$NEED_REGENERATION" ]; then
echo "The following directories need README regeneration:"
echo "$NEED_REGENERATION"
exit 1
fi
\ No newline at end of file
......@@ -135,8 +135,12 @@ def check_links(all_crates):
if dep_name in all_crates:
links.append((name, dep_name))
if not 'path' in deps[dep]:
broken.append((name, dep_name, "crate must be linked via `path`"))
if name == 'polkadot-sdk':
if not 'path' in deps[dep]:
broken.append((name, dep_name, "crate must use path"))
return
elif not 'workspace' in deps[dep] or not deps[dep]['workspace']:
broken.append((name, dep_name, "crate must use workspace inheritance"))
return
def check_crate(deps):
......@@ -154,8 +158,6 @@ def check_links(all_crates):
check_crate(manifest)
links.sort()
broken.sort()
......