Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring staging up to date with main #1458

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 0 # Fetch all history for all branches

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: mkdir -p ~/.npm
Expand Down Expand Up @@ -114,8 +117,15 @@ jobs:
git config user.name "prosoponator[bot]"
git config user.email "[email protected]"
# check the source branch (e.g. staging) is up-to-date with the dest branch (e.g. main)
if [ "$(git rev-list --count origin/${{ github.event.inputs.src }}..origin/${{ github.event.inputs.dest }})" -ne 0 ]; then
echo "Source branch ${{ github.event.inputs.src }} is not up-to-date with destination branch ${{ github.event.inputs.dest }}. PR destination branch into the source branch and try again."
exit 1
else
echo "Source branch ${{ github.event.inputs.src }} is up-to-date with destination branch ${{ github.event.inputs.dest }}"
fi
# checkout the src branch
git fetch --all
git checkout ${{ github.event.inputs.src }}
INTERIM="${{ github.event.inputs.interim}}"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

# make cache dirs, these must exist before doing cache stuff
- run: mkdir -p ~/.npm
Expand All @@ -74,7 +76,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress
Expand All @@ -92,7 +94,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress
Expand All @@ -91,7 +93,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ls_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/provider_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress
Expand All @@ -91,7 +93,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
npm-${{ runner.os }}-${{ runner.arch }}-
- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Detect env
id: env
Expand Down Expand Up @@ -124,7 +126,7 @@ jobs:
echo "docker_latest_tag=staging";
echo "docker_version_tag=staging";
echo "gh_release_tag=staging-release"
echo "gh_prelease=true"
echo "gh_prerelease=true"
} >> $GITHUB_OUTPUT
else
echo "cannot deploy from branch ${{ github.ref }}"
Expand All @@ -133,7 +135,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand All @@ -156,6 +158,7 @@ jobs:
- name: Mark Github release as prerelease
if: ${{ steps.env.outputs.gh_prerelease }}
continue-on-error: true # don't fail the workflow if the release can't be resolved
run: |
gh release edit "${{ steps.env.outputs.gh_release_tag }}" --prerelease
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- run: mkdir -p ~/.npm
- run: mkdir -p ~/.cache/Cypress
Expand All @@ -92,7 +94,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'
- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- run: npm ci
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Run prosoponator bot on any comments
# update staging on push to main

name: prosoponator_bot
name: update_staging

on: issue_comment
on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
GH_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
CARGO_TERM_COLOR: always
NODE_OPTIONS: "--max-old-space-size=4096"

defaults:
run:
shell: bash

jobs:
comment:
# This job only runs for pull request comments
if: ${{ github.event.issue.pull_request && github.event.pull_request.draft == false }}
deploy:
runs-on: ubuntu-latest
steps:
- name: Print contexts
Expand Down Expand Up @@ -59,16 +60,26 @@ jobs:
echo "******************************"
- uses: actions/checkout@v4
with:
submodules: "recursive"

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'package.json'

- run: npm i -g "npm@$(jq -r .engines.npm < package.json)"

- name: Run
env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
- name: PR main into staging
run: |
npm ci
cd dev/prosoponator-bot
npx tsx src/bot.ts
set -euo pipefail # stop on errors, print commands, fail on pipe fails
# set the author in git
git config user.name "prosoponator[bot]"
git config user.email "[email protected]"
# checkout the src branch
git fetch --all
git checkout main
# create a PR for the release
gh pr create --base staging --title "Bring staging up to date with main" --fill
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

6 changes: 5 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"**/*.jsonc",
"**/*.css"
],
"ignore": ["./packages/detector/src/index.js", "*.bundle.js"]
"ignore": [
"./packages/detector/src/index.js",
"*.bundle.js",
"./packages/provider/src/tasks/detection/decodePayload.js"
]
},
"linter": {
"rules": {
Expand Down
6 changes: 3 additions & 3 deletions demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"start": "vite serve ./src --port 9232 --config vite.config.ts",
"clean": "echo 'nothing to clean'"
},
"version": "2.1.4",
"version": "2.1.5",
"devDependencies": {
"@prosopo/dotenv": "2.1.4",
"@prosopo/dotenv": "2.1.5",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"del-cli": "6.0.0",
"tslib": "2.7.0",
"tsx": "4.19.1",
"typescript": "5.6.2",
Expand Down
2 changes: 1 addition & 1 deletion demos/client-bundle-example/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h1>Example Login Form</h1>
></div>
</div>
<div id="messageContainer" style="display: none; color: black;"><span id="message"></span></div>
<button type="button" class="mui-btn mui-btn--raised" onclick="onActionHandler()">Submit</button>
<button type="button" class="mui-btn mui-btn--raised" onclick="onActionHandler()" data-cy="submit-button">Submit</button>
</form>
</div>
<script type="module">
Expand Down
18 changes: 9 additions & 9 deletions demos/client-example-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/client-example-server",
"version": "2.1.4",
"version": "2.1.5",
"description": "Backend for client-example",
"main": "dist/app.js",
"type": "module",
Expand Down Expand Up @@ -32,12 +32,12 @@
"@noble/hashes": "1.5.0",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/common": "2.1.4",
"@prosopo/contract": "2.1.4",
"@prosopo/dotenv": "2.1.4",
"@prosopo/server": "2.1.4",
"@prosopo/types": "2.1.4",
"@prosopo/util": "2.1.4",
"@prosopo/common": "2.1.5",
"@prosopo/contract": "2.1.5",
"@prosopo/dotenv": "2.1.5",
"@prosopo/server": "2.1.5",
"@prosopo/types": "2.1.5",
"@prosopo/util": "2.1.5",
"@typegoose/auto-increment": "4.6.0",
"cors": "2.8.5",
"express": "4.21.0",
Expand All @@ -47,12 +47,12 @@
"zod": "3.23.8"
},
"devDependencies": {
"@prosopo/config": "2.1.4",
"@prosopo/config": "2.1.5",
"@types/jsonwebtoken": "9.0.6",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"del-cli": "6.0.0",
"tslib": "2.7.0",
"tsx": "4.19.1",
"typescript": "5.6.2",
Expand Down
24 changes: 12 additions & 12 deletions demos/client-example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prosopo/client-example",
"version": "2.1.4",
"version": "2.1.5",
"private": true,
"type": "module",
"engines": {
Expand All @@ -13,14 +13,14 @@
"@mui/material": "5.9.1",
"@polkadot/extension-dapp": "0.46.9",
"@polkadot/extension-inject": "0.46.9",
"@prosopo/common": "2.1.4",
"@prosopo/locale-browser": "2.1.4",
"@prosopo/procaptcha-frictionless": "2.1.4",
"@prosopo/procaptcha-pow": "2.1.4",
"@prosopo/procaptcha-react": "2.1.4",
"@prosopo/server": "2.1.4",
"@prosopo/types": "2.1.4",
"@prosopo/vite-plugin-watch-workspace": "2.1.4",
"@prosopo/common": "2.1.5",
"@prosopo/locale-browser": "2.1.5",
"@prosopo/procaptcha-frictionless": "2.1.5",
"@prosopo/procaptcha-pow": "2.1.5",
"@prosopo/procaptcha-react": "2.1.5",
"@prosopo/server": "2.1.5",
"@prosopo/types": "2.1.5",
"@prosopo/vite-plugin-watch-workspace": "2.1.5",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"react": "18.3.1",
Expand All @@ -40,13 +40,13 @@
}
},
"devDependencies": {
"@prosopo/config": "2.1.4",
"@prosopo/dotenv": "2.1.4",
"@prosopo/config": "2.1.5",
"@prosopo/dotenv": "2.1.5",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"del-cli": "6.0.0",
"tslib": "2.7.0",
"tsx": "4.19.1",
"typescript": "5.6.2",
Expand Down
1 change: 1 addition & 0 deletions demos/client-example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function App(props: AppProps) {
onClick={onActionHandler}
aria-label={isLogin ? "Login" : "Sign up"}
disabled={!procaptchaToken}
data-cy="submit-button"
>
{isLogin ? "Login" : "Sign up"}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("Captchas", () => {

cy.intercept("POST", "/signup").as("signup");

cy.get('button[type="button"]').first().click();
cy.get('button[data-cy="submit-button"]').first().click();

cy.wait("@signup").then((interception) => {
const body = interception.response?.body;
Expand Down
Loading
Loading