forked from paritytech/polkadot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Overview This PR brings in the new version of prdoc v0.0.6 and allows: - local schema - local config - local template It also fixes the existing prdoc files to match the new schema. ## todo - [x] add a brief doc/tldr to help contributors get started - [x] test CI - [x] finalize schema - [x] publish the next `prdoc` cli version (v0.0.7 or above) --------- Co-authored-by: Egor_P <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
- Loading branch information
1 parent
1266de3
commit 756a12d
Showing
17 changed files
with
376 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Config file for prdoc, see https://github.com/paritytech/prdoc | ||
|
||
version = 1 | ||
schema = "prdoc/schema_user.json" | ||
output_dir = "prdoc" | ||
prdoc_folders = ["prdoc"] | ||
template = "prdoc/.template.prdoc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# PRDoc | ||
|
||
## Intro | ||
|
||
With the merge of [PR #1946](https://github.com/paritytech/polkadot-sdk/pull/1946), a new method for | ||
documenting changes has been introduced: `prdoc`. The [prdoc repository](https://github.com/paritytech/prdoc) | ||
contains more documentation and tooling. | ||
|
||
The current document describes how to quickly get started authoring `PRDoc` files. | ||
|
||
## Requirements | ||
|
||
When creating a PR, the author needs to decides with the `R0` label whether the change (PR) should | ||
appear in the release notes or not. | ||
|
||
Labelling a PR with `R0` means that no `PRDoc` is required. | ||
|
||
A PR without the `R0` label **does** require a valid `PRDoc` file to be introduced in the PR. | ||
|
||
## PRDoc how-to | ||
|
||
A `.prdoc` file is a YAML file with a defined structure (ie JSON Schema). | ||
|
||
For significant changes, a `.prdoc` file is mandatory and the file must meet the following | ||
requirements: | ||
- file named `pr_NNNN.prdoc` where `NNNN` is the PR number. | ||
For convenience, those file can also contain a short description: `pr_NNNN_foobar.prdoc`. | ||
- located under the [`prdoc` folder](https://github.com/paritytech/polkadot-sdk/tree/master/prdoc) of the repository | ||
- compliant with the [JSON schema](https://json-schema.org/) defined in `prdoc/schema_user.json` | ||
|
||
Those requirements can be fulfilled manually without any tooling but a text editor. | ||
|
||
## Tooling | ||
|
||
Users might find the following helpers convenient: | ||
- Setup VSCode to be aware of the prdoc schema: see [using VSCode](https://github.com/paritytech/prdoc#using-vscode) | ||
- Using the `prdoc` cli to: | ||
- generate a `PRDoc` file from a [template defined in the Polkadot SDK | ||
repo](https://github.com/paritytech/polkadot-sdk/blob/master/prdoc/.template.prdoc) simply providing a PR number | ||
- check the validity of one or more `PRDoc` files | ||
|
||
## `prdoc` cli usage | ||
|
||
The `prdoc` cli documentation can be found at https://github.com/paritytech/prdoc#prdoc | ||
|
||
tldr: | ||
- `prdoc generate <NNNN>` | ||
- `prdoc check -n <NNNN>` | ||
|
||
where <NNNN> is the PR number. | ||
|
||
## Pick an audience | ||
|
||
While describing a PR, the author needs to consider which audience(s) need to be addressed. | ||
The list of valid audiences is described and documented in the JSON schema as follow: | ||
|
||
- `Node Dev`: Those who build around the client side code. Alternative client builders, SMOLDOT, those who consume RPCs. | ||
These are people who are oblivious to the runtime changes. They only care about the meta-protocol, not the protocol | ||
itself. | ||
|
||
- `Runtime Dev`: All of those who rely on the runtime. A parachain team that is using a pallet. A DApp that is using a | ||
pallet. These are people who care about the protocol (WASM), not the meta-protocol (client). | ||
|
||
- `Node Operator`: Those who don't write any code and only run code. | ||
|
||
- `Runtime User`: Anyone using the runtime. This can be a token holder or a dev writing a front end for a chain. | ||
|
||
## Tips | ||
|
||
The PRDoc schema is defined in each repo and usually is quite restrictive. | ||
You cannot simply add a new property to a `PRDoc` file unless the Schema allows it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: ... | ||
|
||
doc: | ||
- audience: Node Dev | ||
description: | | ||
... | ||
|
||
crates: [ ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
title: Removed deprecated `Balances::transfer` and `Balances::set_balance_deprecated` functions. | ||
|
||
doc: | ||
- audience: Builder | ||
description: The Balances pallet's dispatchables `set_balance_deprecated` and `transfer` were deprecated in [paritytech/substrate#12951](https://github.com/paritytech/substrate/pull/12951) and have now been removed. | ||
notes: | ||
- Use `set_balance_deprecated` instead `force_set_balance` and `transfer_allow_death` instead of `transfer`. | ||
|
||
migrations: | ||
db: [] | ||
- audience: Runtime User | ||
description: | | ||
The Balances pallet's dispatchables `set_balance_deprecated` and `transfer` were deprecated in [paritytech/substrate#12951](https://github.com/paritytech/substrate/pull/12951) and have now been removed. | ||
|
||
runtime: [] | ||
notes: | ||
- Use `set_balance_deprecated` instead `force_set_balance` and `transfer_allow_death` instead of `transfer`. | ||
|
||
crates: | ||
- name: pallet-balances | ||
|
||
host_functions: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
title: FRAME pallets warning for unchecked weight witness | ||
|
||
doc: | ||
- audience: Core Dev | ||
- audience: Runtime Dev | ||
description: | | ||
FRAME pallets now emit a warning when a call uses a function argument that starts with an underscore in its weight declaration. | ||
|
||
migrations: | ||
db: [ ] | ||
runtime: [ ] | ||
|
||
host_functions: [] | ||
|
||
crates: | ||
- name: "frame-support-procedural" | ||
semver: minor | ||
- name: frame-support-procedural |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
title: Message Queue use proper overweight limit | ||
|
||
doc: | ||
- audience: Core Dev | ||
- audience: Node Dev | ||
description: | | ||
Changed the overweight cutoff limit from the full `Config::ServiceWeight` to a lower value that is calculated based on the weight of the functions being called. | ||
|
||
migrations: | ||
db: [] | ||
|
||
runtime: [] | ||
|
||
crates: ["pallet-message-queue", patch] | ||
|
||
host_functions: [] | ||
crates: | ||
- name: pallet-message-queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.