Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
83107dc
feat: add mergeUtXos function to handle UTXO merging with proposal fa…
kneerose Feb 13, 2025
c034ce1
feat: update proposalWallet to include multiple proposals and consoli…
kneerose Feb 13, 2025
5c28a7c
feat: refactor faucet teardown to use mergeUtXos with all test wallets
kneerose Feb 13, 2025
aaed5e8
feat: rename proposalWallet to proposalWallets for consistency
kneerose Feb 13, 2025
f203141
feat: add proposalFaucetWallet to static wallets
kneerose Feb 13, 2025
aa84b57
feat: simplify input handling in kuberService by removing redundant s…
kneerose Feb 13, 2025
6f80494
Merge pull request #2964 from IntersectMBO/feat/merge-utxos-on-faucet…
kneerose Feb 13, 2025
c9817f7
fix: proposal test due to updates on proposal type
kneerose Feb 13, 2025
7636db4
feat: add support for updates to the constitution in proposal creation
kneerose Feb 13, 2025
3c6404d
feat: add validation test for constitution proposal
kneerose Feb 13, 2025
463c6ee
feat: update review submission test for new constitution
kneerose Feb 13, 2025
e5b8898
feat: update form verification for new constitution
kneerose Feb 13, 2025
1e039f2
refactor: rename skipIfTreasuryAndBootstrapping to skipIfNotInfoAndBo…
kneerose Feb 13, 2025
ee09002
feat: add new proposal 8 wallet
kneerose Feb 13, 2025
e99b365
feat: add test for updating the constitution proposal draft
kneerose Feb 13, 2025
d519c20
fix: correct expected count for Governance actions visibility test
kneerose Feb 13, 2025
96fcaf8
feat: randomize proposal type selection in createProposal method
kneerose Feb 13, 2025
e749b11
feat(#2968): add workflow to update any of the @intersect.mbo package
MSzalowski Feb 13, 2025
624e32c
Merge pull request #2969 from IntersectMBO/feat/2968-automate-pillar-…
MSzalowski Feb 13, 2025
16be6c9
Merge pull request #2970 from IntersectMBO/tests/constitution-type-pr…
mesudip Feb 13, 2025
39eeae7
chore: update @intersect.mbo package workflow path adjustment
MSzalowski Feb 13, 2025
ef2e289
chore: add actor to PR description
MSzalowski Feb 13, 2025
e5aa99c
chore: branch name update
MSzalowski Feb 13, 2025
bffe7ed
chore: remove unnecessary step
MSzalowski Feb 13, 2025
26d50b4
chore: PR description changes
MSzalowski Feb 13, 2025
b9502f1
Merge pull request #2974 from IntersectMBO/feat/2968-automate-pillar-…
MSzalowski Feb 13, 2025
6d7698d
[create-pull-request] automated change
github-actions[bot] Feb 13, 2025
84a66b3
Merge pull request #2975 from IntersectMBO/chore/@intersect.mbo/pdf-u…
MSzalowski Feb 13, 2025
fc23c38
Merge pull request #2976 from IntersectMBO/develop
MSzalowski Feb 13, 2025
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
67 changes: 67 additions & 0 deletions .github/workflows/update-intersect-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "Update @intersect.mbo Package"

on:
workflow_dispatch:
inputs:
package_name:
description: "Select the @intersect.mbo package to update"
required: true
type: choice
options:
- "@intersect.mbo/govtool-outcomes-pillar-ui"
- "@intersect.mbo/intersectmbo.org-icons-set"
- "@intersect.mbo/pdf-ui"
new_version:
description: "Enter the new version (e.g., 1.1.0)"
required: true

jobs:
update_package:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org/"
node-version-file: "./govtool/frontend/.nvmrc"
scope: "@intersect.mbo"

- name: Update package version in frontend
run: |
PACKAGE_NAME="${{ github.event.inputs.package_name }}"
NEW_VERSION="${{ github.event.inputs.new_version }}"
PACKAGE_JSON_PATH="govtool/frontend/package.json"

echo "Updating $PACKAGE_NAME to version $NEW_VERSION in $PACKAGE_JSON_PATH..."

jq --arg pkg "$PACKAGE_NAME" --arg ver "$NEW_VERSION" \
'.dependencies[$pkg] = $ver' "$PACKAGE_JSON_PATH" > package.tmp.json \
&& mv package.tmp.json "$PACKAGE_JSON_PATH"

- name: Install dependencies in frontend
run: |
cd govtool/frontend
npm install

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: "chore/${{ github.event.inputs.package_name }}-${{ github.event.inputs.new_version }}"
title: "Update ${{ github.event.inputs.package_name }} to ${{ github.event.inputs.new_version }}"
body: |
This PR updates `${{ github.event.inputs.package_name }}` to version `${{ github.event.inputs.new_version }}`.


Workflow executed by `@${{ github.actor }}`.
labels: "dependencies"
sign-commits: true
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ changes.
- Add metadata url and hash to drep details [Issue 2911](https://github.com/IntersectMBO/govtool/issues/2911)
- Add CC votes percentages, not voted and Ratification threshold
- Add support for submitting all 7 governance action types [Issue 2258](https://github.com/IntersectMBO/govtool/issues/2258)
- Add workflow to automatically update any of the @intersect.mbo package [Issue 2968](https://github.com/IntersectMBO/govtool/issues/2968)

### Fixed

Expand Down
8 changes: 4 additions & 4 deletions govtool/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion govtool/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/govtool-outcomes-pillar-ui": "1.0.0",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.6.0",
"@intersect.mbo/pdf-ui": "0.6.1",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down
63 changes: 34 additions & 29 deletions govtool/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1367,15 +1367,15 @@
resolved "https://registry.npmjs.org/@emurgo/cardano-serialization-lib-asmjs/-/cardano-serialization-lib-asmjs-12.1.1.tgz"
integrity sha512-K3f28QUfLDJ7seO6MtKfMYtRm5ccf36TQ5yxyTmZqX1TA85MkriEdxqpgV9KLiLEA95emwnlvU2/WmlHMRPg1A==

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

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

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

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

"@parcel/[email protected]":
"@parcel/[email protected]":
version "2.5.0"
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.0.tgz"
integrity sha512-d9AOkusyXARkFD66S6zlGXyzx5RvY+chTP9Jp0ypSTC9d4lzyRs9ovGf/80VCxjKddcUvnsGwCHWuF2EoPgWjw==

"@parcel/[email protected]":
version "2.5.0"
resolved "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.0.tgz"
integrity sha512-hyZ3TANnzGfLpRA2s/4U1kbw2ZI4qGxaRJbBH2DCSREFfubMswheh8TeiC1sGZ3z2jUf3s37P0BBlrD3sjVTUw==
resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.0.tgz"
integrity sha512-iqOC+GoTDoFyk/VYSFHwjHhYrk8bljW6zOhPuhi5t9ulqiYq1togGJB5e3PwYVFFfeVgc6pbz3JdQyDoBszVaA==

"@parcel/watcher@^2.4.1":
version "2.5.0"
Expand Down Expand Up @@ -2282,10 +2287,15 @@
estree-walker "^2.0.2"
picomatch "^4.0.2"

"@rollup/[email protected]":
"@rollup/[email protected]":
version "4.27.4"
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.27.4.tgz"
integrity sha512-Ni8mMtfo+o/G7DVtweXXV/Ol2TFf63KYjTtoZ5f078AUgJTmaIJnj4JFU7TK/9SVWTaSJGxPi5zMDgK4w+Ez7Q==

"@rollup/[email protected]":
version "4.27.4"
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.27.4.tgz"
integrity sha512-PlNiRQapift4LNS8DPUHuDX/IdXiLjf8mc5vdEmUR0fF/pyy2qWwzdLjB+iZquGr8LuN4LnUoSEvKRwjSVYz3Q==
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.27.4.tgz"
integrity sha512-5AeeAF1PB9TUzD+3cROzFTnAJAcVUGLuR8ng0E0WXGkYhp6RD6L+6szYVX+64Rs0r72019KHZS1ka1q+zU/wUw==

"@rtsao/scc@^1.1.0":
version "1.1.0"
Expand Down Expand Up @@ -2864,10 +2874,15 @@
"@svgr/plugin-svgo" "^5.5.0"
loader-utils "^2.0.0"

"@swc/core-darwin-arm64@1.9.3":
"@swc/core-linux-x64-gnu@1.9.3":
version "1.9.3"
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.9.3.tgz"
integrity sha512-hGfl/KTic/QY4tB9DkTbNuxy5cV4IeejpPD4zo+Lzt4iLlDWIeANL4Fkg67FiVceNJboqg48CUX+APhDHO5G1w==
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.9.3.tgz"
integrity sha512-ivXXBRDXDc9k4cdv10R21ccBmGebVOwKXT/UdH1PhxUn9m/h8erAWjz5pcELwjiMf27WokqPgaWVfaclDbgE+w==

"@swc/[email protected]":
version "1.9.3"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.9.3.tgz"
integrity sha512-ILsGMgfnOz1HwdDz+ZgEuomIwkP1PHT6maigZxaCIuC6OPEhKE8uYna22uU63XvYcLQvZYDzpR3ms47WQPuNEg==

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

fsevents@^2.3.2, fsevents@~2.3.2, fsevents@~2.3.3:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

[email protected]:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down
9 changes: 9 additions & 0 deletions tests/govtool-frontend/playwright/lib/_mock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ export const invalid = {
return " ";
},

constitutionUrl: () => {
const choice = faker.number.int({ min: 1, max: 2 });
if (choice === 1) {
return invalid.url();
}
// empty invalid
return " ";
},

paragraph: (maxCharacter: number) => {
const choice = faker.number.int({ min: 1, max: 2 });
if (choice === 1) {
Expand Down
9 changes: 9 additions & 0 deletions tests/govtool-frontend/playwright/lib/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ export const SECURITY_RELEVANT_PARAMS_MAP: Record<string, string> = {
govActionDeposit: "gov_action_deposit",
minFeeRefScriptCostPerByte: "min_fee_ref_script_cost_per_byte",
};

export const PROPOSAL_TYPE_FILTERS = [
"Info Action",
"Treasury requests",
"Updates to the Constitution",
];
export const BOOTSTRAP_PROPOSAL_TYPE_FILTERS = ["Info Action"];

export const PROPOSAL_STATUS_FILTER = ["Submitted for vote", "Active proposal"];
22 changes: 21 additions & 1 deletion tests/govtool-frontend/playwright/lib/constants/staticWallets.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const staticWallets: StaticWallet[] = require("../_mock/wallets.json");
import { StaticWallet } from "@types";
import { proposalFaucetWallet } from "./proposalFaucetWallet";
export const faucetWallet = staticWallets[0];

export const dRep01Wallet = staticWallets[1];
Expand All @@ -23,6 +24,7 @@ export const proposal04Wallet: StaticWallet = staticWallets[13];
export const proposal05Wallet: StaticWallet = staticWallets[14];
export const proposal06Wallet: StaticWallet = staticWallets[15];
export const proposal07Wallet: StaticWallet = staticWallets[16];
export const proposal08Wallet: StaticWallet = staticWallets[17];

export const adaHolderWallets = [
adaHolder01Wallet,
Expand All @@ -37,4 +39,22 @@ export const userWallets = [user01Wallet];

export const dRepWallets = [dRep01Wallet, dRep02Wallet];

export const proposalWallets = [proposal01Wallet];
export const proposalWallets = [
proposal01Wallet,
proposal02Wallet,
proposal03Wallet,
proposal04Wallet,
proposal05Wallet,
proposal06Wallet,
proposal07Wallet,
proposal08Wallet,
];

export const allStaticWallets = [
...dRepWallets,
...adaHolderWallets,
user01Wallet,
...proposalWallets,
faucetWallet,
proposalFaucetWallet,
];
4 changes: 2 additions & 2 deletions tests/govtool-frontend/playwright/lib/helpers/cardano.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export async function isBootStrapingPhase() {
return protocolParameterMajorVersion === 9;
}

export async function skipIfTreasuryAndBootstrapping(type: ProposalType) {
export async function skipIfNotInfoAndBootstrapping(type: ProposalType) {
const isBootStraping = await isBootStrapingPhase();
if (type === ProposalType.treasury && isBootStraping) {
if (type !== ProposalType.info && isBootStraping) {
await allure.description(
"This Features will be available only after hardfork."
);
Expand Down
9 changes: 7 additions & 2 deletions tests/govtool-frontend/playwright/lib/helpers/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ export async function downloadMetadata(download: Download): Promise<{
return { name: download.suggestedFilename(), data: jsonData };
}

export function calculateHash(data: string) {
const buffer = Buffer.from(data, "utf8");
const hexDigest = blake.blake2bHex(buffer, null, 32);
return hexDigest;
}

async function calculateMetadataHash() {
try {
const paymentAddress = (await ShelleyWallet.generate()).addressBech32(
Expand All @@ -39,8 +45,7 @@ async function calculateMetadataHash() {
2
);

const buffer = Buffer.from(data, "utf8");
const hexDigest = blake.blake2bHex(buffer, null, 32);
const hexDigest = calculateHash(data);

const jsonData = JSON.parse(data);
return { hexDigest, jsonData };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { faker } from "@faker-js/faker";
import { generateWalletAddress } from "@helpers/cardano";
import { extractProposalIdFromUrl } from "@helpers/string";
import { expect, Locator, Page } from "@playwright/test";
import { ProposalCreateRequest, ProposedGovAction } from "@types";
import environments from "lib/constants/environments";
import ProposalDiscussionDetailsPage from "./proposalDiscussionDetailsPage";
import { isMobile } from "@helpers/mobile";
import { PROPOSAL_TYPE_FILTERS } from "@constants/index";

export default class ProposalDiscussionPage {
// Buttons
Expand All @@ -19,8 +16,10 @@ export default class ProposalDiscussionPage {
readonly showAllBtn = this.page.getByTestId("show-all-button").first(); //this.page.getByTestId("show-all-button");
readonly verifyIdentityBtn = this.page.getByTestId("verify-identity-button");
readonly addLinkBtn = this.page.getByTestId("add-link-button");
readonly infoRadio = this.page.getByTestId("Info-radio-wrapper");
readonly treasuryRadio = this.page.getByTestId("Treasury-radio-wrapper");
readonly infoRadio = this.page.getByTestId("info action-radio-wrapper");
readonly treasuryRadio = this.page.getByTestId(
"treasury requests-radio-wrapper"
);
readonly activeProposalWrapper = this.page.getByTestId(
"active-proposal-radio-wrapper"
);
Expand Down Expand Up @@ -112,10 +111,10 @@ export default class ProposalDiscussionPage {

async clickRadioButtonsByNames(names: string[]) {
for (const name of names) {
const replaceSpaceWithUnderScore = name.toLowerCase().replace(/ /g, "-");
await this.page
.getByTestId(`${replaceSpaceWithUnderScore}-radio`)
.click();
const testId = PROPOSAL_TYPE_FILTERS.includes(name)
? name.toLowerCase()
: name.toLowerCase().replace(/ /g, "-");
await this.page.getByTestId(`${testId}-radio`).click();
}
}

Expand Down
Loading
Loading