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

Move develop to test #1058

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
ff947b6
Bump version of Cardano Node and Cardano DB Sync in personal stack
placek May 9, 2024
a4804b8
Fix/Add tests for missing APIs
mesudip May 16, 2024
0791e35
test: Delegation (logged in)
NabinKawan May 16, 2024
1775a48
Add wallet & transaction helpers
NabinKawan May 16, 2024
36026e6
Rename delegation page to dRep-directory
NabinKawan May 16, 2024
4a5de13
test: Delegation functionality
NabinKawan May 16, 2024
3b43802
test: Search & Filter dRep
NabinKawan May 16, 2024
da8db25
test: Copy dRep id
NabinKawan May 16, 2024
0a4502d
Add adaHolder02 auth
NabinKawan May 16, 2024
0c2b37a
Remove delegation tests from mobile
NabinKawan May 16, 2024
d14d76e
Remove one_time_wallet setup
NabinKawan May 16, 2024
54de7d5
fix: Prettier formatting (trailingComma)
NabinKawan May 16, 2024
d19229c
Fix staging basic auth
placek May 17, 2024
6bf322d
Squashed 'govtool/analytics-dashboard/' changes from 9d116a9..a47b9c2
placek May 17, 2024
812c0f6
Merge commit '6bf322db6418b422cb2d945dce9ce27749e6b701' into develop
placek May 17, 2024
1385e67
test: Sort dReps and DRep information on details page
NabinKawan May 17, 2024
01cf7c0
Refine DRep directory user story names
NabinKawan May 17, 2024
7960265
test: Show more DReps
NabinKawan May 17, 2024
8dfd150
Remove un-used services
mesudip May 6, 2024
110a329
Fix paths of gov-action-loader
mesudip May 6, 2024
23b3a99
Add dbsync service
mesudip May 6, 2024
c748a8d
Refactor config generation script
mesudip May 6, 2024
aee028a
Add govtool stack and update configs
mesudip May 7, 2024
017dc63
Update deploy command
mesudip May 7, 2024
c9f0e1c
Separate out individual stacks
mesudip May 7, 2024
dd85e57
Refactor build scripts and gh-action
mesudip May 8, 2024
3962136
Add debug log
mesudip May 8, 2024
acd3379
Add set -x command
mesudip May 8, 2024
3251345
Add exit code
mesudip May 8, 2024
f19dbeb
Add debug log on build-images
mesudip May 8, 2024
10aa8ea
Remove pipe to /dev/null
mesudip May 8, 2024
a435c61
Add ansible
mesudip May 9, 2024
a702584
Fix build script
mesudip May 9, 2024
8cafce5
Add metadata api for tests
mesudip Apr 29, 2024
8fb7291
Add locks api
mesudip May 2, 2024
3bf91d6
Add lock expiry.
mesudip May 2, 2024
d812745
Add metadata-api deployment on test-stack
mesudip May 9, 2024
594b163
Fix gov-action-loader backend config
mesudip May 9, 2024
15778d2
BugFix: Fix image name of metadata service
mesudip May 9, 2024
5292e00
BugFix: Fix images for gov-action-loader
mesudip May 9, 2024
5249b1d
BugFix: Rename metadata api service name to metadata-api
mesudip May 9, 2024
6e8aeff
Set VITE_BASE_URL=/api on test deployment
mesudip May 10, 2024
f227661
Update lighthouse action
mesudip May 10, 2024
bdea6d6
Remove unused node options
mesudip May 10, 2024
26bfd5e
Expose kuber-api for tests
mesudip May 14, 2024
76713bb
Update backend config file
mesudip May 17, 2024
83b688e
Add workflow to deploy test stack
mesudip May 17, 2024
6124a93
Upgrade node version to 8.11.0
mesudip May 19, 2024
20f04ee
Add proper error msg for dRep filter
NabinKawan May 19, 2024
a877731
Enhance change delegation test
NabinKawan May 19, 2024
9646306
Merge pull request #1044 from IntersectMBO/tests/drep-directory
NabinKawan May 19, 2024
c5a97e3
Merge pull request #1041 from IntersectMBO/chore/update-backend-config
mesudip May 19, 2024
3387462
Merge pull request #1036 from IntersectMBO/chore/fix-backend-tests
mesudip May 19, 2024
cc0d9c7
Refactor dRep tests title
NabinKawan May 19, 2024
674dc25
test: DRep Form validity
NabinKawan May 19, 2024
2650db5
Remove tags from tests
NabinKawan May 19, 2024
10c6f76
fix (sorting): Add delay to address slow loading of proposals
NabinKawan May 19, 2024
c513d2c
fix: Conflict in open-drawer test-id
NabinKawan May 19, 2024
4badeaa
test: DRep form invalidity
NabinKawan May 20, 2024
15bef45
Refactor transactions & Add missing test-ids
NabinKawan May 20, 2024
c9f5dcd
Merge pull request #1054 from IntersectMBO/refactor/tests
NabinKawan May 20, 2024
e11843d
Enhance allure dashboard visibility
kneerose May 14, 2024
8c354eb
Remove worfkflow changes
NabinKawan May 20, 2024
02db6c2
Merge pull request #1055 from IntersectMBO/enhancement/allure-report
spannercode May 20, 2024
2b87032
Merge pull request #974 from IntersectMBO/fix/bump-version-of-node-an…
placek May 20, 2024
a957bf1
Merge pull request #1042 from IntersectMBO/fix/fix-staging-basic-auth
placek May 20, 2024
ce10f42
Merge pull request #1043 from IntersectMBO/chore/update-participation…
placek May 20, 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
49 changes: 49 additions & 0 deletions .github/workflows/build-and-deploy-test-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and deploy GovTool test stack
run-name: Deploy by @${{ github.actor }}

on:
push:
branches:
- test

env:
ENVIRONMENT: "test"
CARDANO_NETWORK: "sanchonet"

jobs:
deploy:
name: Deploy app
runs-on: ubuntu-latest
env:
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
GTM_ID: ${{ secrets.GTM_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN_FRONTEND }}
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.TEST_STACK_SSH_KEY }}

- name: Run Ansible playbook
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbook.yml
directory: ./tests/test-infrastructure
key: ${{ secrets.TEST_STACK_SSH_KEY }}
inventory: |
[test_server]
${{ secrets.TEST_STACK_SERVER_IP }} ansible_user=ec2-user
options: |
--verbose
env:
GOVTOOL_TAG: ${{ github.sha }}
37 changes: 8 additions & 29 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,31 @@
name: Lighthouse

on:
push:
paths:
- govtool/frontend/**
- .github/workflows/lighthouse.yml
workflow_run:
workflows:
- Build and deploy GovTool test stack
types:
- completed

jobs:
lighthouse:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm install
working-directory: ./govtool/frontend

- name: Cache npm dependencies
id: npm-cache
uses: actions/cache@v3
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('govtool/frontend/package-lock.json', 'tests/govtool-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- run: npm install -g @lhci/[email protected]

- name: Run build and lighthouse task
- name: Run lighthouse task
working-directory: ./govtool/frontend
run: |
npm install
VITE_BASE_URL=https://staging.govtool.byron.network/ npm run build
lhci collect

- name: Evaluate reports
if: github.repository_owner != 'IntersectMBO'
working-directory: ./govtool/frontend
run: |
lhci assert --preset "lighthouse:recommended"

Expand All @@ -50,9 +34,4 @@ jobs:
if: github.repository_owner == 'IntersectMBO'
run: |
lhci assert --preset lighthouse:recommended || echo "LightHouse Assertion error ignored ..."
lhci upload --githubAppToken="${{ secrets.LHCI_GITHUB_APP_TOKEN }}" --token="${{ secrets.LHCI_SERVER_TOKEN }}" --serverBaseUrl=https://lighthouse.cardanoapi.io --ignoreDuplicateBuildFailure
curl -X POST https://ligththouse.cardanoapi.io/api/metrics/build-reports \
-d "@./lighthouseci/$(ls ./.lighthouseci |grep 'lhr.*\.json' | head -n 1)" \
-H "commit-hash: $(git rev-parse HEAD)" \
-H "secret-token: ${{ secrets.METRICS_SERVER_SECRET_TOKEN }}" \
-H 'Content-Type: application/json' || echo "Metric Upload error ignored ..."
lhci upload --githubAppToken="${{ secrets.LHCI_GITHUB_APP_TOKEN }}" --token="${{ secrets.LHCI_SERVER_TOKEN }}" --serverBaseUrl=https://lighthouse-govtool.cardanoapi.io --ignoreDuplicateBuildFailure
2 changes: 1 addition & 1 deletion .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- .github/workflows/test_integration_playwright.yml
workflow_run:
workflows: ["Build and deploy GovTool to TEST server"]
workflows: ["Build and deploy GovTool test stack"]
types: [completed]

jobs:
Expand Down
4 changes: 0 additions & 4 deletions gov-action-loader/backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
KUBER_API_URL=https://sanchonet.kuber.cardanoapi.io
KUBER_API_KEY=xxxxxxxxxxxxx

## Not required anymore
BLOCKFROST_API_URL=
BLOCKFROST_PROJECT_ID=
6 changes: 1 addition & 5 deletions gov-action-loader/backend/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

class Settings(BaseSettings):
kuber_api_url: str
kuber_api_key: str

blockfrost_api_url: str
blockfrost_project_id: str

kuber_api_key: str = ''

settings = Settings()
50 changes: 50 additions & 0 deletions govtool/analytics-dashboard/public/assets/svgs/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions govtool/analytics-dashboard/src/app/[locale]/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { unstable_setRequestLocale } from "next-intl/server";
import { notFound } from "next/navigation";
import '@/styles/index.css';
import ThemeProviderWrapper from "@/components/ThemeProviderWrapper";
import Head from "next/head";


export function generateStaticParams() {
Expand All @@ -14,8 +15,8 @@ export function generateStaticParams() {

// Define common metadata for the application.
export const metadata = {
title: "Web App Boilerplate",
description: "Web App Boilerplate",
title: "Participation dashboard",
description: "Participation dashboard",
};

async function RootLayout({ children, params: { locale } }) {
Expand All @@ -36,10 +37,10 @@ async function RootLayout({ children, params: { locale } }) {
<html lang={locale}>
<head>
<title>{metadata.title}</title>
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="assets/svgs/favicon.svg" />
</head>
{/* Apply font class and suppress hydration warning. */}
<body style={{ margin: 0 }} suppressHydrationWarning={true}>
<body style={{ margin: 0 }} >
{/* Provide internationalization context. */}
<NextIntlClientProvider locale={locale} messages={messages}>
{/* Wrap children in global state context */}
Expand Down
11 changes: 7 additions & 4 deletions govtool/analytics-dashboard/src/app/[locale]/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PeopleAltOutlined, ArticleOutlined, AccountBalanceWalletOutlined, HowTo
import { useTheme } from '@mui/material/styles';
import getGoogleData from '@/lib/api';
import { useEffect, useState } from 'react';
import { Link } from '@/navigation';

function Dashboard() {

Expand Down Expand Up @@ -57,7 +58,7 @@ function Dashboard() {
Participation Dashboard
</Typography>
<Typography variant="subtitle1" sx={{ color: (theme) => theme?.palette?.text?.gray }}>
This dashboard show the overall participation and usage of govtool from 1 of January 2024
This dashboard shows the overall participation and usage of SanchoNet Govtool from 1st of December 2023
</Typography>
</Box>

Expand Down Expand Up @@ -88,9 +89,11 @@ function Dashboard() {
<Typography variant="caption" display="block" gutterBottom>
© {new Date().getFullYear()} Intersect MBO
</Typography>
<Typography variant="caption" display="block" sx={{ color: (theme) => theme?.palette?.text?.primaryBlue }}>
Sancho Govtool
</Typography>
<Link href="https://sanchogov.tools/">
<Typography variant="caption" display="block" sx={{ color: (theme) => theme?.palette?.text?.primaryBlue }}>
Sancho Govtool
</Typography>
</Link>
</Box>

</Box >
Expand Down
Binary file modified govtool/analytics-dashboard/src/app/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions govtool/analytics-dashboard/src/app/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion govtool/analytics-dashboard/src/pages/api/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async function handler(req, res) {
const [response] = await analyticsDataClient.runReport({
property: `properties/${propertyId}`,
dateRanges: [{
startDate: '2024-01-01',
startDate: '2023-12-01',
endDate: 'today',
}],
dimensions: [{ name: 'eventName' }],
Expand Down
5 changes: 3 additions & 2 deletions govtool/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG BASE_IMAGE_TAG
FROM 733019650473.dkr.ecr.eu-west-1.amazonaws.com/backend-base:$BASE_IMAGE_TAG
ARG BASE_IMAGE_TAG=latest
ARG BASE_IMAGE_REPO=733019650473.dkr.ecr.eu-west-1.amazonaws.com/backend-base
FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG
WORKDIR /src
COPY . .
RUN cabal build
Expand Down
5 changes: 3 additions & 2 deletions govtool/frontend/.lighthouserc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ci:
collect:
staticDistDir: "./dist"
url:
- "http://localhost"
- https://govtool.cardanoapi.io
- https://govtool.cardanoapi.io/drep_directory
- https://govtool.cardanoapi.io/governance_actions
4 changes: 2 additions & 2 deletions scripts/govtool/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ $(target_config_dir)/grafana-provisioning/alerting/alerting.yml: $(template_conf
-i $@

$(target_config_dir)/nginx/auth.conf: $(target_config_dir)/nginx/
@:$(call check_defined, domain)
if [[ "$(domain)" == *"sanchonet.govtool.byron.network"* ]]; then \
@:$(call check_defined, env)
if [[ "$(env)" != "beta" ]]; then \
echo 'map $$http_x_forwarded_for $$auth {' > $@; \
echo " default \"Restricted\";" >> $@; \
echo " $${IP_ADDRESS_BYPASSING_BASIC_AUTH1} \"off\";" >> $@; \
Expand Down
4 changes: 2 additions & 2 deletions scripts/govtool/docker-compose.node+dbsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
retries: 5

cardano-node:
image: ghcr.io/intersectmbo/cardano-node:8.8.0-pre
image: ghcr.io/intersectmbo/cardano-node:8.10.0-pre
environment:
- NETWORK=sanchonet
volumes:
Expand All @@ -65,7 +65,7 @@ services:
retries: 10

cardano-db-sync:
image: ghcr.io/intersectmbo/cardano-db-sync:sancho-4.1.0
image: ghcr.io/intersectmbo/cardano-db-sync:sancho-4-2-1
environment:
- NETWORK=sanchonet
- POSTGRES_HOST=postgres
Expand Down
7 changes: 4 additions & 3 deletions tests/govtool-backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
BASE_URL = `URL where the api is hosted`
BASE_URL = "https://govtool.cardanoapi.io/api"
RECORD_METRICS_API = `URL where metrics is posted`
METRICS_API_SECRET= `api_secret`

# required for setup
KUBER_API_URL = ""
KUBER_API_KEY = ""
KUBER_API_URL = "https://kuber-govtool.cardanoapi.io"
KUBER_API_KEY = "" # optional
FAUCET_API_KEY= """
Loading
Loading