Skip to content

Commit 0ee819e

Browse files
authored
Merge pull request #2978 from IntersectMBO/test
chore: bump @intersect.mbo/[email protected]
2 parents 8be0f19 + fc23c38 commit 0ee819e

File tree

20 files changed

+406
-82
lines changed

20 files changed

+406
-82
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "Update @intersect.mbo Package"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
package_name:
7+
description: "Select the @intersect.mbo package to update"
8+
required: true
9+
type: choice
10+
options:
11+
- "@intersect.mbo/govtool-outcomes-pillar-ui"
12+
- "@intersect.mbo/intersectmbo.org-icons-set"
13+
- "@intersect.mbo/pdf-ui"
14+
new_version:
15+
description: "Enter the new version (e.g., 1.1.0)"
16+
required: true
17+
18+
jobs:
19+
update_package:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
registry-url: "https://registry.npmjs.org/"
35+
node-version-file: "./govtool/frontend/.nvmrc"
36+
scope: "@intersect.mbo"
37+
38+
- name: Update package version in frontend
39+
run: |
40+
PACKAGE_NAME="${{ github.event.inputs.package_name }}"
41+
NEW_VERSION="${{ github.event.inputs.new_version }}"
42+
PACKAGE_JSON_PATH="govtool/frontend/package.json"
43+
44+
echo "Updating $PACKAGE_NAME to version $NEW_VERSION in $PACKAGE_JSON_PATH..."
45+
46+
jq --arg pkg "$PACKAGE_NAME" --arg ver "$NEW_VERSION" \
47+
'.dependencies[$pkg] = $ver' "$PACKAGE_JSON_PATH" > package.tmp.json \
48+
&& mv package.tmp.json "$PACKAGE_JSON_PATH"
49+
50+
- name: Install dependencies in frontend
51+
run: |
52+
cd govtool/frontend
53+
npm install
54+
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v7
57+
with:
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
branch: "chore/${{ github.event.inputs.package_name }}-${{ github.event.inputs.new_version }}"
60+
title: "Update ${{ github.event.inputs.package_name }} to ${{ github.event.inputs.new_version }}"
61+
body: |
62+
This PR updates `${{ github.event.inputs.package_name }}` to version `${{ github.event.inputs.new_version }}`.
63+
64+
65+
Workflow executed by `@${{ github.actor }}`.
66+
labels: "dependencies"
67+
sign-commits: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ changes.
1515
- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)
1616
- Add CC votes percentages, not voted and Ratification threshold
1717
- Add support for submitting all 7 governance action types [Issue 2258](https://github.com/IntersectMBO/govtool/issues/2258)
18+
- Add workflow to automatically update any of the @intersect.mbo package [Issue 2968](https://github.com/IntersectMBO/govtool/issues/2968)
1819

1920
### Fixed
2021

govtool/frontend/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"@hookform/resolvers": "^3.3.1",
3030
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.0.0",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "^0.6.0",
32+
"@intersect.mbo/pdf-ui": "0.6.1",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@rollup/plugin-babel": "^6.0.4",

govtool/frontend/yarn.lock

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,15 +1367,15 @@
13671367
resolved "https://registry.npmjs.org/@emurgo/cardano-serialization-lib-asmjs/-/cardano-serialization-lib-asmjs-12.1.1.tgz"
13681368
integrity sha512-K3f28QUfLDJ7seO6MtKfMYtRm5ccf36TQ5yxyTmZqX1TA85MkriEdxqpgV9KLiLEA95emwnlvU2/WmlHMRPg1A==
13691369

1370-
"@esbuild/darwin-arm64@0.21.5":
1370+
"@esbuild/linux-x64@0.21.5":
13711371
version "0.21.5"
1372-
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz"
1373-
integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==
1372+
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz"
1373+
integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==
13741374

1375-
"@esbuild/darwin-arm64@0.24.2":
1375+
"@esbuild/linux-x64@0.24.2":
13761376
version "0.24.2"
1377-
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz"
1378-
integrity sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==
1377+
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz"
1378+
integrity sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==
13791379

13801380
"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
13811381
version "4.4.1"
@@ -1505,10 +1505,10 @@
15051505
resolved "https://registry.npmjs.org/@intersect.mbo/intersectmbo.org-icons-set/-/intersectmbo.org-icons-set-1.1.0.tgz"
15061506
integrity sha512-sjKEtnK9eLYH/8kCD0YRQCms3byFA/tnSsei9NHTZbBYX9sBpeX6ErfR0sKYjOSxQOxl4FumX9D0X+vHIqxo8g==
15071507

1508-
"@intersect.mbo/pdf-ui@^0.6.0":
1509-
version "0.6.0"
1510-
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.0.tgz"
1511-
integrity sha512-4lNDqUp03UQEy5Fwu2kTewM8Jxfc5uNxk7h40wOWx4zNIIOos187kF1NsE8yW2/VXRSkklsxSbc1ckifEJJakw==
1508+
"@intersect.mbo/[email protected].1":
1509+
version "0.6.1"
1510+
resolved "https://registry.npmjs.org/@intersect.mbo/pdf-ui/-/pdf-ui-0.6.1.tgz"
1511+
integrity sha512-XtA5kGkOiZ8ydEOlgJbf98t6nL1yf97MAUgpiRalhAOg2IRQrrJMhr+egrovDthB/xwNJszwHwMuRKBgAsbdyA==
15121512
dependencies:
15131513
"@emurgo/cardano-serialization-lib-asmjs" "^12.0.0-beta.2"
15141514
"@fontsource/poppins" "^5.0.14"
@@ -2166,10 +2166,15 @@
21662166
resolved "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz"
21672167
integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==
21682168

2169-
2169+
2170+
version "2.5.0"
2171+
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz"
2172+
integrity sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==
2173+
2174+
21702175
version "2.5.0"
2171-
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz"
2172-
integrity sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==
2176+
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz"
2177+
integrity sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==
21732178

21742179
"@parcel/watcher@^2.4.1":
21752180
version "2.5.0"
@@ -2282,10 +2287,15 @@
22822287
estree-walker "^2.0.2"
22832288
picomatch "^4.0.2"
22842289

2285-
2290+
2291+
version "4.27.4"
2292+
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz"
2293+
integrity sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==
2294+
2295+
22862296
version "4.27.4"
2287-
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz"
2288-
integrity sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==
2297+
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz"
2298+
integrity sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==
22892299

22902300
"@rtsao/scc@^1.1.0":
22912301
version "1.1.0"
@@ -2864,10 +2874,15 @@
28642874
"@svgr/plugin-svgo" "^5.5.0"
28652875
loader-utils "^2.0.0"
28662876

2867-
"@swc/core-darwin-arm64@1.9.3":
2877+
"@swc/core-linux-x64-gnu@1.9.3":
28682878
version "1.9.3"
2869-
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.9.3.tgz"
2870-
integrity sha512-hGfl/KTic/QY4tB9DkTbNuxy5cV4IeejpPD4zo+Lzt4iLlDWIeANL4Fkg67FiVceNJboqg48CUX+APhDHO5G1w==
2879+
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.9.3.tgz"
2880+
integrity sha512-ivXXBRDXDc9k4cdv10R21ccBmGebVOwKXT/UdH1PhxUn9m/h8erAWjz5pcELwjiMf27WokqPgaWVfaclDbgE+w==
2881+
2882+
2883+
version "1.9.3"
2884+
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.9.3.tgz"
2885+
integrity sha512-ILsGMgfnOz1HwdDz+ZgEuomIwkP1PHT6maigZxaCIuC6OPEhKE8uYna22uU63XvYcLQvZYDzpR3ms47WQPuNEg==
28712886

28722887
"@swc/core@*", "@swc/core@^1.5.22", "@swc/core@^1.7.26":
28732888
version "1.9.3"
@@ -7173,16 +7188,6 @@ fs@^0.0.1-security:
71737188
resolved "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz"
71747189
integrity sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==
71757190

7176-
fsevents@^2.3.2, fsevents@~2.3.2, fsevents@~2.3.3:
7177-
version "2.3.3"
7178-
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
7179-
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
7180-
7181-
7182-
version "2.3.2"
7183-
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
7184-
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
7185-
71867191
function-bind@^1.1.2:
71877192
version "1.1.2"
71887193
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"

tests/govtool-frontend/playwright/lib/_mock/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ export const invalid = {
8080
return " ";
8181
},
8282

83+
constitutionUrl: () => {
84+
const choice = faker.number.int({ min: 1, max: 2 });
85+
if (choice === 1) {
86+
return invalid.url();
87+
}
88+
// empty invalid
89+
return " ";
90+
},
91+
8392
paragraph: (maxCharacter: number) => {
8493
const choice = faker.number.int({ min: 1, max: 2 });
8594
if (choice === 1) {

tests/govtool-frontend/playwright/lib/constants/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ export const SECURITY_RELEVANT_PARAMS_MAP: Record<string, string> = {
1010
govActionDeposit: "gov_action_deposit",
1111
minFeeRefScriptCostPerByte: "min_fee_ref_script_cost_per_byte",
1212
};
13+
14+
export const PROPOSAL_TYPE_FILTERS = [
15+
"Info Action",
16+
"Treasury requests",
17+
"Updates to the Constitution",
18+
];
19+
export const BOOTSTRAP_PROPOSAL_TYPE_FILTERS = ["Info Action"];
20+
21+
export const PROPOSAL_STATUS_FILTER = ["Submitted for vote", "Active proposal"];

tests/govtool-frontend/playwright/lib/constants/staticWallets.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const staticWallets: StaticWallet[] = require("../_mock/wallets.json");
22
import { StaticWallet } from "@types";
3+
import { proposalFaucetWallet } from "./proposalFaucetWallet";
34
export const faucetWallet = staticWallets[0];
45

56
export const dRep01Wallet = staticWallets[1];
@@ -23,6 +24,7 @@ export const proposal04Wallet: StaticWallet = staticWallets[13];
2324
export const proposal05Wallet: StaticWallet = staticWallets[14];
2425
export const proposal06Wallet: StaticWallet = staticWallets[15];
2526
export const proposal07Wallet: StaticWallet = staticWallets[16];
27+
export const proposal08Wallet: StaticWallet = staticWallets[17];
2628

2729
export const adaHolderWallets = [
2830
adaHolder01Wallet,
@@ -37,4 +39,22 @@ export const userWallets = [user01Wallet];
3739

3840
export const dRepWallets = [dRep01Wallet, dRep02Wallet];
3941

40-
export const proposalWallets = [proposal01Wallet];
42+
export const proposalWallets = [
43+
proposal01Wallet,
44+
proposal02Wallet,
45+
proposal03Wallet,
46+
proposal04Wallet,
47+
proposal05Wallet,
48+
proposal06Wallet,
49+
proposal07Wallet,
50+
proposal08Wallet,
51+
];
52+
53+
export const allStaticWallets = [
54+
...dRepWallets,
55+
...adaHolderWallets,
56+
user01Wallet,
57+
...proposalWallets,
58+
faucetWallet,
59+
proposalFaucetWallet,
60+
];

tests/govtool-frontend/playwright/lib/helpers/cardano.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export async function isBootStrapingPhase() {
2727
return protocolParameterMajorVersion === 9;
2828
}
2929

30-
export async function skipIfTreasuryAndBootstrapping(type: ProposalType) {
30+
export async function skipIfNotInfoAndBootstrapping(type: ProposalType) {
3131
const isBootStraping = await isBootStrapingPhase();
32-
if (type === ProposalType.treasury && isBootStraping) {
32+
if (type !== ProposalType.info && isBootStraping) {
3333
await allure.description(
3434
"This Features will be available only after hardfork."
3535
);

tests/govtool-frontend/playwright/lib/helpers/metadata.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export async function downloadMetadata(download: Download): Promise<{
2121
return { name: download.suggestedFilename(), data: jsonData };
2222
}
2323

24+
export function calculateHash(data: string) {
25+
const buffer = Buffer.from(data, "utf8");
26+
const hexDigest = blake.blake2bHex(buffer, null, 32);
27+
return hexDigest;
28+
}
29+
2430
async function calculateMetadataHash() {
2531
try {
2632
const paymentAddress = (await ShelleyWallet.generate()).addressBech32(
@@ -39,8 +45,7 @@ async function calculateMetadataHash() {
3945
2
4046
);
4147

42-
const buffer = Buffer.from(data, "utf8");
43-
const hexDigest = blake.blake2bHex(buffer, null, 32);
48+
const hexDigest = calculateHash(data);
4449

4550
const jsonData = JSON.parse(data);
4651
return { hexDigest, jsonData };

0 commit comments

Comments
 (0)