Skip to content

Commit

Permalink
Merge pull request #2476 from IntersectMBO/test
Browse files Browse the repository at this point in the history
GovTool - v1.0.29
  • Loading branch information
MSzalowski authored Dec 5, 2024
2 parents b0af65a + 51fd5c1 commit 1d08727
Show file tree
Hide file tree
Showing 74 changed files with 509 additions and 335 deletions.
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
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": "govtool@1.0.28"
"_id": "govtool@1.0.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

0 comments on commit 1d08727

Please sign in to comment.