Skip to content

Commit

Permalink
🚀 Release 1.5.1 (#4481)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesan authored Jul 25, 2023
2 parents 1b9f948 + 6ca0093 commit 3b1eeb6
Show file tree
Hide file tree
Showing 144 changed files with 11,269 additions and 9,466 deletions.
7 changes: 2 additions & 5 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@
{
"groups": ["builtin", "external", "parent", ["index", "sibling"]],
"pathGroups": [
{
"pattern": "@/**",
"group": "external",
"position": "after"
}
{ "pattern": "@test/**", "position": "after", "group": "builtin" },
{ "pattern": "@/**", "position": "after", "group": "external" }
],
"pathGroupsExcludedImportTypes": ["builtin"],
"newlines-between": "always",
Expand Down
154 changes: 141 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,154 @@
name: CI

on:
push:
branches:
- main
push: { branches: [dev, main] }
pull_request:

jobs:
test:
install:
timeout-minutes: 10
strategy:
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }}
name: Install dependencies
run: yarn --immutable

ui-unit-tests:
needs: install
timeout-minutes: 60
strategy:
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --immutable

- name: Verify linting
run: yarn lint

- name: Build Pioneer
run: yarn build

- name: Run tests
run: node --max_old_space_size=7000 --expose-gc $(yarn bin jest) --logHeapUsage --silent
working-directory: packages/ui

interaction-tests:
needs: install
timeout-minutes: 60
strategy:
matrix:
node: ['14.x']
os: [ubuntu-latest]
matrix: { node: ["18.x"], os: [ubuntu-latest] }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn build
- run: yarn ci-test --silent

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --immutable

- name: Install Playwright
run: npx playwright install --with-deps

- name: Get the Storybook preview deployment url
run: |
if [ "$PREFIX" == 'git-fork' ]; then
BRANCH=$(echo -n '${{ env.LABEL }}' | sed 's/:/-/')
else
BRANCH=$(echo -n '${{ env.LABEL }}' | cut -d ':' -f2-)
fi
URL_BRANCH=$(echo -n "$BRANCH" | tr -d '#' | tr -c '[:alnum:]' '-' | tr '[:upper:]' '[:lower:]')
SUBDOMAIN="${{ env.PROJECT }}-${{ env.PREFIX }}-$URL_BRANCH-joystream"
if [ ${#SUBDOMAIN} -gt 63 ]; then
HASH=$(echo -n "${{ env.PREFIX }}-${BRANCH}${{ env.PROJECT }}" | sha256sum | head -c 6)
SUBDOMAIN="$(echo -n "$SUBDOMAIN" | head -c 46)-$HASH-joystream"
fi
echo "VERCEL_DEPLOYMENT_URL=$SUBDOMAIN.vercel.app" >> "$GITHUB_ENV"
env:
PROJECT: pioneer-2-storybook
PREFIX: ${{ github.event.pull_request.head.repo.fork && 'git-fork' || 'git' }}
LABEL: ${{ github.event.pull_request.head.label || github.ref_name }}

- name: Wait for the deployment to complete
run: |
while true; do
RES=$(curl -L 'https://api.vercel.com/v13/deployments/${{ env.VERCEL_DEPLOYMENT_URL }}')
STATUS=$(echo -n "$RES" | jq -r '.status')
SHA=$(echo -n "$RES" | jq -r '.meta.githubCommitSha')
if [ "$SHA" == 'null' ] || [ "$STATUS" == 'null' ]; then
echo -e "\nError the JSON response is missing expected fields:\n\n$RES\n" >&2
exit 5
fi
if [ "$SHA" == '${{ env.COMMIT_SHA }}' ] && [ "$STATUS" == 'READY' ]; then
exit 0
fi
echo -e '\nWait for the Storybook deployment...\n\n'
sleep 20
done
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Run Storybook tests
run: yarn workspace @joystream/pioneer test-storybook
env:
TARGET_URL: https://${{ env.VERCEL_DEPLOYMENT_URL }}
37 changes: 0 additions & 37 deletions .github/workflows/gh-pages.yml

This file was deleted.

15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.1] - 2023-07-25

### Fixed
- Do not ask for confirmation to close transaction success modals.
- Correctly match questions and answers in opening application pages.
- Do not keep showing the total balance after disconnecting a wallet.
- Show all applicants on closed opening pages.

### Changed
- Clarify the label copy of the council budget increment proposal input field.
- Just show past elections cycle id without "round".

## [1.5.0] - 2023-06-06

### Added
Expand Down Expand Up @@ -161,7 +173,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.1.1] - 2022-12-02

[unreleased]: https://github.com/Joystream/pioneer/compare/v1.5.0...HEAD
[unreleased]: https://github.com/Joystream/pioneer/compare/v1.5.1...HEAD
[1.5.1]: https://github.com/Joystream/pioneer/compare/v1.5.0...v1.5.1
[1.5.0]: https://github.com/Joystream/pioneer/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/Joystream/pioneer/compare/v1.3.2...v1.4.0
[1.3.2]: https://github.com/Joystream/pioneer/compare/v1.3.1...v1.3.2
Expand Down
6 changes: 4 additions & 2 deletions docs/mocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ To test most of the extrinsics requires existing on-chain data. To create some o

Available commands:

- `yarn workspace @joystream/pioneer node-mocks council:elect [-d BLOCK_TIME] [--to ELECTION_STAGE]` - Run an election until the specified stage: VOTE, REVEAL, or IDLE (default)
- `yarn workspace @joystream/pioneer node-mocks council:elect [-d BLOCK_TIME¹] [--to ELECTION_STAGE]` - Run an election until the specified stage: VOTE, REVEAL, or IDLE (default)
- `yarn workspace @joystream/pioneer node-mocks council:announce` - Announce enough candidacies to start the voting stage when the announcing stage ends
- `yarn workspace @joystream/pioneer node-mocks council:vote` - Vote for the announced by the previous command candidate to start the revealing stage next
- `yarn workspace @joystream/pioneer node-mocks council:reveal` - Reveal the votes casted by the previous command to start elect a new council and start the idle stage next
- `yarn workspace @joystream/pioneer node-mocks members:create` - generate memberships using query-node mocks data
- `yarn workspace @joystream/pioneer node-mocks set-budget` - Set membership Working Group budget
- `yarn workspace @joystream/pioneer node-mocks opening:create` - Create an opening
- `yarn workspace @joystream/pioneer node-mocks opening:create [-d BLOCK_TIME¹]` - Create an opening
- `yarn workspace @joystream/pioneer node-mocks opening:fill` - Fill existing opening
- `yarn workspace @joystream/pioneer node-mocks upcoming-opening:create` - Create an upcoming opening
- `yarn workspace @joystream/pioneer node-mocks forumCategory:create` - Create a forum category
- `yarn workspace @joystream/pioneer node-mocks transfer` - Transfer tokens between accounts

**(¹)** `BLOCK_TIME` is the time between each block. It is 6000ms by default but on testing chain it is 1000ms. Therefore when running some of the scripts on these testing chain `-d 1000` should be added for the command to succeed.

To show help:

```shell
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"build:storybook": "wsrun --fast-exit --stages -c --exclude @joystream/pioneer --exclude-missing build && wsrun --package @joystream/pioneer -c build:storybook",
"storybook": "wsrun --exclude-missing -c storybook",
"test": "wsrun --fast-exit --package @joystream/pioneer -c test",
"ci-test": "NODE_OPTIONS=--max_old_space_size=7000 wsrun --fast-exit --package @joystream/pioneer -c test",
"start": "wsrun --package @joystream/pioneer -c start",
"prepare": "husky install"
},
Expand All @@ -31,6 +30,12 @@
"lint-staged": ">=10"
},
"resolutions": {
"@babel/core": "~7.21.0",
"@babel/preset-env": "~7.21.0",
"@babel/generator": "~7.21.0",
"@babel/parser": "~7.21.0",
"@babel/traverse": "~7.21.0",
"@babel/types": "~7.21.0",
"@polkadot/api": "8.9.1",
"@polkadot/api-contract": "8.9.1",
"@polkadot/api-derive": "8.9.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/markdown-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"@ckeditor/ckeditor5-dev-webpack-plugin": "^25.4.5",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"prettier": "^2.4.1",
"prettier": "^2.8.8",
"raw-loader": "^4.0.2",
"terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.2.6",
"ts-node": "^10.4.0",
"typescript": "4.4.3",
"webpack": "^5.64.1",
"webpack-cli": "^4.9.1"
"typescript": "5",
"webpack": "5",
"webpack-cli": "5"
}
}
9 changes: 9 additions & 0 deletions packages/ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const baseConfig = require('../../.eslintrc.json')

const config = {
...baseConfig,
extends: ['plugin:storybook/recommended'],
}

const domains = ['accounts', 'memberships', 'working-groups']
Expand All @@ -26,6 +27,14 @@ config.rules['import/no-restricted-paths'] = [
},
]

config.overrides = [
...config.overrides,
{
files: ['**/*.stories.tsx'],
rules: { 'react-hooks/rules-of-hooks': 'off' },
},
]

config.ignorePatterns = [...config.ignorePatterns, 'src/bounty/**/*', 'test/bounty/**/*']

module.exports = config
14 changes: 8 additions & 6 deletions packages/ui/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
{
alias: {
'@/common/utils/crypto/worker$': path.resolve(__dirname, '../src/common/utils/crypto'),
'@apollo/client$': path.resolve(__dirname, '../src/mocks/providers/query-node'),
},
},
shared.resolve
Expand All @@ -31,20 +32,21 @@ module.exports = {

return config
},
core: {
builder: 'webpack5',
framework: {
name: '@storybook/react-webpack5',
options: {},
},
typescript: {
reactDocgen: 'none',
},
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-actions'],
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', '@storybook/addon-links'],
}

function isCssRule(rule) {
return rule.test.toString().indexOf('css') > -1
return rule.test?.toString().includes('css')
}

function isSvgRule(rule) {
return rule.test.toString().indexOf('svg') > -1
return rule.test?.toString().includes('svg')
}
Loading

1 comment on commit 3b1eeb6

@vercel
Copy link

@vercel vercel bot commented on 3b1eeb6 Jul 25, 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:

dao – ./

dao.joystream.org
dao-joystream.vercel.app
pioneerapp.xyz
dao-git-main-joystream.vercel.app

Please sign in to comment.