Skip to content

Commit

Permalink
Merge branch 'master' into aj/restrict-wildcard-selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
ascjones committed Apr 20, 2023
2 parents 3db0181 + 55088cc commit f9a6901
Show file tree
Hide file tree
Showing 59 changed files with 432 additions and 159 deletions.
59 changes: 59 additions & 0 deletions .github/scripts/combine-pr.py
@@ -0,0 +1,59 @@
import uuid
import json
import glob
import sys
import os


def set_output(name, value):
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'{name}={value}', file=fh)


def set_multiline_output(name, value):
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
delimiter = uuid.uuid1()
print(f'{name}<<{delimiter}', file=fh)
print(value, file=fh)
print(delimiter, file=fh)


if len(sys.argv) > 1:
limit = int(sys.argv[1])
else:
limit = 999

result = []
for f in glob.glob("outputs/*.json"):
with open(f, "r") as infile:
result += json.load(infile)

sorted_data = sorted(result, key=lambda x: x['daysStale'])
sorted_data.reverse()

count = len(sorted_data)

set_output("COUNT", count)

if count < 1:
set_output("MESSAGE", "")
exit()

sliced_list = sorted_data[:limit]

formated_list = []
for i, data in enumerate(sliced_list):
message = str(
f' {i + 1}. [{data["title"]}]({data["url"]}) | {data["daysStale"]} days with no reviews')
formated_list.append(message)

with open(os.environ['GITHUB_STEP_SUMMARY'], 'a') as fh:
print(f'## There are {count} stale PRs', file=fh)
for message in formated_list:
print(f'{message}', file=fh)

message = "\n".join(formated_list)

set_multiline_output("MESSAGE", message)

set_output("data", json.dumps(formated_list))
1 change: 1 addition & 0 deletions .github/workflows/issue-notifier.yml
Expand Up @@ -10,6 +10,7 @@ jobs:
fetch-issues:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
# List of repositories to fetch the issues
repo:
Expand Down
102 changes: 102 additions & 0 deletions .github/workflows/pr-notifier.yml
@@ -0,0 +1,102 @@
name: Find stale PRs

on:
workflow_dispatch:
schedule:
- cron: "0 7 * * 4"

jobs:
fetch-issues:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
# List of repositories to fetch the issues
repo:
- ink
- cargo-contract
- substrate-contracts-node
- contracts-ui
- ink-docs
- smart-bench
- ink-waterfall
- ink-playground
- nft-marketplace-demo
- pallet-contracts-xcm
- link
- ink-examples
- useink
- awesome-ink
- squink-splash-beginner
- squink-splash-advanced
- ink-workshop
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.ISSUE_TRACKER_APP_ID }}
private_key: ${{ secrets.ISSUE_TRACKER_APP_KEY }}
- run: mkdir outputs
- name: Fetch PRs from ${{ matrix.repo }}
id: pr
uses: paritytech/stale-pr-finder@main
with:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
repo: ${{ matrix.repo }}
# only fetch PRs that don't have any reviews
noReviews: true
# from today onwards. Increase this number to set how much time without interaction must pass for the issue to be analyzed
days-stale: 0
fileOutput: outputs/${{ matrix.repo }}.json
- uses: actions/upload-artifact@v3
with:
name: outputs
path: outputs/*.json

message:
runs-on: ubuntu-latest
needs: fetch-issues
steps:
- uses: actions/checkout@v3
- name: Load outputs
uses: actions/download-artifact@v3
with:
name: outputs
path: outputs
- name: Run combine script
id: pr
run: python ./.github/scripts/combine-pr.py $LIMIT
shell: bash
env:
# How many PRs to show in the message
LIMIT: 8
- name: send message
if: ${{ steps.pr.outputs.MESSAGE != '' }}
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: "!EBuECvRavzBxijipBi:parity.io"
access_token: ${{ secrets.STALE_MATRIX_ACCESS_TOKEN }}
# Remember to keep at least one empty line between paragraphs
message: |
## Good morning, team 🥐!
This weekly digest contains the longest unreviewed pull requests from repositories which the Smart Contracts ☂️ owns ([list](https://www.notion.so/paritytechnologies/What-belongs-to-our-umbrella-b9a80b72fedc47d6b35224a15bdec64c)).
${{ steps.pr.outputs.MESSAGE }}
Unfortunately there are more stale PRs. The above list is limited to 8 entries. Find all the stale PRs [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
server: "m.parity.io"
- name: send message for no PRs found
if: ${{ steps.pr.outputs.MESSAGE == '' }}
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: "!EBuECvRavzBxijipBi:parity.io"
access_token: ${{ secrets.STALE_MATRIX_ACCESS_TOKEN }}
# Remember to keep at least one empty line between paragraphs
message: |
## Good morning, team 🥐!
We have no Pull Requests waiting for reviews.
**Good job everyone!**
server: "m.parity.io"
12 changes: 9 additions & 3 deletions CHANGELOG.md
Expand Up @@ -6,12 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Version 4.2.0

### Added
- Persist `Environment` in metadata - [#1741](https://github.com/paritytech/ink/pull/1741)
- Persist `Environment` in metadata ‒ [#1741](https://github.com/paritytech/ink/pull/1741)
- Added possibility for `runtime_call` in E2E tests ‒ [#1736](https://github.com/paritytech/ink/pull/1736)
- Added `default` attribute to constructors and messages ‒ [#1724](https://github.com/paritytech/ink/pull/1724)
- Added clarification about `Mapping::size` unit ‒ [#1735](https://github.com/paritytech/ink/pull/1735)

### Changed
- Upgraded `syn` to version `2` - [#1731](https://github.com/paritytech/ink/pull/1731)
- Added `default` attribute to constructors and messages - [#1703](https://github.com/paritytech/ink/pull/1724)
- Upgraded `syn` to version `2`[#1731](https://github.com/paritytech/ink/pull/1731)
- Update `scale-info` requirement to `2.5`[#1733](https://github.com/paritytech/ink/pull/1733)
- Bump `subxt` to `0.28.0`[#1750](https://github.com/paritytech/ink/pull/1750)

## Version 4.1.0

Expand Down
2 changes: 1 addition & 1 deletion crates/allocator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "ink_allocator"
version = "4.1.0"
version = "4.2.0"
authors = ["Parity Technologies <admin@parity.io>", "Robin Freyler <robin@parity.io>"]
edition = "2021"

Expand Down
24 changes: 12 additions & 12 deletions crates/e2e/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "ink_e2e"
version = "4.1.0"
version = "4.2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

Expand All @@ -15,28 +15,28 @@ categories = ["no-std", "embedded"]
include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]

[dependencies]
ink_e2e_macro = { version = "4.1.0", path = "./macro" }
ink = { version = "4.1.0", path = "../ink" }
ink_env = { version = "4.1.0", path = "../env" }
ink_primitives = { version = "4.1.0", path = "../primitives" }
ink_e2e_macro = { version = "4.2.0", path = "./macro" }
ink = { version = "4.2.0", path = "../ink" }
ink_env = { version = "4.2.0", path = "../env" }
ink_primitives = { version = "4.2.0", path = "../primitives" }

funty = "2.0.0"
impl-serde = { version = "0.3.1", default-features = false }
jsonrpsee = { version = "0.16.0", features = ["ws-client"] }
jsonrpsee = { version = "0.17.0", features = ["ws-client"] }
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.81" }
tokio = { version = "1.18.2", features = ["rt-multi-thread"] }
log = { version = "0.4" }
env_logger = { version = "0.10" }
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
subxt = "0.27.0"
subxt = "0.28.0"

# Substrate
pallet-contracts-primitives = "18.0.0"
sp-core = "16.0.0"
sp-keyring = "18.0.0"
sp-runtime = "18.0.0"
sp-weights = "14.0.0"
pallet-contracts-primitives = "23.0.0"
sp-core = "20.0.0"
sp-keyring = "23.0.0"
sp-runtime = "23.0.0"
sp-weights = "19.0.0"

[dev-dependencies]
# Required for the doctest of `MessageBuilder::call`
Expand Down
4 changes: 2 additions & 2 deletions crates/e2e/macro/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "ink_e2e_macro"
version = "4.1.0"
version = "4.2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

Expand All @@ -19,7 +19,7 @@ name = "ink_e2e_macro"
proc-macro = true

[dependencies]
ink_ir = { version = "4.1.0", path = "../../ink/ir" }
ink_ir = { version = "4.2.0", path = "../../ink/ir" }
cargo_metadata = "0.15.3"
contract-build = "2.0.2"
derive_more = "0.99.17"
Expand Down

0 comments on commit f9a6901

Please sign in to comment.