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

GovTool - v1.0.29 #2475

Merged
merged 43 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
12ed8db
chore: Update docs URLs to reflect recent changes in the docs
kneerose Dec 2, 2024
655ef8a
feat: add blockfrost service to submit transaction
kneerose Dec 3, 2024
c6ec51c
chore: sign transaction with Kuber and submit via Blockfrost
kneerose Dec 3, 2024
aa8e27f
chore: add blockfrost api key on workflow env
kneerose Dec 3, 2024
7bed9e4
chore: use blockfrost apiUrl from env
kneerose Dec 3, 2024
856651a
chore: bump cardano-test-wallet version to 3.0.0
kneerose Dec 3, 2024
e599e73
chore: add blockfrost url and api key on wallet config
kneerose Dec 3, 2024
4edc792
Merge pull request #2453 from IntersectMBO/fix/transaction-submit
kneerose Dec 4, 2024
c6de82d
Merge pull request #2451 from IntersectMBO/fix/test-broken-guides-links
kneerose Dec 4, 2024
ca8e7fc
chore: update proposal.details type and add additional field types
kneerose Dec 4, 2024
739c227
chore: use kuber api url from github vars
kneerose Dec 4, 2024
9da2cde
chore: add missing kuber api key env on backend test workflow
kneerose Dec 4, 2024
6e04854
chore: set kuber api url and faucet url based on network
kneerose Dec 4, 2024
fcf3cf0
chore: use faucet api key based on network
kneerose Dec 4, 2024
56f70bf
refactor: remove unwanted env and get api keys based on network
kneerose Dec 4, 2024
f4cdaa8
Merge pull request #2461 from IntersectMBO/bugfix/backend-test-type
kneerose Dec 4, 2024
460b5ca
Merge pull request #2463 from IntersectMBO/refactor/test-env
kneerose Dec 4, 2024
1d043cb
fix: backend and integration test faucet and blockfrost env
kneerose Dec 4, 2024
66762f1
Merge pull request #2465 from IntersectMBO/refactor/test-env
kneerose Dec 4, 2024
5254aad
fix(#2398): fix unnecessary node remove in metadata actions
MSzalowski Dec 3, 2024
e78f6e6
Merge pull request #2459 from IntersectMBO/fix/2398-sentry-report-on-…
MSzalowski Dec 4, 2024
8c2c67b
[#2450] Initialize Sentry service at application start
placek Dec 4, 2024
3406fa5
fix: use first dRep-eligible governance action in dRep vote dependent…
kneerose Dec 4, 2024
99f8f06
fix: parallelize bootstrap dRep vote tests and improve visibility checks
kneerose Dec 5, 2024
cb148f5
chore: remove unnecessary async from areCCVoteTotalsDisplayed
kneerose Dec 5, 2024
368e448
fix: governance action type typo
kneerose Dec 5, 2024
20665ae
chore: add assertion on governance list to wait until loading button …
kneerose Dec 5, 2024
8f32f9d
Merge pull request #2470 from IntersectMBO/fix/2450-optimizing-sentry…
placek Dec 5, 2024
a2c1820
feat(#1806): add support for CIP-119 DRep images
MSzalowski Dec 3, 2024
b083832
Merge pull request #2456 from IntersectMBO/feat/1806-cip-119-drep-met…
MSzalowski Dec 5, 2024
efd3d7b
fix(#2408): fix app crash on delegation
MSzalowski Dec 3, 2024
4ae0474
Merge pull request #2457 from IntersectMBO/fix/2408-blank-screen-appe…
MSzalowski Dec 5, 2024
97fdf9a
chore(#2411): bump cardano db-sync to 13.6.0.4
MSzalowski Dec 3, 2024
c831fb0
Merge pull request #2458 from IntersectMBO/chore/2411-bump-dbsync-to-…
MSzalowski Dec 5, 2024
cbd9430
chore: bump @intersect.mbo/pdf-ui to v0.5.3
MSzalowski Dec 4, 2024
e9acc1b
Merge pull request #2466 from IntersectMBO/chore/bump-pdf-ui-to-v0.5.3
MSzalowski Dec 5, 2024
7f79d60
fix(#2417): fix broken guides links
MSzalowski Dec 4, 2024
d0463dc
Merge pull request #2467 from IntersectMBO/fix/2417-fix-broken-guides…
MSzalowski Dec 5, 2024
390a14b
Merge pull request #2471 from IntersectMBO/bugfix/governance-dRep-vot…
kneerose Dec 5, 2024
a2a19cc
chore: bump @intersect.mbo/pdf-ui to v0.5.4
MSzalowski Dec 5, 2024
c58de9b
Merge pull request #2473 from IntersectMBO/chore/bump-pdf-ui-to-v0.5.4
MSzalowski Dec 5, 2024
1c40094
chore: bump GovTool to v1.0.29
MSzalowski Dec 5, 2024
fb87566
Merge pull request #2474 from IntersectMBO/chore/bump-govtool-to-v1.0.29
MSzalowski Dec 5, 2024
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
18 changes: 16 additions & 2 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,26 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [[ "${{ env.NETWORK }}" == "preprod" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREPROD }}"
elif [[ "${{ env.NETWORK }}" == "sanchonet" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_SANCHONET }}"
else
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREVIEW }}"
fi
python ./setup.py
python -m pytest --alluredir allure-results
if [[ "${{ env.NETWORK }}" == "preprod" ]]; then
echo "FAUCET_API_KEY=${{ secrets.FAUCET_API_KEY_PREPROD }}" >> $GITHUB_ENV
elif [[ "${{ env.NETWORK }}" == "sanchonet" ]]; then
echo "FAUCET_API_KEY=${{ secrets.FAUCET_API_KEY_SANCHONET }}" >> $GITHUB_ENV
else
echo "FAUCET_API_KEY=${{ secrets.FAUCET_API_KEY_PREVIEW }}" >> $GITHUB_ENV
fi
env:
BASE_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io/api' }}
FAUCET_API_KEY: ${{ secrets.FAUCET_API_KEY }}
KUBER_API_URL: https://kuber-govtool.cardanoapi.io
NETWORK: ${{ vars.NETWORK }}
KUBER_API_KEY: ${{ secrets.KUBER_API_KEY }}

- name: Upload report
if: always()
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ jobs:
mkdir -p ./lib/_mock
chmod +w ./lib/_mock
npm run generate-wallets
if [[ "${{ env.NETWORK }}" == "preprod" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREPROD }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_PREPROD }}"
elif [[ "${{ env.NETWORK }}" == "sanchonet" ]]; then
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_SANCHONET }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_SANCHONET }}"
else
export FAUCET_API_KEY="${{ secrets.FAUCET_API_KEY_PREVIEW }}"
export BLOCKFROST_API_KEY="${{ secrets.BLOCKFROST_API_KEY_PREVIEW }}"
fi
npm test


- name: Upload report
uses: actions/upload-artifact@v3
Expand All @@ -74,9 +85,6 @@ jobs:
HOST_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io' }}
API_URL: https://${{inputs.deployment || 'govtool.cardanoapi.io' }}/api
DOCS_URL: ${{ vars.DOCS_URL }}
FAUCET_API_URL: ${{ vars.FAUCET_API_URL }}
FAUCET_API_KEY: ${{secrets.FAUCET_API_KEY}}
KUBER_API_URL: ${{vars.KUBER_API_URL}}
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
TEST_WORKERS: ${{vars.TEST_WORKERS}}
CI: ${{vars.CI}}
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,35 @@ changes.

### Fixed

-

### Changed

-

### Removed

-

## [v1.0.29](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.29) 2024-12-05

### Added

- Add support for displaying CIP-119 DRep images [Issue 1806](https://github.com/IntersectMBO/govtool/issues/1806)

### Fixed

- Fix fetching voting power of newly registerd DRep [Issue 2407](https://github.com/IntersectMBO/govtool/issues/2407)
- Fix inconsistent voting status [Issue 1713](https://github.com/IntersectMBO/govtool/issues/1713)
- Fix removing a child (link) when is not registed in DOM [Issue 2398](https://github.com/IntersectMBO/govtool/issues/2398)
- Fix blank screen on DRep delegation when UTXos are missing [Issue 2408](https://github.com/IntersectMBO/govtool/issues/2408)
- Fix broken guides links [Issue 2417](https://github.com/IntersectMBO/govtool/issues/2417)

### Changed

-
- Bump cardano-db-sync to 13.6.0.4 [Issue 2411](https://github.com/IntersectMBO/govtool/issues/2411)
- Bump @intersect.mbo/pdf-ui to v0.5.3
- Bump @intersect.mbo/pdf-ui to v0.5.4

### Removed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The Cardano GovTool enables ada holders to experience the governance features de

### Documentation

Learn more; [docs.gov.tools](https://docs.gov.tools/).
Learn more; [docs.gov.tools](https://docs.gov.tools/cardano-govtool/using-govtool).

## 📍 Navigation

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ utility backend that serves validation of the governance actions metadata.

# Description

Frontend is a React application using Vite as a built tool to enhance development speed and optimize production builds. Frontend interacts with the backend service via REST API and with the Cardano blockchain via cardano-serialization-lib and connected supported wallets (for the list of compatible wallets go [here](https://docs.gov.tools/how-to-use-the-govtool/getting-started/get-a-compatible-wallet)).
Frontend is a React application using Vite as a built tool to enhance development speed and optimize production builds. Frontend interacts with the backend service via REST API and with the Cardano blockchain via cardano-serialization-lib and connected supported wallets (for the list of compatible wallets go [here](https://docs.gov.tools/cardano-govtool/using-govtool/getting-started/compatible-wallets)).

# Components

Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.28/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.29/x/vva-be/build/vva-be/vva-be /usr/local/bin
2 changes: 1 addition & 1 deletion govtool/backend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.28/x/vva-be/build/vva-be/vva-be /usr/local/bin
RUN cp dist-newstyle/build/x86_64-linux/ghc-9.2.7/vva-be-1.0.29/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
26 changes: 13 additions & 13 deletions govtool/backend/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import System.Clock (TimeSpec (TimeSpec))
import System.IO (stderr)
import System.Log.Raven (initRaven, register, silentFallback)
import System.Log.Raven.Transport.HttpConduit (sendRecord)
import System.Log.Raven.Types (SentryLevel (Error), SentryRecord (..))
import System.Log.Raven.Types (SentryLevel (Error), SentryRecord (..), SentryService)
import System.TimeManager (TimeoutThread (..))

import VVA.API
Expand All @@ -71,12 +71,18 @@ main :: IO ()
main = do
commandLineConfig <- execParser cmdParser
vvaConfig <- loadVVAConfig (clcConfigPath commandLineConfig)
sentryService <-
initRaven
(sentryDSN vvaConfig)
id
sendRecord
silentFallback
case clcCommand commandLineConfig of
StartApp -> startApp vvaConfig
StartApp -> startApp vvaConfig sentryService
ShowConfig -> Text.putStrLn $ vvaConfigToText vvaConfig

startApp :: VVAConfig -> IO ()
startApp vvaConfig = do
startApp :: VVAConfig -> SentryService -> IO ()
startApp vvaConfig sentryService = do
let vvaPort = serverPort vvaConfig
vvaHost = fromString (Text.unpack (serverHost vvaConfig))
settings =
Expand All @@ -92,7 +98,7 @@ startApp vvaConfig = do
++ show vvaPort
)
)
$ setOnException (exceptionHandler vvaConfig) defaultSettings
$ setOnException (exceptionHandler vvaConfig sentryService) defaultSettings
cacheEnv <- do
let newCache = Cache.newCache (Just $ TimeSpec (fromIntegral (cacheDurationSeconds vvaConfig)) 0)
proposalListCache <- newCache
Expand Down Expand Up @@ -122,8 +128,8 @@ startApp vvaConfig = do
server' <- mkVVAServer appEnv
runSettings settings server'

exceptionHandler :: VVAConfig -> Maybe Request -> SomeException -> IO ()
exceptionHandler vvaConfig mRequest exception = do
exceptionHandler :: VVAConfig -> SentryService -> Maybe Request -> SomeException -> IO ()
exceptionHandler vvaConfig sentryService mRequest exception = do
print mRequest
print exception
let isNotTimeoutThread x = case fromException x of
Expand All @@ -135,12 +141,6 @@ exceptionHandler vvaConfig mRequest exception = do
guard . isNotTimeoutThread $ exception
guard . isNotConnectionClosedByPeer $ exception
let env = sentryEnv vvaConfig
sentryService <-
initRaven
(sentryDSN vvaConfig)
id
sendRecord
silentFallback
register
sentryService
"vva.be"
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/vva-be.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.6
name: vva-be
version: 1.0.28
version: 1.0.29

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
2 changes: 2 additions & 0 deletions govtool/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ VITE_IS_DEV=true
VITE_USERSNAP_SPACE_API_KEY=""
VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
VITE_PDF_API_URL=""
VITE_IPFS_GATEWAY=""
VITE_IPFS_PROJECT_ID=""
6 changes: 5 additions & 1 deletion govtool/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ARG NPMRC_TOKEN
ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
ARG VITE_PDF_API_URL
ARG VITE_IPFS_GATEWAY
ARG VITE_IPFS_PROJECT_ID

# Ensure all required build arguments are set
RUN \
Expand All @@ -21,7 +23,9 @@ RUN \
: "${VITE_SENTRY_DSN:?Build argument VITE_SENTRY_DSN is not set}" && \
: "${NPMRC_TOKEN:?Build argument NPMRC_TOKEN is not set}" && \
: "${VITE_USERSNAP_SPACE_API_KEY:?Build argument VITE_USERSNAP_SPACE_API_KEY is not set}" && \
: "${VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED:?Build argument VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED is not set}"
: "${VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED:?Build argument VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED is not set}" && \
: "${VITE_IPFS_GATEWAY:?Build argument VITE_IPFS_GATEWAY is not set}" && \
: "${VITE_IPFS_PROJECT_ID:?Build argument VITE_IPFS_PROJECT_ID is not set}"

ENV NODE_OPTIONS=--max_old_space_size=8192

Expand Down
2 changes: 2 additions & 0 deletions govtool/frontend/Dockerfile.qovery
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ARG NPMRC_TOKEN
ARG VITE_USERSNAP_SPACE_API_KEY
ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true'
ARG VITE_PDF_API_URL
ARG VITE_IPFS_GATEWAY
ARG VITE_IPFS_PROJECT_ID

ENV NODE_OPTIONS=--max_old_space_size=8192

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.

6 changes: 3 additions & 3 deletions govtool/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@govtool/frontend",
"private": true,
"version": "1.0.28",
"version": "1.0.29",
"type": "module",
"scripts": {
"build": "vite build",
Expand All @@ -28,7 +28,7 @@
"@emurgo/cardano-serialization-lib-asmjs": "^13.1.0",
"@hookform/resolvers": "^3.3.1",
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
"@intersect.mbo/pdf-ui": "^0.5.2",
"@intersect.mbo/pdf-ui": "^0.5.4",
"@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.4",
"@rollup/plugin-babel": "^6.0.4",
Expand Down Expand Up @@ -108,5 +108,5 @@
"overrides": {
"typescript": "^5.0.2"
},
"_id": "[email protected].28"
"_id": "[email protected].29"
}
5 changes: 5 additions & 0 deletions govtool/frontend/public/icons/DefaultDRep.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions govtool/frontend/src/components/molecules/DataMissingHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import { Box, SxProps } from "@mui/material";
import { Avatar, Box, SxProps } from "@mui/material";

import { Typography } from "@atoms";
import { MetadataValidationStatus } from "@models";
import { getMetadataDataMissingStatusTranslation } from "@/utils";
import { ICONS } from "@/consts";

type DataMissingHeaderProps = {
isDataMissing: MetadataValidationStatus | null;
title?: string;
titleStyle?: SxProps;
isDRep?: boolean;
image?: string | null;
};

export const DataMissingHeader = ({
title,
isDataMissing,
titleStyle,
isDRep,
image,
}: DataMissingHeaderProps) => (
<Box
sx={{
Expand All @@ -27,12 +32,28 @@ export const DataMissingHeader = ({
>
<Box
sx={{
flexDirection: {
sm: "column",
lg: "row",
},
alignItems: {
lg: "center",
},
display: "flex",
alignItems: "center",
}}
>
{isDRep && (
<Avatar
alt="drep-image"
src={image || ICONS.defaultDRepIcon}
sx={{ width: 80, height: 80 }}
data-testid="drep-image"
/>
)}
<Typography
sx={{
...(isDRep && { ml: { lg: 3 } }),
...(isDRep && { mt: { sm: 2, lg: 0 } }),
textOverflow: "ellipsis",
fontWeight: 600,
...(isDataMissing && { color: "errorRed" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Typography } from "@atoms";
import { useTranslation } from "@hooks";
import { MetadataValidationStatus } from "@models";
import { openInNewTab } from "@utils";
import { LINKS } from "@/consts/links";

export const DataMissingInfoBox = ({
isDataMissing,
Expand Down Expand Up @@ -78,11 +79,7 @@ export const DataMissingInfoBox = ({
{gaMetadataErrorDescription}
</Typography>
<Link
onClick={() =>
openInNewTab(
"https://docs.gov.tools/using-govtool/govtool-functions/dreps/drep-error-conditions",
)
}
onClick={() => openInNewTab(LINKS.DREP_ERROR_CONDITIONS)}
sx={{
fontFamily: "Poppins",
fontSize: "16px",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
AutomatedVotingOptionCurrentDelegation,
AutomatedVotingOptionDelegationId,
} from "@/types/automatedVotingOptions";
import { LINKS } from "@/consts/links";

type AutomatedVotingOptionsProps = {
currentDelegation?: string | null;
Expand Down Expand Up @@ -118,11 +119,7 @@ export const AutomatedVotingOptions = ({
onClickDelegate={() =>
delegate(AutomatedVotingOptionDelegationId.abstain)
}
onClickInfo={() =>
openInNewTab(
"https://docs.gov.tools/using-govtool/govtool-functions/delegating/abstain-from-every-vote",
)
}
onClickInfo={() => openInNewTab(LINKS.ABSTAIN_FROM_EVERY_VOTE)}
title={
isDelegatedToAbstain
? t("dRepDirectory.delegatedToAbstainTitle", {
Expand Down Expand Up @@ -162,9 +159,7 @@ export const AutomatedVotingOptions = ({
delegate(AutomatedVotingOptionDelegationId.no_confidence)
}
onClickInfo={() =>
openInNewTab(
"https://docs.gov.tools/using-govtool/govtool-functions/delegating/signal-no-confidence-on-every-vote",
)
openInNewTab(LINKS.SIGNAL_NO_CONFIDENCE_ON_EVERY_VOTE)
}
title={
isDelegatedToNoConfidence
Expand Down
Loading
Loading