-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rh-use-dyn-syncoracle
- Loading branch information
Showing
674 changed files
with
16,009 additions
and
4,187 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
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,79 @@ | ||
from github import Github | ||
import re | ||
import os | ||
from datetime import date | ||
|
||
g = Github(os.getenv("GH_TOKEN")) | ||
|
||
# Regex pattern to match wish format: | ||
wish_pattern = re.compile( | ||
r"I wish for:? (https://github\.com/([a-zA-Z0-9_.-]+)/([a-zA-Z0-9_.-]+)/issues/(\d+))" | ||
) | ||
|
||
wishlist_issue = g.get_repo(os.getenv("WISHLIST_REPOSITORY")).get_issue( | ||
int(os.getenv("WISHLIST_ISSUE_NUMBER")) | ||
) | ||
new_leaderboard = ( | ||
"| Feature Request | Summary | Votes | Status |\n| --- | --- | --- | --- |\n" | ||
) | ||
wishes = {} | ||
issue_details = {} | ||
|
||
for comment in wishlist_issue.get_comments(): | ||
# in the comment body, if there is a string `#(\d)`, replace it with | ||
# https://github.com/paritytech/polkadot-sdk/issues/(number) | ||
updated_body = re.sub( | ||
r"#(\d+)", r"https://github.com/paritytech/polkadot-sdk/issues/\1", comment.body | ||
) | ||
|
||
matches = wish_pattern.findall(updated_body) | ||
for match in matches: | ||
url, org, repo_name, issue_id = match | ||
issue_key = (url, org, repo_name, issue_id) | ||
if issue_key not in wishes: | ||
wishes[issue_key] = [] | ||
|
||
# Get the author and upvoters of the wish comment. | ||
wishes[issue_key].append(comment.user.id) | ||
wishes[issue_key].extend( | ||
[ | ||
reaction.user.id | ||
for reaction in comment.get_reactions() | ||
if reaction.content in ["+1", "heart", "rocket"] | ||
] | ||
) | ||
|
||
# Get upvoters of the desired issue. | ||
desired_issue = g.get_repo(f"{org}/{repo_name}").get_issue(int(issue_id)) | ||
wishes[issue_key].extend( | ||
[ | ||
reaction.user.id | ||
for reaction in desired_issue.get_reactions() | ||
if reaction.content in ["+1", "heart", "rocket"] | ||
] | ||
) | ||
issue_details[url] = [ | ||
desired_issue.title, | ||
"👾 Open" if desired_issue.state == "open" else "✅Closed", | ||
] | ||
|
||
# Count unique wishes - the author of the wish, upvoters of the wish, and upvoters of the desired issue. | ||
for key in wishes: | ||
wishes[key] = len(list(set(wishes[key]))) | ||
|
||
# Sort wishes by count and add to the markdown table | ||
sorted_wishes = sorted(wishes.items(), key=lambda x: x[1], reverse=True) | ||
for (url, _, _, _), count in sorted_wishes: | ||
[summary, status] = issue_details.get(url, "No summary available") | ||
new_leaderboard += f"| {url} | {summary} | {count} | {status} |\n" | ||
new_leaderboard += f"\n> Last updated: {date.today().strftime('%Y-%m-%d')}\n" | ||
print(new_leaderboard) | ||
|
||
new_content = re.sub( | ||
r"(\| Feature Request \|)(.*?)(> Last updated:)(.*?\n)", | ||
new_leaderboard, | ||
wishlist_issue.body, | ||
flags=re.DOTALL, | ||
) | ||
|
||
wishlist_issue.edit(body=new_content) |
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 |
---|---|---|
|
@@ -16,8 +16,8 @@ jobs: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/[email protected].1 | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: actions/[email protected].3 | ||
with: | ||
node-version: "18.x" | ||
registry-url: "https://npm.pkg.github.com" | ||
|
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 |
---|---|---|
|
@@ -5,43 +5,85 @@ on: | |
types: [opened, synchronize, reopened, ready_for_review] | ||
paths: | ||
- prdoc/*.prdoc | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: check-semver-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
TOOLCHAIN: nightly-2024-03-01 | ||
TOOLCHAIN: nightly-2024-06-01 | ||
|
||
|
||
jobs: | ||
check-semver: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408 | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: extra git setup | ||
run: | | ||
git config --global --add safe.directory '*' | ||
git fetch --no-tags --no-recurse-submodules --depth=1 origin master | ||
git branch old origin/master | ||
- name: Comment If Backport | ||
if: ${{ startsWith(github.event.pull_request.base.ref, 'stable') }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PR: ${{ github.event.pull_request.number }} | ||
run: | | ||
echo "This is a backport into stable." | ||
wget -q https://github.com/cli/cli/releases/download/v2.51.0/gh_2.51.0_linux_amd64.tar.gz -O gh.tar.gz && \ | ||
tar -xzf gh.tar.gz && mv gh_2.51.0_linux_amd64/bin/gh /usr/local/bin/gh && rm gh.tar.gz | ||
chmod +x /usr/local/bin/gh | ||
cat > msg.txt <<EOF | ||
This pull request is amending an existing release. Please proceed with extreme caution, | ||
as to not impact downstream teams that rely on the stability of it. Some things to consider: | ||
- Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change. | ||
- Should be a legit *fix* for some bug, not adding tons of new features. | ||
- Must either be already audited or trivial (not sure audit). | ||
<details><summary><i>Emergency Bypass</i></summary> | ||
<p> | ||
If you really need to bypass this check: add <code>validate: false</code> to each crate | ||
in the Prdoc where a breaking change is introduced. This will release a new major | ||
version of that crate and all its reverse dependencies and basically break the release. | ||
</p> | ||
</details> | ||
EOF | ||
gh issue comment $PR --edit-last -F msg.txt || gh issue comment $PR -F msg.txt | ||
echo "PRDOC_EXTRA_ARGS=--max-bump minor" >> $GITHUB_ENV | ||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: install parity-publish | ||
run: cargo install [email protected] | ||
|
||
- name: Rust compilation prerequisites | ||
run: | | ||
rustup default $TOOLCHAIN | ||
rustup target add wasm32-unknown-unknown --toolchain $TOOLCHAIN | ||
rustup component add rust-src --toolchain $TOOLCHAIN | ||
- name: extra git setup | ||
run: | | ||
git config --global --add safe.directory '*' | ||
git fetch --no-tags --no-recurse-submodules --depth=1 origin master | ||
git branch old origin/master | ||
- name: install parity-publish | ||
# Set the target dir to cache the build. | ||
run: CARGO_TARGET_DIR=./target/ cargo install parity-publish -q | ||
|
||
- name: check semver | ||
run: | | ||
export CARGO_TARGET_DIR=target | ||
export RUSTFLAGS='-A warnings -A missing_docs' | ||
export SKIP_WASM_BUILD=1 | ||
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc -v --toolchain $TOOLCHAIN; then | ||
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc $PRDOC_EXTRA_ARGS -v --toolchain $TOOLCHAIN; then | ||
cat <<EOF | ||
👋 Hello developer! The SemVer information that you declared in the prdoc file did not match what the CI detected. | ||
|
@@ -56,3 +98,4 @@ jobs: | |
fi | ||
env: | ||
PR: ${{ github.event.pull_request.number }} | ||
PRDOC_EXTRA_ARGS: ${{ env.PRDOC_EXTRA_ARGS }} |
Oops, something went wrong.