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

test: resolve develop to test conflicts #185

Merged
merged 20 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"fakedbsyncconfig" : {
"host" : "localhost",
"dbname" : "vva",
"dbname" : "govtool",
"user" : "postgres",
"password" : "MTnk8lsuMM41RgAh1y2WTAUdObsb",
"port" : 5432
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ jobs:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
FAKEDBSYNC_POSTGRES_DB: "vva"
FAKEDBSYNC_POSTGRES_DB: "govtool"
FAKEDBSYNC_POSTGRES_USER: "test"
FAKEDBSYNC_POSTGRES_PASSWORD: "test"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+vva@binarapps.com"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -191,15 +191,15 @@ jobs:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
FAKEDBSYNC_POSTGRES_DB: "vva"
FAKEDBSYNC_POSTGRES_DB: "govtool"
FAKEDBSYNC_POSTGRES_USER: "test"
FAKEDBSYNC_POSTGRES_PASSWORD: "test"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+vva@binarapps.com"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend_sonar_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
execute_sonar_scanner:
name: Execute sonar-scanner on vva-fe
name: Execute sonar-scanner on govtool frontend
runs-on: ubuntu-latest
permissions: read-all
steps:
Expand All @@ -26,4 +26,4 @@ jobs:
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm install
working-directory: ./govtool/frontend
Expand All @@ -27,7 +27,7 @@ jobs:
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('govtool/frontend/package-lock.json', 'tests/vva-fe/package-lock.json') }}
key: ${{ runner.os }}-npm-${{ hashFiles('govtool/frontend/package-lock.json', 'tests/govtool-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

Expand All @@ -45,7 +45,6 @@ jobs:
run: |
lhci assert --preset "lighthouse:recommended"


- name: Publish reports
working-directory: ./govtool/frontend
if: github.repository_owner == 'IntersectMBO'
Expand All @@ -56,4 +55,4 @@ jobs:
-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 ..."
-H 'Content-Type: application/json' || echo "Metric Upload error ignored ..."
10 changes: 5 additions & 5 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
paths:
- .github/workflows/test_backend.yml
# - src/vva-be
# - tests/vva-be
# - govtool/backend
# - tests/govtool-backend

schedule:
- cron: '0 0 * * *'
Expand All @@ -18,23 +18,23 @@ on:
options:
- "sanchogov.tools/api"
- "staging.govtool.byron.network/api"
- "vva-sanchonet.cardanoapi.io/api"
- "govtool-sanchonet.cardanoapi.io/api"

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

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.4
cache: 'pip'

- name: Run Backend Test
working-directory: tests/vva-be
working-directory: tests/govtool-backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test_integration_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ on:
options:
- "sanchogov.tools"
- "staging.govtool.byron.network"
- "vva-sanchonet.cardanoapi.io"
- "govtool-sanchonet.cardanoapi.io"

jobs:
cypress-tests:
defaults:
run:
working-directory: ./tests/vva-fe
working-directory: ./tests/govtool-frontend
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
Expand All @@ -50,15 +50,15 @@ jobs:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
key:
${{ runner.os }}-yarn-${{hashFiles('tests/vva-fe/yarn.lock') }}
${{ runner.os }}-yarn-${{hashFiles('tests/govtool-frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Cypress run
uses: cypress-io/github-action@v6
with:
record: true
working-directory: ./tests/vva-fe
working-directory: ./tests/govtool-frontend
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
Expand All @@ -69,4 +69,3 @@ jobs:
CYPRESS_kuberApiKey: ${{secrets.KUBER_API_KEY}}
CYPRESS_faucetApiUrl: https://faucet.${{inputs.network || 'sanchonet'}}.world.dev.cardano.org
CYPRESS_faucetApiKey: ${{ secrets.FAUCET_API_KEY }}

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.
- i18next library added to FE [Issue 80](https://github.com/IntersectMBO/govtool/issues/80)

### Fixed
- Fix misleading metadata hash text [Issue 90](https://github.com/IntersectMBO/govtool/issues/90)
- Fixed vote calculation problems related to NoConfidence DRep [Issue 59](https://github.com/IntersectMBO/govtool/issues/59)
- Fixed ada-holder/get-current-delegation error when delegated to NoConfidence or AlwaysAbstain dreps. [Issue 82](https://github.com/IntersectMBO/govtool/issues/82)

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The SanchoNet GovTool is currently open for beta testing and can be accessed at
Learn more; [docs.sanchogov.tools](https://docs.sanchogov.tools/).

## 📍 Navigation
- [GovTool Backend](./src/vva-be/README.md)
- [GovTool Frontend](./src/vva-fe/README.md)
- [GovTool Backend](./govtool/backend/README.md)
- [GovTool Frontend](./govtool/frontend/README.md)
- [Documentation](./docs/)
- [Tests](./tests/)

Expand All @@ -45,4 +45,4 @@ Frontend is able to connect to Cardano wallets over the [CIP-30](https://github.

## 🤝 Contributing
Thanks for considering contributing and helping us on creating GovTool! 😎
Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
20 changes: 18 additions & 2 deletions docs/operations/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AWS is configured with Terraform, but the account needs to be bootstrapped befor
This has to be done only once per AWS account.

1. Configure AWS CLI with `aws configure` (if you are using a configuration profile, use `aws --profile MYPROFILE configure` and then `export AWS_PROFILE=MYPROFILE`).
1. Execute `./src/terraform/bootstrap-aws-account.sh` script.
1. Execute `./infra/terraform/bootstrap-aws-account.sh` script.

### Infrastructure setup

Expand All @@ -29,7 +29,7 @@ This has to be done only once per AWS account.
1. Run `terraform plan` to view changes that would be performed to infrastructure.
1. Take note of the outputs - they contain ECR repo URLs and app domains.

Note: the Terraform code configures the EC2 instance using `src/terraform/modules/vva-ec2/user_data.sh`. This script is only executed on instance creation.
Note: the Terraform code configures the EC2 instance using `infra/terraform/modules/govtool-ec2/user_data.sh`. This script is only executed on instance creation.

## Application deployment

Expand All @@ -52,3 +52,19 @@ Alternatively you can type `make all instance=$INSTANCE cardano_network=$CARDANO

View the app at `https://${ENVIRONMENT}-${INSTANCE}.govtool.byron.network`.
Keep in mind that after initial deployment on a new environment, it will take some time for the Cardano node to get in sync.

## Aftermatch

After performing a deploy from a local machine, it is crucial to carefully track
the application's accessibility and functionality to ensure no unintended
changes, such as the accidental activation of BasicAuth[^1], have occurred.

Additionally, verifying that all configuration files and environment variables,
particularly those related to environment-specific settings like database
connections or external service endpoints, are correctly generated and applied
is essential for maintaining the intended behavior of the application across
different environments. This includes a thorough check of environment variables
to confirm they are correctly set and aligned with the specific needs of the
deployed environment.

[^1]: https://github.com/IntersectMBO/govtool/discussions/174
8 changes: 5 additions & 3 deletions govtool/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a backend application of GovTool project.

## Prerequisites
In order to run `vva-be` your host machine will need access to the `cardano-db-sync` postgres database. To have this database running locally you'll need:
In order to run `backend` your host machine will need access to the `cardano-db-sync` postgres database. To have this database running locally you'll need:
* `cardano-node`
* `cardano-db-sync`
* PostgreSQL database
Expand All @@ -24,10 +24,10 @@ Due to problems with openapi3 package it's hard to build this project with plain

1. Get [Nix](https://nixos.org/download).

2. Enter `src/vva-be` directory:
2. Enter `govtool/backend` directory:

```sh
cd src/vva-be
cd govtool/backend
```

3. Allow broken nix packages
Expand All @@ -54,3 +54,5 @@ Due to problems with openapi3 package it's hard to build this project with plain
```sh
cabal run vva-be -- --config <YOUR CONFIG FILE> start-app
```
> [!WARNING]
> In the context of our ongoing project enhancements, it is assumed that the executable previously known as 'vva-be' should be now officially renamed to 'govtool-backend'. This change is necessary for aligning with the updated branding and functional scope of the application and it has to be implemented in the near future as a chore and refactoring ticket. Make sure that the documentation matches the actual name of the executable.
24 changes: 12 additions & 12 deletions govtool/frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Voltaire GovTool Frontend
# GovTool Frontend

Installed on your machine:

Expand All @@ -16,7 +16,7 @@ Fill .env based on env.example file
Go to the project directory

```bash
cd voltaire-era/src/vva-fe
cd voltaire-era/govtool/frontend
```

Install dependencies
Expand Down Expand Up @@ -47,10 +47,10 @@ yarn dev

1. Get [Nix](https://nixos.org/download).

2. Enter `src/vva-fe` directory:
2. Enter `govtool/frontend` directory:

```sh
cd src/vva-fe
cd govtool/frontend
```

3. Run `nix-shell`
Expand All @@ -75,13 +75,13 @@ Install [`direnv`](https://direnv.net/):
nix-env -i direnv
```

Allow direnv configuration in `src/vva-fe`:
Allow direnv configuration in `govtool/frontend`:

```sh
direnv allow src/vva-fe
direnv allow govtool/frontend
```

From now on, once you enter the `src/vva-fe` the `nix-shell` with proper
From now on, once you enter the `govtool/frontend` the `nix-shell` with proper
configuration will be propagated.

## Developing
Expand Down Expand Up @@ -128,9 +128,9 @@ npm run dev

1. Get [Nix](https://nixos.org/download).

2. Enter `src/vva-fe` directory:
2. Enter `govtool/frontend` directory:
```sh
cd src/vva-fe
cd govtool/frontend
```

3. Run `nix-shell`
Expand All @@ -152,12 +152,12 @@ Install [`direnv`](https://direnv.net/):
nix-env -i direnv
```

Allow direnv configuration in `src/vva-fe`:
Allow direnv configuration in `govtool/frontend`:
```sh
direnv allow src/vva-fe
direnv allow govtool/frontend
```

From now on, once you enter the `src/vva-fe` the `nix-shell` with proper
From now on, once you enter the `govtool/frontend` the `nix-shell` with proper
configuration will be propagated.

### Users
Expand Down
13 changes: 2 additions & 11 deletions govtool/frontend/src/components/atoms/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import {
Button as MUIButton,
ButtonProps as MUIButtonProps,
SxProps,
} from "@mui/material";

interface ButtonProps extends Omit<MUIButtonProps, "size" | "sx" | "variant"> {
size?: "small" | "medium" | "large" | "extraLarge";
variant?: "contained" | "outlined" | "text";
sx?: SxProps;
}
import { Button as MUIButton } from "@mui/material";
import { ButtonProps } from ".";

export const Button = ({
size = "large",
Expand Down
Loading