Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9b413ff
rebase branch with the addition of workflow file
aaboyle878 May 7, 2025
fbd17ac
adds step sending request to qovery endpoint to trigger container dep…
aaboyle878 May 7, 2025
7cbdf12
removes unnecessary env vars and updated api versions
aaboyle878 May 8, 2025
5c7d5c7
chore: update @intersect.mbo/pdf-ui to 1.0.0-beta
github-actions[bot] Jun 11, 2025
d1e4940
Merge pull request #3753 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 11, 2025
4e6ceef
fix-storybook
Jun 11, 2025
c5b9232
Merge pull request #3754 from IntersectMBO/3682-adjust-top-menu-layou…
Jun 11, 2025
2be25b3
fix: add wait for form to settle after validation
kneerose Jun 11, 2025
dbecbb0
fix: increase timeout for comment count assertion in proposal discuss…
kneerose Jun 11, 2025
684e236
Update GOVERNANCE_ACTION_SUBMISSION.md
Jun 12, 2025
400537e
refactor: improve navigation tests for mobile and external links
kneerose Jun 12, 2025
1b6272a
fix: governance action navbar test for outcomes
kneerose Jun 12, 2025
f400d84
fix: expect governance action count 2 on disconnect state
kneerose Jun 12, 2025
5919c39
chore: update @intersect.mbo/pdf-ui to 1.0.1-alfa
github-actions[bot] Jun 12, 2025
e570d77
Merge pull request #3782 from IntersectMBO/docs-gov-action-build-hard…
bosko-m Jun 12, 2025
83e3956
Merge pull request #3786 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 12, 2025
8188beb
(feat#3745): display authors for Live Voting Governance Actions
Jun 12, 2025
34ebe49
Merge pull request #3787 from IntersectMBO/3745-display-authors-for-l…
bosko-m Jun 13, 2025
b7deafb
(fix#3745) authors case formatting for gov actions
Jun 16, 2025
bdea53d
Merge pull request #3789 from IntersectMBO/3745-display-authors-for-l…
Jun 16, 2025
63e29f5
chore: update @intersect.mbo/pdf-ui to 1.0.1-beta
github-actions[bot] Jun 18, 2025
af692e1
Merge pull request #3802 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 18, 2025
6f90e38
chore: update @intersect.mbo/pdf-ui to 1.0.2-alfa
github-actions[bot] Jun 18, 2025
924ec88
Merge pull request #3803 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 18, 2025
8e56a08
chore: update @intersect.mbo/pdf-ui to 1.0.2-beta
github-actions[bot] Jun 18, 2025
8ff3272
Merge pull request #3804 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 18, 2025
8b48865
Merge pull request #3805 from IntersectMBO/develop
bosko-m Jun 19, 2025
f6d1032
chore: update @intersect.mbo/govtool-outcomes-pillar-ui to v1.5.0
github-actions[bot] Jun 19, 2025
6d06121
Merge pull request #3806 from IntersectMBO/chore/@intersect.mbo/govto…
bosko-m Jun 19, 2025
82de769
chore: update @intersect.mbo/pdf-ui to 1.0.3-alfa
github-actions[bot] Jun 19, 2025
139e086
Merge pull request #3808 from IntersectMBO/chore/@intersect.mbo/pdf-u…
bosko-m Jun 19, 2025
a2ccc3e
Merge pull request #3783 from IntersectMBO/fix/navbar-governance-acti…
kneerose Jun 19, 2025
0ff0f98
Merge pull request #3781 from IntersectMBO/fix/flaky-test-8F-3M_1
kneerose Jun 19, 2025
0d7d150
Merge pull request #3580 from IntersectMBO/feat/wf-check-and-build-qa
aaboyle878 Jun 19, 2025
f0e0e61
Merge pull request #3809 from IntersectMBO/develop
aaboyle878 Jun 19, 2025
b5587e2
Merge pull request #3810 from IntersectMBO/test
aaboyle878 Jun 19, 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
213 changes: 213 additions & 0 deletions .github/workflows/build-from-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
name: Check and Build QA

on:
push:
branches:
- test
workflow_dispatch:

permissions:
contents: write
pull-requests: write
packages: write

jobs:
check-build:
if: contains(fromJson('["test"]'), github.ref_name)
environment: ${{ matrix.network }}
strategy:
fail-fast: false
matrix:
include:
- branch: test
network: qa-govtool
workdir: ./govtool/backend
name: govtool-backend
dockerfile: ./govtool/backend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: govtool-backend
- branch: test
network: qa-govtool
workdir: ./govtool/frontend
name: govtool-frontend
dockerfile: ./govtool/frontend/Dockerfile.qovery
image: ghcr.io/${{ github.repository }}-frontend
qovery_container_name: govtool-frontend
- branch: test
network: qa-govtool
workdir: ./govtool/metadata-validation
name: govtool-metadata-validation
dockerfile: ./govtool/metadata-validation/Dockerfile
image: ghcr.io/${{ github.repository }}-metadata-validation
qovery_container_name: govtool-metadata-validation

runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Ensure Job Runs Only for Matching Branch
if: github.ref_name != matrix.branch
run: |
echo "Branch mismatch, exiting..."
exit 0

- name: Set TAG Environment Variable
id: set_tag
run: |
SANITIZED_BRANCH=$(echo "${{ github.ref_name }}" | tr '/' '-')
echo "COMMIT_TAG=${SANITIZED_BRANCH}-${{ github.sha }}-${{ github.run_number }}" >> $GITHUB_ENV
echo "STATIC_TAG=qa-latest" >> $GITHUB_ENV
echo "Generated TAG: $COMMIT_TAG"
echo "Generated STATIC_TAG: $STATIC_TAG"


- name: Lint Dockerfile
id: hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
failure-threshold: error
format: json
dockerfile: ${{ matrix.dockerfile }}
# output-file: hadolint_output.json

- name: Save Hadolint output
id: save_hadolint_output
if: always()
run: cd ${{ matrix.workdir }} && echo "$HADOLINT_RESULTS" | jq '.' > hadolint_output.json

- name: Print Dockerfile lint output
run: |
cd ${{ matrix.workdir }}
echo "-----HADOLINT RESULT-----"
echo "Outcome: ${{ steps.hadolint.outcome }}"
echo "-----DETAILS--------"
cat hadolint_output.json
echo "--------------------"

- name: Code lint
id: code_lint
run: |
cd ${{ matrix.workdir }}
if [ ! -f lint.sh ]; then
echo "lint skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
sudo chmod +x lint.sh && ./lint.sh 2>&1 | tee code_lint_output.txt

- name: Unit tests
id: unit_tests
run: |
cd ${{ matrix.workdir }}
if [ ! -f unit-test.sh ]; then
echo "unit tests skipped" | tee code_lint_output.txt
exit 0
fi
set -o pipefail
sudo chmod +x unit-test.sh && ./unit-test.sh 2>&1 | tee unit_test_output.txt

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ github.run_number}}
restore-keys: |
${{ runner.os }}-buildx-

- id: image_lowercase
uses: ASzc/change-string-case-action@v6
with:
string: ${{ matrix.image }}

- name: Set ENVIRONMENT Variable
run: echo "ENVIRONMENT=${{ matrix.network }}" >> $GITHUB_ENV

- name: Sanitize Network Name
run: |
CLEAN_NETWORK=$(echo "${{ matrix.network }}" | sed 's/-govtool$//')
echo "CLEAN_NETWORK=$CLEAN_NETWORK" >> $GITHUB_ENV

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: ${{ matrix.workdir }}
file: ${{ matrix.dockerfile }}
tags: >
${{ steps.image_lowercase.outputs.lowercase }}-${{ env.CLEAN_NETWORK }}:${{ env.COMMIT_TAG }},
${{ steps.image_lowercase.outputs.lowercase }}-${{ env.CLEAN_NETWORK }}:${{ env.STATIC_TAG }}
load: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
outputs: type=docker,dest=/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar
build-args: |
VITE_APP_ENV=${{ secrets.VITE_APP_ENV }}
VITE_BASE_URL=${{ secrets.VITE_BASE_URL }}
VITE_METADATA_API_URL=${{ secrets.VITE_METADATA_API_URL }}
VITE_NETWORK_FLAG=${{ secrets.VITE_NETWORK_FLAG }}
VITE_SENTRY_DSN=${{ secrets.VITE_SENTRY_DSN }}
VITE_USERSNAP_SPACE_API_KEY=${{ secrets.VITE_USERSNAP_SPACE_API_KEY }}
VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED=${{ secrets.VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED }}
VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED=${{ secrets.VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED }}
VITE_OUTCOMES_API_URL=${{secrets.VITE_OUTCOMES_API_URL}}
VITE_PDF_API_URL=${{ secrets.VITE_PDF_API_URL }}
VITE_IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }}
VITE_IPFS_PROJECT_ID=${{ secrets.IPFS_PROJECT_ID }}
IPFS_GATEWAY=${{ secrets.IPFS_GATEWAY }}
IPFS_PROJECT_ID=${{ secrets.IPFS_PROJECT_ID }}

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Scan Docker image with Dockle
id: dockle
run: |
wget -q https://github.com/goodwithtech/dockle/releases/download/v0.4.14/dockle_0.4.14_Linux-64bit.tar.gz
tar zxf dockle_0.4.14_Linux-64bit.tar.gz
sudo mv dockle /usr/local/bin

dockle --exit-code 1 --exit-level fatal --format json -ak GHC_RELEASE_KEY -ak CABAL_INSTALL_RELEASE_KEY -ak STACK_RELEASE_KEY -ak KEY_SHA512 --input '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar' --output ${{ matrix.workdir }}/dockle_scan_output.json
echo " dockle exited w/ $?"
cat ${{ matrix.workdir }}/dockle_scan_output.json

echo "outcome=success" >> $GITHUB_OUTPUT

- name: Debug TAG Before Docker Push
run: |
echo "Lowercase Image: ${{ steps.image_lowercase.outputs.lowercase }}"
echo "Network: ${{ matrix.network }}"
echo "COMMIT_TAG: ${{ env.COMMIT_TAG }}"
echo "STATIC_TAG: ${{ env.STATIC_TAG }}"
echo "Final Docker Tag: ${{ steps.image_lowercase.outputs.lowercase }}-${{ matrix.network}}:${{ env.TAG }}"

- name: Push Docker image to GHCR
run: |
docker load -i '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar'
rm -rf '/tmp/image-${{ matrix.name }}-${{ env.ENVIRONMENT }}.tar'
docker push ${{ steps.image_lowercase.outputs.lowercase }}-${{ env.CLEAN_NETWORK}}:${{ env.COMMIT_TAG }}
docker push ${{ steps.image_lowercase.outputs.lowercase }}-${{ env.CLEAN_NETWORK}}:${{ env.STATIC_TAG }}

- name: Notify Qovery of new image tag
run: |
curl -X POST https://api.qovery.com/organization/${{ secrets.QOVERY_ORG_ID }}/container/deploy \
-H "Authorization: Token ${{ secrets.QOVERY_API_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"image_name": "${{ steps.image_lowercase.outputs.lowercase }}-${{ env.CLEAN_NETWORK }}",
"tag": "${{ env.COMMIT_TAG }}"
}'

- name: Add tag as a PR comment
uses: ubie-oss/comment-to-merged-pr-action@v0.3.3
id: comment-to-merged-pr
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
message: |-
This PR is in the tag: ${{ env.COMMIT_TAG }} , for ${{ matrix.name }} service
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ changes.
### Added

- Preserve maintenance ending banner state on the wallet connection change [Issue 3681](https://github.com/IntersectMBO/govtool/issues/3681)
- Add authors for Live Voting Governance Actions [Issue 3745](https://github.com/IntersectMBO/govtool/issues/3745)

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions docs/GOVERNANCE_ACTION_SUBMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const buildProtocolParameterChangeGovernanceAction: (
protocolParameterChangeProps: ProtocolParameterChangeProps
) => Promise<VotingProposalBuilder | undefined>;

const buildHardForkInitiationGovernanceAction: (
const buildHardForkGovernanceAction: (
hardForkInitiationProps: HardForkInitiationProps
) => Promise<VotingProposalBuilder | undefined>;

Expand Down Expand Up @@ -210,7 +210,7 @@ const {
buildSignSubmitConwayCertTx,
buildNewInfoGovernanceAction,
buildProtocolParameterChangeGovernanceAction,
buildHardForkInitiationGovernanceAction,
buildHardForkGovernanceAction,
buildTreasuryGovernanceAction,
buildNewConstitutionGovernanceAction,
buildUpdateCommitteeGovernanceAction,
Expand Down Expand Up @@ -241,7 +241,7 @@ govActionBuilder = await buildProtocolParameterChangeGovernanceAction({
});

// hash of the previous Governance Action, index of the previous Governance Action, url of the metadata, hash of the metadata, and the major and minor numbers of the hard fork initiation
govActionBuilder = await buildHardForkInitiationGovernanceAction({
govActionBuilder = await buildHardForkGovernanceAction({
prevGovernanceActionHash,
prevGovernanceActionIndex,
url,
Expand Down
16 changes: 14 additions & 2 deletions govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,18 @@ SELECT
COALESCE(cv.ccNoVotes, 0) cc_no_votes,
COALESCE(cv.ccAbstainVotes, 0) cc_abstain_votes,
prev_gov_action.index as prev_gov_action_index,
encode(prev_gov_action_tx.hash, 'hex') as prev_gov_action_tx_hash
encode(prev_gov_action_tx.hash, 'hex') as prev_gov_action_tx_hash,
COALESCE(
json_agg(
json_build_object(
'name', off_chain_vote_author.name,
'witnessAlgorithm', off_chain_vote_author.witness_algorithm,
'publicKey', off_chain_vote_author.public_key,
'signature', off_chain_vote_author.signature
)
) FILTER (WHERE off_chain_vote_author.id IS NOT NULL),
'[]'
) authors
FROM
gov_action_proposal
JOIN ActiveProposals ON gov_action_proposal.id = ActiveProposals.id
Expand All @@ -314,6 +325,7 @@ FROM
LEFT JOIN block AS creator_block ON creator_block.id = creator_tx.block_id
LEFT JOIN voting_anchor ON voting_anchor.id = gov_action_proposal.voting_anchor_id
LEFT JOIN off_chain_vote_data ON off_chain_vote_data.voting_anchor_id = voting_anchor.id
lEFT JOIN off_chain_vote_author ON off_chain_vote_author.off_chain_vote_data_id = off_chain_vote_data.id
LEFT JOIN off_chain_vote_gov_action_data ON off_chain_vote_gov_action_data.off_chain_vote_data_id = off_chain_vote_data.id
LEFT JOIN param_proposal AS proposal_params ON gov_action_proposal.param_proposal = proposal_params.id
LEFT JOIN cost_model AS cost_model ON proposal_params.cost_model_id = cost_model.id
Expand Down Expand Up @@ -355,4 +367,4 @@ GROUP BY
off_chain_vote_gov_action_data.title,
off_chain_vote_gov_action_data.abstract,
off_chain_vote_gov_action_data.motivation,
off_chain_vote_gov_action_data.rationale;
off_chain_vote_gov_action_data.rationale;
3 changes: 2 additions & 1 deletion govtool/backend/src/VVA/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ proposalToResponse timeZone Types.Proposal {..} =
proposalResponseCcNoVotes = proposalCcNoVotes,
proposalResponseCcAbstainVotes = proposalCcAbstainVotes,
proposalResponsePrevGovActionIndex = proposalPrevGovActionIndex,
proposalResponsePrevGovActionTxHash = HexText <$> proposalPrevGovActionTxHash
proposalResponsePrevGovActionTxHash = HexText <$> proposalPrevGovActionTxHash,
proposalResponseAuthors = ProposalAuthors <$> proposalAuthors
}

voteToResponse :: Types.Vote -> VoteParams
Expand Down
47 changes: 46 additions & 1 deletion govtool/backend/src/VVA/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,52 @@ data ProposalResponse
, proposalResponseCcAbstainVotes :: Integer
, proposalResponsePrevGovActionIndex :: Maybe Integer
, proposalResponsePrevGovActionTxHash :: Maybe HexText
, proposalResponseAuthors :: Maybe ProposalAuthors
}
deriving (Generic, Show)

newtype ProposalAuthors = ProposalAuthors { getProposalAuthors :: Value }
deriving newtype (Show)

instance FromJSON ProposalAuthors where
parseJSON v@(Array _) = pure $ ProposalAuthors v
parseJSON _ = fail "ProposalAuthors must be a JSON array"

instance ToJSON ProposalAuthors where
toJSON (ProposalAuthors v) = v

instance ToSchema ProposalAuthors where
declareNamedSchema _ = pure $ NamedSchema (Just "ProposalAuthors") $ mempty
& type_ ?~ OpenApiArray
& description ?~ "A JSON array of proposal authors"
& example ?~ toJSON
[ object
[ "name" .= ("Alice" :: Text)
, "witnessAlgorithm" .= ("algo" :: Text)
, "publicKey" .= ("key" :: Text)
, "signature" .= ("sig" :: Text)
]
, object
[ "name" .= ("Bob" :: Text)
, "witnessAlgorithm" .= ("algo2" :: Text)
, "publicKey" .= ("key2" :: Text)
, "signature" .= ("sig2" :: Text)
]
]

exampleProposalAuthors :: Text
exampleProposalAuthors =
"[\
\ {\"name\": \"Alice\",\
\ \"witnessAlgorithm\": \"Ed25519\",\
\ \"publicKey\": \"abcdef123456\",\
\ \"signature\": \"deadbeef\"},\
\ {\"name\": \"Bob\",\
\ \"witnessAlgorithm\": \"Ed25519\",\
\ \"publicKey\": \"123456abcdef\",\
\ \"signature\": \"beefdead\"}\
\]"

deriveJSON (jsonOptions "proposalResponse") ''ProposalResponse

exampleProposalResponse :: Text
Expand Down Expand Up @@ -433,7 +476,9 @@ exampleProposalResponse = "{ \"id\": \"proposalId123\","
<> "\"cCNoVotes\": 0,"
<> "\"cCAbstainVotes\": 0,"
<> "\"prevGovActionIndex\": 0,"
<> "\"prevGovActionTxHash\": \"47c14a128cd024f1b990c839d67720825921ad87ed875def42641ddd2169b39c\"}"
<> "\"prevGovActionTxHash\": \"47c14a128cd024f1b990c839d67720825921ad87ed875def42641ddd2169b39c\","
<> "\"authors\": " <> exampleProposalAuthors
<> "}"

instance ToSchema Value where
declareNamedSchema _ = pure $ NamedSchema (Just "Value") $ mempty
Expand Down
2 changes: 2 additions & 0 deletions govtool/backend/src/VVA/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ data Proposal
, proposalCcAbstainVotes :: Integer
, proposalPrevGovActionIndex :: Maybe Integer
, proposalPrevGovActionTxHash :: Maybe Text
, proposalAuthors :: Maybe Value
}
deriving (Show)

Expand Down Expand Up @@ -241,6 +242,7 @@ instance FromRow Proposal where
<*> (floor @Scientific <$> field) -- proposalCcAbstainVotes
<*> field -- prevGovActionIndex
<*> field -- prevGovActionTxHash
<*> field -- proposalAuthors

data TransactionStatus = TransactionStatus
{ transactionConfirmed :: Bool
Expand Down
Loading