Skip to content

Commit

Permalink
Merge pull request #2116 from IntersectMBO/test
Browse files Browse the repository at this point in the history
GovTool 1.0.20-test
  • Loading branch information
MSzalowski authored Oct 7, 2024
2 parents 39305f7 + 2469720 commit 19ca88a
Show file tree
Hide file tree
Showing 61 changed files with 1,035 additions and 536 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-deploy-test-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
key: ${{ secrets.TEST_STACK_SSH_KEY }}
command_timeout: 100m ## Haskell container build takes a lot of time.
script: |
set -euo pipefail
REPO_URL="https://github.com/${{ github.repository }}"
DEST_DIR="$HOME/Documents/govtool"
Expand Down Expand Up @@ -59,9 +60,8 @@ jobs:
# Execute the build-and-deploy.sh script
cd $DEST_DIR/tests/test-infrastructure
./build-and-deploy.sh update-images
docker system prune
(docker image ls -q | xargs docker image rm --force ) || echo "Images cleaned-up"
envs: GOVTOOL_TAG, GRAFANA_ADMIN_PASSWORD, GRAFANA_SLACK_RECIPIENT, GRAFANA_SLACK_OAUTH_TOKEN, SENTRY_DSN_BACKEND, GTM_ID, NPMRC_TOKEN, SENTRY_DSN_FRONTEND, PIPELINE_URL, USERSNAP_SPACE_API_KEY, APP_ENV, PDF_API_URL
yes | docker system prune -f || echo "Ignoring system prune eror"
envs: GOVTOOL_TAG, GRAFANA_ADMIN_PASSWORD, GRAFANA_SLACK_RECIPIENT, GRAFANA_SLACK_OAUTH_TOKEN, SENTRY_DSN_BACKEND, GTM_ID, NPMRC_TOKEN, SENTRY_DSN_FRONTEND, PIPELINE_URL, USERSNAP_SPACE_API_KEY, APP_ENV, PDF_API_URL, KUBER_API_KEY
env:
GOVTOOL_TAG: ${{ github.sha }}
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
Expand All @@ -75,4 +75,4 @@ jobs:
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
APP_ENV: test
PDF_API_URL: ${{ secrets.PDF_API_URL }}
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
KUBER_API_KEY: ${{ secrets.KUBER_API_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
message: |-
This PR is in the tag: ${{ env.TAG }} , for ${{ matrix.name }} service
This PR is in the tag: ${{ env.TAG }} , for ${{ matrix.name }} service
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,28 @@ changes.

-

## [v1.0.20](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.20) 2024-10-03

### Added

- Add useful external links to home page and dashboard [Issue 1995](https://github.com/IntersectMBO/govtool/issues/1995)

### Fixed

- Add missing testIds for submitted votes [Issue 1875](https://github.com/IntersectMBO/govtool/issues/1875)
- Provide workaround for iOS for downloading metadata on iOS [Issue 1989](https://github.com/IntersectMBO/govtool/issues/1989)
- Fix infinite loading in DRep Directory [Issue 2090](https://github.com/IntersectMBO/govtool/issues/2090)

### Changed

- Change constitutional committee vote totals to be constitutional for yes and unconstitutional for no [Issue 2062](https://github.com/IntersectMBO/govtool/issues/2062)
- Bump @intersect.mbo/pdf-ui to v0.4.0
- Include @language property in generated jsonld files [Issue 1856](https://github.com/IntersectMBO/govtool/issues/1856)

### Removed

-

## [v1.0.19](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.19) 2024-09-19

### Added
Expand Down
14 changes: 11 additions & 3 deletions gov-action-loader/frontend/src/views/SpecificLoad.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ import config from '../config'
<v-btn color="red-lighten-5" variant="flat" class="mt-2 ml-6"
@click="deleteTreasuryWithdrawal(index)">-</v-btn>
</div>
<div class="d-flex justify-center mb-2">
<v-btn color="blue-lighten-5" variant="flat" @click="addTreasuryWithdrawal">+</v-btn>
</div>

<v-tooltip text="Required" location="top">
<template v-slot:activator="{ props }">
<span class="text-h6 mb-2">Guardrail Script</span>
</template>
</v-tooltip>
<v-text-field label="CBOR Hex" v-model="guardrailScript" variant="outlined"></v-text-field>
<div class="d-flex justify-center">
<v-btn color="blue-lighten-5" variant="flat" @click="addTreasuryWithdrawal">+</v-btn>
</div>

</div>

<!-- Add Committee section -->
Expand Down Expand Up @@ -915,6 +917,12 @@ export default {
...(this.DRepDeposit != null ? { DRepDeposit: parseInt(this.DRepDeposit) } : {}),
...(this.DRepActivity != null ? { DRepActivity: parseInt(this.DRepActivity) } : {}),
}
proposal_data['script'] =
{
type: "PlutusScriptV3",
description: "",
cborHex: this.guardrailScript
}
break
}
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.19/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.20/x/vva-be/build/vva-be/vva-be /usr/local/bin
52 changes: 48 additions & 4 deletions govtool/backend/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,60 @@
# process by ensuring it only needs to compile against these dependencies. This
# is a common practice in Haskell projects, as it can significantly reduce the
# time it takes to build the project.
#
# The reason why we do not use the official haskell image is that the official
# image does not include the necessary dependencies for the project, which are
# unobtainable from the official image.

FROM haskell:9.2.7-buster
FROM ubuntu:24.04

# Set the working directory
WORKDIR /src

# Set noninteractive mode
ENV DEBIAN_FRONTEND=noninteractive

# Update package list and install dependencies
RUN apt-get update && \
apt-get install -y wget lsb-release && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt-get install -y \
software-properties-common \
wget \
gnupg \
curl \
build-essential \
libncurses-dev \
libgmp-dev \
liblzma-dev \
pkg-config \
zlib1g-dev \
xz-utils

# Install PostgreSQL 14
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
apt-get update && \
apt-get install -y postgresql-14 libpq-dev

# Download and install GHC 9.2.7
RUN wget https://downloads.haskell.org/~ghc/9.2.7/ghc-9.2.7-x86_64-deb10-linux.tar.xz && \
tar -xf ghc-9.2.7-x86_64-deb10-linux.tar.xz && \
cd ghc-9.2.7 && \
./configure && \
make install && \
cd .. && \
rm -rf ghc-9.2.7 ghc-9.2.7-x86_64-deb10-linux.tar.xz

# Install Cabal
RUN wget https://downloads.haskell.org/~cabal/cabal-install-3.6.2.0/cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz && \
tar -xf cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz && \
mv cabal /usr/local/bin/ && \
rm cabal-install-3.6.2.0-x86_64-linux-deb10.tar.xz

# Copy the project files into the container
COPY . .
RUN cabal update && cabal configure && cabal install --only-dependencies && rm -rf /src/*

# Install the project dependencies
RUN cabal update && \
cabal configure && \
cabal install --only-dependencies && \
rm -rf /src/*
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.19/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.20/x/vva-be/build/vva-be/vva-be /usr/local/bin

# Expose the necessary port
EXPOSE 9876
Expand Down
3 changes: 3 additions & 0 deletions govtool/backend/sql/list-dreps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SELECT
newestRegister.time AS last_register_time,
COALESCE(latestDeposit.deposit, 0),
non_deregister_voting_anchor.url IS NOT NULL AS has_non_deregister_voting_anchor,
off_chain_vote_fetch_error.fetch_error,
off_chain_vote_drep_data.payment_address,
off_chain_vote_drep_data.given_name,
off_chain_vote_drep_data.objectives,
Expand Down Expand Up @@ -96,6 +97,7 @@ FROM
AND DRepDistr.rn = 1
LEFT JOIN voting_anchor va ON va.id = dr_voting_anchor.voting_anchor_id
LEFT JOIN voting_anchor non_deregister_voting_anchor on non_deregister_voting_anchor.id = dr_non_deregister_voting_anchor.voting_anchor_id
LEFT JOIN off_chain_vote_fetch_error ON off_chain_vote_fetch_error.voting_anchor_id = va.id
LEFT JOIN off_chain_vote_data ON off_chain_vote_data.voting_anchor_id = va.id
LEFT JOIN off_chain_vote_drep_data on off_chain_vote_drep_data.off_chain_vote_data_id = off_chain_vote_data.id
CROSS JOIN DRepActivity
Expand Down Expand Up @@ -138,6 +140,7 @@ GROUP BY
newestRegister.time,
latestDeposit.deposit,
non_deregister_voting_anchor.url,
off_chain_vote_fetch_error.fetch_error,
off_chain_vote_drep_data.payment_address,
off_chain_vote_drep_data.given_name,
off_chain_vote_drep_data.objectives,
Expand Down
1 change: 1 addition & 0 deletions govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ drepRegistrationToDrep Types.DRepRegistration {..} =
dRepType = mapDRepType dRepRegistrationType,
dRepLatestTxHash = HexText <$> dRepRegistrationLatestTxHash,
dRepLatestRegistrationDate = dRepRegistrationLatestRegistrationDate,
dRepMetadataError = dRepRegistrationMetadataError,
dRepPaymentAddress = dRepRegistrationPaymentAddress,
dRepGivenName = dRepRegistrationGivenName,
dRepObjectives = dRepRegistrationObjectives,
Expand Down
1 change: 1 addition & 0 deletions govtool/backend/src/VVA/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ data DRep
, dRepType :: DRepType
, dRepLatestTxHash :: Maybe HexText
, dRepLatestRegistrationDate :: UTCTime
, dRepMetadataError :: Maybe Text
, dRepPaymentAddress :: Maybe Text
, dRepGivenName :: Maybe Text
, dRepObjectives :: Maybe Text
Expand Down
3 changes: 2 additions & 1 deletion govtool/backend/src/VVA/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ listDReps = withPool $ \conn -> do
results <- liftIO $ SQL.query_ conn listDRepsSql
timeZone <- liftIO getCurrentTimeZone
return
[ DRepRegistration drepHash drepView url dataHash (floor @Scientific deposit) votingPower status drepType txHash (localTimeToUTC timeZone date) paymentAddress givenName objectives motivations qualifications imageUrl imageHash
[ DRepRegistration drepHash drepView url dataHash (floor @Scientific deposit) votingPower status drepType txHash (localTimeToUTC timeZone date) metadataError paymentAddress givenName objectives motivations qualifications imageUrl imageHash
| ( drepHash
, drepView
, url
Expand All @@ -73,6 +73,7 @@ listDReps = withPool $ \conn -> do
, date
, latestDeposit
, latestNonDeregisterVotingAnchorWasNotNull
, metadataError
, paymentAddress
, givenName
, objectives
Expand Down
1 change: 1 addition & 0 deletions govtool/backend/src/VVA/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ data DRepRegistration
, dRepRegistrationType :: DRepType
, dRepRegistrationLatestTxHash :: Maybe Text
, dRepRegistrationLatestRegistrationDate :: UTCTime
, dRepRegistrationMetadataError :: Maybe Text
, dRepRegistrationPaymentAddress :: Maybe Text
, dRepRegistrationGivenName :: Maybe Text
, dRepRegistrationObjectives :: Maybe Text
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.19
version: 1.0.20

-- A short (one-line) description of the package.
-- synopsis:
Expand Down
Loading

0 comments on commit 19ca88a

Please sign in to comment.