Skip to content

Commit

Permalink
Release Notes PR checker and generator (#12501)
Browse files Browse the repository at this point in the history
## Description 
Release Notes PR checker and generator

## Test Plan
```
eugene@mac-studio ~/code/sui (eugene/create_release_notes_workflow) $ ./scripts/generate-release-notes.sh releases/sui-v1.3.0-release releases/sui-v1.2.0-release
#12359:
#12444:

Introduce new modules: `clob_v2` and `custodian_v2` and deprecate `clob` and `custodian`.
#12231:
Adds the checkpoint low watermark for state sync. This lets a node to know who to query checkpoint contents according to the watermarks, once checkpoint pruning is enabled.
#12321:
#12251:
#12092:

Added a version of stake withdraw function that returns the withdrawn SUI tokens, for better composability.
#12258:
#12171:
update anemo to MystenLabs/anemo@1bfa784 which includes the `alternate_server_name` change. Set primary server name as `sui-{chain-id}`.  Note that if node starts to run this version in testnet/mainnet before the update is officially rolled out, it's likely the node won't be able to state sync.
#12043:

- adds `sui::kiosk::default()` function for easy Kiosk setup
```
Will test the workflows once this PR lands
  • Loading branch information
ebmifa committed Jun 15, 2023
1 parent 6156e20 commit 9d5961d
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/generate-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Generate Release Notes

on:
workflow_dispatch:
inputs:
previous_branch:
description: 'Previous Release Branch (releases/sui-vX.X.X-release)'
type: string
required: true
new_branch:
description: 'New Release Branch (releases/sui-vX.X.X-release)'
type: string
required: true

jobs:
generate-release-notes:
name: Generate Release Notes
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run script
shell: bash
run: |
./scripts/generate-release-notes.sh ${{ inputs.new_branch }} ${{ inputs.previous_branch }}
33 changes: 33 additions & 0 deletions .github/workflows/release-notes-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release Notes PR Checker

on:
pull_request:
types: [opened, synchronize]
paths:
- 'crates/*'
- 'dashboards/*'
- 'doc/*'
- 'docker/*'
- 'external-crates/*'
- 'kiosk/*'
- 'narwhal/*'
- 'nre/*'
- 'sui-execution/*'

jobs:
verify_description:
runs-on: ubuntu-latest

steps:
- name: Check Pull Request Description
shell: bash
run: |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
DESCRIPTION=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/MystenLabs/sui/pulls//pulls/$PR_NUMBER" \
| jq --raw-output .body)
if [[ $DESCRIPTION =~ \[x\].*Release[[:space:]]notes.*[[:space:]]+.* ]]; then
echo "At least one '[x]' was checked under 'Type of Change (Check all that apply)', you need to add a blob under the 'Release Notes' section."
exit 1
fi
21 changes: 21 additions & 0 deletions scripts/generate-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Copyright (c) Mysten Labs, Inc.
# SPDX-License-Identifier: Apache-2.0
#
# Generate Release Notes

if [ $# -lt 2 ];
then
echo "./generate-release-notes.sh [previous branch] [new branch]"
exit
else
prev_branch=$1
new_branch=$2
fi

for pr_number in $(git log --grep "\[x\]" --pretty=oneline --abbrev-commit origin/"${new_branch}"...origin/"${prev_branch}" -- crates dashboards doc docker external-crates kiosk narwhal nre sui-execution | grep -o '#[0-9]\+' | grep -o '[0-9]\+')
do
pr_body=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/MystenLabs/sui/pulls/"${pr_number}" --jq ".body")
release_notes="${pr_body#*### Release notes}"
echo "https://github.com/MystenLabs/sui/pull/${pr_number}: ${release_notes}"
done

2 comments on commit 9d5961d

@vercel
Copy link

@vercel vercel bot commented on 9d5961d Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sui-kiosk – ./dapps/kiosk

sui-kiosk-git-main-mysten-labs.vercel.app
sui-kiosk.vercel.app
sui-kiosk-mysten-labs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 9d5961d Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

offline-signer-helper – ./dapps/offline-signer-helper

offline-signer-helper.vercel.app
offline-signer-helper-mysten-labs.vercel.app
offline-signer-helper-git-main-mysten-labs.vercel.app

Please sign in to comment.