Skip to content

Commit

Permalink
Merge branch 'master' into ao-fix-parainclusion-weight-overestimation
Browse files Browse the repository at this point in the history
* master: (27 commits)
  Bridges improved tests and nits (#5128)
  Fix misleading comment about RewardHandler in epm config (#3095)
  Introduce a workflow updating the wishlist leaderboards (#5085)
  membership: Restructure pallet into separate files (#4536)
  Fix after ring-proof api change (#5126)
  Bump paritytech/review-bot from 2.4.0 to 2.5.0 (#5057)
  Bump docker/login-action from 3.0.0 to 3.3.0 (#5109)
  Bump docker/build-push-action from 5.1.0 to 6.5.0 (#5108)
  Bump peter-evans/create-pull-request from 5.0.0 to 6.1.0 (#5093)
  Tx Payment: drop ED requirements for tx payments with exchangeable asset  (#4488)
  Remove `pallet-getter` usage from pallet-transaction-payment (#4970)
  pallet macro: do not generate try-runtime related code when frame-support doesn't have try-runtime. (#5099)
  fix(chain-spec): ChainSpecBuilder with object as default genesis (#4345)
  Migrate BEEFY BLS crypto to  bls12-381 curve (#4931)
  Bump clap from 4.5.9 to 4.5.10 in the known_good_semver group (#5120)
  Use jobserver in wasm-builder to limit concurrency of spawned cargo processes (#4946)
  include events for voting (#4613)
  [subsystem-bench] Add mocks for own assignments triggering (#5042)
  Remove not-audited warning (#5114)
  hotfix: blockchain/backend: Skip genesis leaf to unblock syncing (#5103)
  ...
  • Loading branch information
ordian committed Jul 25, 2024
2 parents f4d2eee + de6733b commit b235de4
Show file tree
Hide file tree
Showing 153 changed files with 3,436 additions and 1,927 deletions.
79 changes: 79 additions & 0 deletions .github/scripts/update-wishlist-leaderboard.py
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)
2 changes: 1 addition & 1 deletion .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
timeout-minutes: 90
- name: Create PR on failure
if: failure() && steps.check-compilation.outcome == 'failure'
uses: peter-evans/create-pull-request@5b4a9f6a9e2af26e5f02351490b90d01eb8ec1e5 # v5
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v5
with:
path: "${{ env.template-path }}"
token: ${{ steps.app_token.outputs.token }}
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/misc-update-wishlist-leaderboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update wishlist leaderboard

on:
schedule:
# Run every 3 hours
- cron: '0 */3 * * *'

permissions:
contents: read
issues: write

jobs:
update-wishlist-leaderboard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyGithub
- name: Update developer wishlist
env:
GH_TOKEN: ${{ github.token }}
WISHLIST_REPOSITORY: "paritytech/polkadot-sdk"
WISHLIST_ISSUE_NUMBER: "3900"
run: python .github/scripts/update-wishlist-leaderboard.py
- name: Update user wishlist
env:
GH_TOKEN: ${{ github.token }}
WISHLIST_REPOSITORY: "paritytech/polkadot-sdk"
WISHLIST_ISSUE_NUMBER: "3901"
run: python .github/scripts/update-wishlist-leaderboard.py
6 changes: 3 additions & 3 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ jobs:
./docker/scripts/build-injected.sh
- name: Login to Dockerhub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.CUMULUS_DOCKERHUB_USERNAME }}
password: ${{ secrets.CUMULUS_DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -275,7 +275,7 @@ jobs:
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.POLKADOT_DOCKERHUB_USERNAME }}
password: ${{ secrets.POLKADOT_DOCKERHUB_TOKEN }}
Expand All @@ -288,7 +288,7 @@ jobs:
- name: Build and push
id: docker_build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
push: true
file: docker/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
artifact-name: pr_number
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.4.0
uses: paritytech/review-bot@v2.5.0
with:
repo-token: ${{ steps.app_token.outputs.token }}
team-token: ${{ steps.app_token.outputs.token }}
Expand Down
Loading

0 comments on commit b235de4

Please sign in to comment.