diff --git a/.envrc.example b/.envrc.example deleted file mode 100644 index 58f191c15..000000000 --- a/.envrc.example +++ /dev/null @@ -1,54 +0,0 @@ -# vim: set ft=bash -# This file is a template for the environment variables that need to be set and -# should be copied to `.envrc` and filled in with the correct values. - -# target environment: dev, test, staging or beta -export ENVIRONMENT= -# target AWS profile -export AWS_PROFILE= -# the codename of the Cardano Network -export CARDANO_NETWORK= -# credentials to the PostgreSQL database used by Cardano DB Sync -export DBSYNC_POSTGRES_USER= -export DBSYNC_POSTGRES_PASSWORD= -export DBSYNC_POSTGRES_DB= -# the Let's Encrypt email address -export TRAEFIK_LE_EMAIL= -# Google Tag Manager ID -export GTM_ID= -# Sentry DSN for the backend -export SENTRY_DSN_BACKEND= -# Sentry DSN for the frontend -export SENTRY_DSN= -# Sentry environment -export SENTRY_ENVIRONMENT= -# the password for the Grafana admin user -export GRAFANA_ADMIN_PASSWORD= -# the Slack channel to send Grafana alerts to -export GRAFANA_SLACK_RECIPIENT= -# the OAuth token for the Slack bot -export GRAFANA_SLACK_OAUTH_TOKEN= -# the basic auth credentials for the Nginx proxy -export NGINX_BASIC_AUTH= -# the IP addresses that bypass the basic auth -export IP_ADDRESS_BYPASSING_BASIC_AUTH1= -export IP_ADDRESS_BYPASSING_BASIC_AUTH2= - -# the domain name for the target environment -case "$ENVIRONMENT" in - "dev") - export DOMAIN="dev-${CARDANO_NETWORK}.govtool.byron.network" - ;; - "test") - export DOMAIN="test-${CARDANO_NETWORK}.govtool.byron.network" - ;; - "staging") - export DOMAIN="staging.govtool.byron.network" - ;; - "beta") - export DOMAIN="sanchogov.tools" - ;; - *) - exit 1 - ;; -esac diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9e39de450..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: Bug report -about: You might have found a bug and decide to report it -title: '' -labels: 'bug :bug:' -assignees: '' ---- - -## Context & versions - - -## Steps to reproduce - - -## Actual behavior - - -## Expected behavior - diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..417d97d52 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,96 @@ +name: πŸ› Bug report +description: You found a bug! +title: 'πŸ› ' +labels: ["πŸ› Bug"] +projects: ["IntersectMBO/30", "IntersectMBO/34"] +body: + - type: markdown + attributes: + value: | + ## 🌟 **Thank you for contributing to GovTool!** + - type: markdown + attributes: + value: | + Before submitting a new issue please check the [existing issues](https://github.com/IntersectMBO/govtool/issues) to avoid duplication. + + - type: dropdown + id: area + attributes: + label: Area + description: What part of GovTool does this feature affect? + options: + - Proposal Pillar + - Voting Pillar + - Delegation Pillar + - Wrapper + - Other + - Not sure + validations: + required: true + + - type: dropdown + id: domain + attributes: + label: Domain + description: Which GovTool instance were you connected to? + options: + - sanchogov.tools + - dev-sanchogov.tools + - test-sanchogov.tools + - stage-sanchogov.tools + - preview.gov.tools + - Custom setup + validations: + required: true + + - type: input + id: wallet + attributes: + label: Which wallet were you using? + description: Please provide which wallet and version you were using + placeholder: | + Eternl wallet v1.12.6.6 + validations: + required: false + + - type: textarea + id: context + attributes: + label: Context + description: Please give the context to what you were trying to achieve + placeholder: | + I was trying to register as a DRep and the following happened... + validations: + required: true + + - type: textarea + id: reproduce + attributes: + label: Steps to reproduce + description: Explain the steps to reproduce + placeholder: | + 1. Connect wallet + 2. Navigate to the dashboard + 3. Click on "Register as DRep" + validations: + required: true + + - type: textarea + id: actual-behavior + attributes: + label: Actual behavior + description: A description of the erroneous outcome + placeholder: | + A error came up on the screen stating... + validations: + required: true + + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: A description of what you expect to happen instead + placeholder: | + The DRep registration transaction was sent and I was registered + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature_idea.yml b/.github/ISSUE_TEMPLATE/feature_idea.yml index 67f24bc04..956ceb95f 100644 --- a/.github/ISSUE_TEMPLATE/feature_idea.yml +++ b/.github/ISSUE_TEMPLATE/feature_idea.yml @@ -1,44 +1,88 @@ -name: Feature idea +name: πŸ’‘ Feature idea description: Idea or request for some feature on the GovTool roadmap -labels: [':thought_balloon: idea'] +title: "πŸ’‘ " +labels: ["πŸ’‘ Feature idea"] +projects: ["IntersectMBO/30", "IntersectMBO/34"] body: - type: markdown attributes: - value: value: | - **Thank you for contributing to our project!** :green_heart: + ## 🌟 **Thank you for contributing to GovTool!** + - type: markdown + attributes: + value: | + Before submitting a new issue consider [starting a new discussion](https://github.com/IntersectMBO/govtool/discussions/new?category=ideas). - Instead of opening this issue, consider [starting a new idea discussion](https://github.com/IntersectMBO/govtool/discussions/new?category=ideas). - That way, we can discuss & refine your idea together, before we adopt it as a feature into the roadmap. + - type: dropdown + id: area + attributes: + label: Area + description: What part of GovTool does this feature affect? + options: + - Proposal Pillar + - Voting Pillar + - Delegation Pillar + - Wrapper + - Other + - Not sure + validations: + required: true - - type: textarea - id: why + - type: dropdown + id: design-needed attributes: - label: Why - description: Why do we need or want this feature - placeholder: | - Give context and describe the problem, challenge or opportunity you see + label: Is there new design needed? + description: Will this feature require new or edit to existing frontend designs? + options: + - 'Yes' + - 'No' + - Not sure validations: required: true - type: textarea id: what attributes: - label: What - description: What is this feature roughly about + label: What? + description: What is this feature? placeholder: | - For example describe a new API endpoint, a change in messaging formats, + For example describe a new API endpoint, a change in wording, a new configuration option, ... validations: required: true + - type: textarea + id: why + attributes: + label: Why? + description: Why do we need or want this feature? + placeholder: | + Give context and describe the problem the idea solves + validations: + required: true + - type: textarea id: how attributes: - label: How - description: How could we realize this feature + label: How? + description: How can we realize this feature? placeholder: | Which technical solutions, libraries or systems should be used, which components need to change, steps how to implement this, ... validations: required: true + + - type: markdown + attributes: + value: | + --- + + - type: textarea + id: user-story + attributes: + label: (Optional) User Story with acceptance criteria + description: See GovTool examples [here](https://github.com/IntersectMBO/cardano-test-plans/blob/main/userStoryInventoryChangHF.md#2g-delegate-to-self-for-registered-dreps). + placeholder: | + As a [ada holder | DRep | Direct voter], I want [some goal] so that [some reason]. + validations: + required: false \ No newline at end of file diff --git a/.github/images/voltaire-govtool-header.png b/.github/images/voltaire-govtool-header.png new file mode 100644 index 000000000..7fa135a88 Binary files /dev/null and b/.github/images/voltaire-govtool-header.png differ diff --git a/.github/workflows/build-and-deploy-staging.yml b/.github/workflows/build-and-deploy-staging.yml index 8f854a5ca..27d10fdb0 100644 --- a/.github/workflows/build-and-deploy-staging.yml +++ b/.github/workflows/build-and-deploy-staging.yml @@ -61,7 +61,7 @@ jobs: SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} + IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} PDF_API_URL: ${{ secrets.PDF_API_URL}} steps: - name: Checkout code diff --git a/.github/workflows/build-and-deploy-test.yml b/.github/workflows/build-and-deploy-test.yml index 57c47f6c5..64cc7a89f 100644 --- a/.github/workflows/build-and-deploy-test.yml +++ b/.github/workflows/build-and-deploy-test.yml @@ -61,7 +61,7 @@ jobs: SENTRY_IGNORE_API_RESOLUTION_ERROR: "1" TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com" USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} - IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'false' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} + IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{github.event_name == 'push' && 'true' || inputs.isProposalDiscussionForumEnabled == 'enabled'}} PDF_API_URL: ${{ secrets.PDF_API_URL}} steps: - name: Checkout code diff --git a/.github/workflows/label-bug-report.yml b/.github/workflows/label-bug-report.yml new file mode 100644 index 000000000..230ffefc0 --- /dev/null +++ b/.github/workflows/label-bug-report.yml @@ -0,0 +1,54 @@ +name: Add labels to πŸ› Bug report issues + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + apply-labels: + runs-on: ubuntu-latest + steps: + - name: Check if issue is a "πŸ› Bug report" + id: check_is_bug_report + run: | + echo "## Checking if issue is a 'Feature idea'..." + if [[ "${{ github.event.issue.title }}" == "πŸ› "* ]]; then + echo "is_bug_report=true" >> $GITHUB_ENV + else + echo "is_bug_report=false" >> $GITHUB_ENV + fi + + - name: Apply label based on feature area + if: ${{ env.is_bug_report == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const areaMap = { + "Proposal Pillar": "πŸ“œ Proposal Pillar", + "Voting Pillar": "πŸ—³οΈ Voting Pillar", + "Delegation Pillar": "β™ŸοΈ Delegation Pillar", + "Wrapper": "🎁 Wrapper", + "Other": "Other area", + "Not sure": "❓Unknown area", + }; + + const issueBody = context.payload.issue.body; + + // Match the Area selected under the "### Area" header + const areaMatch = issueBody.match(/### Area\s*\n\s*(.*)\s*\n/); + const area = areaMatch ? areaMatch[1].trim() : null; + + const labelToAdd = areaMap[area]; + + if (labelToAdd) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [labelToAdd], + }); + } diff --git a/.github/workflows/label-feature-issue.yml b/.github/workflows/label-feature-issue.yml new file mode 100644 index 000000000..9ef4d6c86 --- /dev/null +++ b/.github/workflows/label-feature-issue.yml @@ -0,0 +1,92 @@ +name: Add labels to πŸ’‘ Feature idea issues + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + apply-labels: + runs-on: ubuntu-latest + steps: + - name: Check if issue is a "πŸ’‘ Feature idea" + id: check_is_feature_idea + run: | + echo "## Checking if issue is a 'Feature idea'..." + if [[ "${{ github.event.issue.title }}" == "πŸ’‘ "* ]]; then + echo "is_feature_idea=true" >> $GITHUB_ENV + else + echo "is_feature_idea=false" >> $GITHUB_ENV + fi + + - name: Apply label based on feature area + if: ${{ env.is_feature_idea == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const areaMap = { + "Proposal Pillar": "πŸ“œ Proposal Pillar", + "Voting Pillar": "πŸ—³οΈ Voting Pillar", + "Delegation Pillar": "β™ŸοΈ Delegation Pillar", + "Wrapper": "🎁 Wrapper", + "Other": "Other area", + "Not sure": "❓Unknown area", + }; + + const issueBody = context.payload.issue.body; + + // Match the Area selected under the "### Area" header + const areaMatch = issueBody.match(/### Area\s*\n\s*(.*)\s*\n/); + const area = areaMatch ? areaMatch[1].trim() : null; + + const labelToAdd = areaMap[area]; + + if (labelToAdd) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [labelToAdd], + }); + } + + - name: Apply "🎨 Design Needed" label if design needed is "Yes" + if: ${{ env.is_feature_idea == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const issueBody = context.payload.issue.body; + + // Match the "Yes" selection under the "### Is there new design needed?" header + const designNeededMatch = issueBody.match(/### Is there new design needed\?\s*\n\s*Yes\s*\n/); + + if (designNeededMatch) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["🎨 Design Needed"], + }); + } + + - name: Apply "User Story Needed" label if user story not provided + if: ${{ env.is_feature_idea == 'true' }} + uses: actions/github-script@v6 + with: + script: | + const issueBody = context.payload.issue.body; + + const userStoryPattern = /### \(Optional\) User Story with acceptance criteria\s*\n\s*_No response_/; + const userStoryMissing = userStoryPattern.test(issueBody); + + if (userStoryMissing) { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["User Story Needed"], + }); + } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 85f392f4f..05f1097fb 100644 --- a/.gitignore +++ b/.gitignore @@ -137,8 +137,8 @@ scripts/govtool/dev-postgres_user scripts/govtool/dev-postgres_password # nodejs/yarn - node_modules +.yarn # sonar scanner .scannerwork/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index e5d0bd8ac..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - -- repo: local - hooks: - - id: hlint - name: hlint - description: HLint gives suggestions on how to improve your source code. - entry: hlint - language: system - files: '\.l?hs$' - - - id: stylish-haskell - name: stylish-haskell - description: Haskell code format checker. - entry: stylish-haskell --config govtool/backend/.stylish-haskell.yaml - language: system - files: '\.l?hs$' diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a7d62a5..1295a98cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,32 @@ changes. - +## [sancho-v1.0.13](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.13) 2024-08-22 + +### Added + +- Unsancho GovTool [Issue 1637](https://github.com/IntersectMBO/govtool/issues/1637) +- Add network metrics model to frontend service +- Added workflows to add labels to issues +- Make voting on governance actions enabled based on protocol version [Issue 1703](https://github.com/IntersectMBO/govtool/issues/1703) + +### Fixed + +- Incorrect copy on DRep votes + other minor copy spelling mistakes +- Remove incorrect @value property to fix validating the metadata body [Issue 1687](https://github.com/IntersectMBO/govtool/issues/1687) +- Fix PDF not enabled in default deployments +- Fix displaying incorrect connected to Voltaire GovTool network +- Runtime error at /edit_drep when metadata incorrect [Issue 1675](https://github.com/IntersectMBO/govtool/issues/1675) +- Restrict access to registration routes when user s already registered and to retirement routes when the use is not registered [Issue 1183](https://github.com/IntersectMBO/govtool/issues/1183) +- Add missing data-testid attributes [Issue 1050](https://github.com/IntersectMBO/govtool/issues/1050) + +### Changed + +- Changed stake key registration to use the newer Conway type of certificate +- Changed and improved issue templates +- Changed wording and image in base README +- Change link to docs + ## [sancho-v1.0.12](https://github.com/IntersectMBO/govtool/releases/tag/sancho-v1.0.12) 2024-08-01 ### Added diff --git a/CODEOWNERS b/CODEOWNERS index 27885d4d5..91d3c7698 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,10 +4,10 @@ * @Ryun1 @MSzalowski # Frontend assets templates -govtool/frontend/* @MSzalowski @Sworzen1 @JanJaroszczak -*.tsx @MSzalowski @Sworzen1 @JanJaroszczak -*.ts @MSzalowski @Sworzen1 @JanJaroszczak -*.css @MSzalowski @Sworzen1 @JanJaroszczak +govtool/frontend/* @MSzalowski @jdyczka +*.tsx @MSzalowski @jdyczka +*.ts @MSzalowski @jdyczka +*.css @MSzalowski @jdyczka # Backend govtool/backend/* @MSzalowski @jankun4 @@ -18,5 +18,5 @@ config/govtool/* @pla infra/terraform/* @placek @adgud # Testing -tests/* @IntersectMBO/govtool-test -gov-action-loader/* @IntersectMBO/govtool-test +tests/* @spannercode @mesudip @kneerose +gov-action-loader/* @spannercode @mesudip @kneerose diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b348e3850..ccc9e9126 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,7 @@ ⚠️ This is a work in progress document, more instruction on how-to contribute to come! Contributing todo: + - [ ] Align with latest OSC policies - [ ] Refactor to reflect reality - [ ] Make more friendly to open source contributors @@ -21,9 +22,9 @@ This document contains guidelines to help you get started and how to make sure y - [Ask for Help](#ask-for-help) - [Roles and Responsibilities](#roles-and-responsibilities) - [I Want To Contribute](#i-want-to-contribute) - - [Before Submitting a Bug Report](#before-submitting-a-bug-report) - - [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report) - - [Your First Code Contribution](#your-first-code-contribution) + - [Before Submitting a Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit a Good Bug Report?](#how-do-i-submit-a-good-bug-report) + - [Your First Code Contribution](#your-first-code-contribution) - [Working Conventions](#working-conventions) - [Pull Requests](#pull-requests) - [Branch Naming](#branch-naming) @@ -38,8 +39,6 @@ This document contains guidelines to help you get started and how to make sure y - [CSS in Javascript](#css-in-javascript) - [CSS / SASS](#css--sass) - [Haskell](#haskell) - - [Bumping Node, DB-Sync, SanchoNet Versions](#bumping-node-db-sync-sanchonet-versions) - - [Steps to upgrade](#steps-to-upgrade) - [Development Processes](#development-processes) - [Developer workflow](#developer-workflow) - [QA Workflow](#qa-workflow) @@ -90,7 +89,7 @@ We use GitHub issues to track bugs and errors. If you run into an issue with the (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible. - Describe the *reproduction steps* that someone else can follow to recreate the issue on their own. + Describe the _reproduction steps_ that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. - Provide the information you collected in the previous section. @@ -117,6 +116,7 @@ TODO Thank you for contributing your changes by opening a pull requests! To get something merged we usually require: + - Follow the Pull Request template - Description of the changes - if your commit messages are great, this is less important - Quality of changes is ensured - through new or updated automated tests @@ -133,6 +133,7 @@ Please reuse the branch naming for the pull request naming. - Using the related issue number after the prefix is required. Examples: + - `feat/123-added-ability-for-dreps-to-change-drep-id` - `fix/312-fixed-drep-ids-being-reversed` - `chore/567-bumped-cardano-node-version-to-9` @@ -151,6 +152,7 @@ Also, include any relevant meta-information, such as issue numbers. If a commit completely addresses a issue, you can put that in the headline if you want, but it’s fine to just put it in the body. Here are seven rules for great git commit messages: + 1. Separate subject from body with a blank line 2. Limit the subject line to 50 characters (soft limit) 3. Capitalize the subject line @@ -190,6 +192,7 @@ Releases that aren't stable will be released as pre-releases and will append a - ### Changelog During development, on every PR; + - Make sure `CHANGELOG.md` is kept up-to-date with high-level, technical, but user-focused list of changes according to [keepachangelog](https://keepachangelog.com/en/1.0.0/). - Bump `UNRELEASED` version in `CHANGELOG.md` according to [semver](https://semver.org/). @@ -211,25 +214,6 @@ Please see [CSS / SASS Style Guide](./docs/style-guides/css-sass/). Please see [stylish-haskell configuration](./govtool/backend/.stylish-haskell.yaml). -## Bumping Node, DB-Sync, SanchoNet Versions - -- SanchoNet periodically has to be respun, where all data is erased. -- This is normally to allow for the nodes to be upgraded to a new version, where the old chain may not be compatible with newer node implementation. -- So to go along with each respin GovTool's Node needs to upgraded to a newer version and it's local database must be dropped. -- New versions of DB-Sync are usually released alongside new Node versions, to ensure compatibility. -- Some new versions of DB-Sync will include revisions to the DB schema, if this is the case then we also need to upgrade the BE interface to work. - -### Steps to upgrade - -1. Coordinate and align with DB-Sync/Node teams to anticipate SanchoNet respins and version releases. Once network has been respun upgrade. -- Often a new node version is released a few days ahead of a Sanchonet respin, DB-Sync is normally a couple of days post node release. -2. Change the versions in the [docker-compose file](./src/docker-compose.sanchonet.yml), here the DB-Sync and Node docker versions can be incremented. Merge this change, following standard working conventions. -- IF the DB-Sync schema changed, then BE changes will have to be merged also. -3. Then the upgrade can be deployed using normal workflows, ensure to tick `resync_cardano_node_and_db` option of the workflow. This will wipe the existing Node and Db-Sync's data, to let the upgraded versions fully resync. -4. Wait for resync, depending on the size SanchoNet resycing will likely take over an hour. -5. Check successful resync, using the BE you are able to check transaction status. You can use the SanchoNet faucet to send transactions, then check faucet Tx id via GovTool BE. If GovTool sees the Tx then GovTool BE is on the same network as the faucet which is ideal. - - ## Development Processes ### Developer workflow diff --git a/README.md b/README.md index 71c40ecb1..0f81436cc 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@

- +

- Monorepo containing SanchoNet GovTool and supporting utilities + Monorepo containing Voltaire GovTool and supporting utilities

[![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/npm) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - -[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=ncloc)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=coverage)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=sqale_index)](https://sonarcloud.io/summary/overall?id=intersect-govtool) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=ncloc)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=coverage)](https://sonarcloud.io/summary/overall?id=intersect-govtool) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=intersect-govtool&metric=sqale_index)](https://sonarcloud.io/summary/overall?id=intersect-govtool)
@@ -19,18 +18,32 @@ ## πŸŒ„ Purpose -The SanchoNet GovTool enables ada holders to experience some of the governance features described in [CIP-1694](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1694/README.md) and to test governance features on [SanchoNet](https://sancho.network/) through a guided and straightforward experience. -The SanchoNet GovTool is currently open for beta testing and can be accessed at [sanchogov.tools](https://sanchogov.tools/). +The Voltaire GovTool enables ada holders to experience the governance features described in [CIP-1694](https://github.com/cardano-foundation/CIPs/blob/master/CIP-1694/README.md). + +### Instances + +#### Mainnet + +- _Coming soon_ + +#### SanchoNet -Learn more; [docs.sanchogov.tools](https://docs.sanchogov.tools/). +- [sanchogov.tools](https://sanchogov.tools/) + +#### Preview Testnet + +- [preview.gov.tools](https://preview.gov.tools/) + +### Documentation + +Learn more; [docs.gov.tools](https://docs.gov.tools/). ## πŸ“ Navigation -- [GovTool Backend](./govtool/backend/README.md) -- [GovTool Frontend](./govtool/frontend/README.md) -- [GovTool Infrastructure](./infra/terraform/README.md) -- [GovTool deployment process](./scripts/govtool/README.md) -- [Documentation](./docs/) +- [Backend](./govtool/backend/README.md) +- [Frontend](./govtool/frontend/README.md) +- [Infrastructure](./infra/terraform/README.md) +- [In repo documentation](./docs/) - [Tests](./tests/) ### Utilities @@ -51,6 +64,4 @@ Frontend is able to connect to Cardano wallets over the [CIP-30](https://github. Thanks for considering contributing and helping us on creating GovTool! 😎 -⚠️ We are in the process of improving our contributing documentation, improvements to come. - Please checkout our [Contributing Documentation](./CONTRIBUTING.md). diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 852a97e80..9b8e3fafa 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -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.sanchogov.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/how-to-use-the-govtool/getting-started/get-a-compatible-wallet)). # Components diff --git a/docs/operations/README.md b/docs/operations/README.md index 4b6ab139f..f14769304 100644 --- a/docs/operations/README.md +++ b/docs/operations/README.md @@ -1,12 +1,13 @@ # Overview The application is setup with the following tools: -* Terraform - for creating infrastructure in AWS for each environment -* Docker - to build and run application components -* Docker Compose - to connect the application components together and deploy them as a stack -* make - to simplify operations tasks -* Prometheus - to gather metrics from application host and Docker containers -* Grafana - to visualize metrics gathered from Prometheus and handle alerting + +- Terraform - for creating infrastructure in AWS for each environment +- Docker - to build and run application components +- Docker Compose - to connect the application components together and deploy them as a stack +- make - to simplify operations tasks +- Prometheus - to gather metrics from application host and Docker containers +- Grafana - to visualize metrics gathered from Prometheus and handle alerting # Environments @@ -14,11 +15,11 @@ The application is hosted on AWS, there are several application environments, ea Each environment consists of: -* VPC network (with subnets, route tables, IGW) -* Security Groups -* EC2 instance -* Elastic IPs associated with EC2 instance -* Route 53 record (only for environments using `govtool.byron.network` domain) +- VPC network (with subnets, route tables, IGW) +- Security Groups +- EC2 instance +- Elastic IPs associated with EC2 instance +- Route 53 record (only for environments using `govtool.byron.network` domain) For each environment, the frontend is hosted at root and the backend is at `/api`. @@ -26,25 +27,27 @@ For each environment, the frontend is hosted at root and the backend is at `/api ### beta -A beta environment connected to `sanchonet` Cardano network. +A beta environment connected to `preview` Cardano network. -Available at https://sanchogov.tools/. The DNS record for this domain is created manually. +Available at https://preview.gov.tools/. The DNS record for this domain is created manually. # Deployment Deployment is performed via GitHub Actions workflow (`.github/workflows/build-and-deploy.yml`). The workflow performs the following steps: -* check if the environment is defined in Terraform (to avoid deployment attempt to inexistant environment) -* build of frontend app -* build of backend app -* generate configuration files and upload them (over SSH) to the target environment -* setup the application compoments with Docker Compose on the target environment + +- check if the environment is defined in Terraform (to avoid deployment attempt to inexistant environment) +- build of frontend app +- build of backend app +- generate configuration files and upload them (over SSH) to the target environment +- setup the application compoments with Docker Compose on the target environment The workflow can be triggered directly from GitHub Actions panel. When ruuning the workflow, you need to specify: -* Cardano network to be used -* environment name -* optionally skip the build process (frontend and backend) - useful when there are plain configuration changes that do not require the application to be rebuild + +- Cardano network to be used +- environment name +- optionally skip the build process (frontend and backend) - useful when there are plain configuration changes that do not require the application to be rebuild # Monitoring diff --git a/govtool/backend/Dockerfile b/govtool/backend/Dockerfile index a00c89242..fbeb614a3 100644 --- a/govtool/backend/Dockerfile +++ b/govtool/backend/Dockerfile @@ -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.12/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.13/x/vva-be/build/vva-be/vva-be /usr/local/bin diff --git a/govtool/backend/Dockerfile.qovery b/govtool/backend/Dockerfile.qovery index d651afec4..a6789ec65 100644 --- a/govtool/backend/Dockerfile.qovery +++ b/govtool/backend/Dockerfile.qovery @@ -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.12/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.13/x/vva-be/build/vva-be/vva-be /usr/local/bin # Expose the necessary port EXPOSE 9876 diff --git a/govtool/backend/vva-be.cabal b/govtool/backend/vva-be.cabal index 0b587c204..022b13ace 100644 --- a/govtool/backend/vva-be.cabal +++ b/govtool/backend/vva-be.cabal @@ -1,6 +1,6 @@ cabal-version: 3.6 name: vva-be -version: 1.0.12 +version: 1.0.13 -- A short (one-line) description of the package. -- synopsis: diff --git a/govtool/frontend/.storybook/preview.tsx b/govtool/frontend/.storybook/preview.tsx index 87b01a7d2..24de697e5 100644 --- a/govtool/frontend/.storybook/preview.tsx +++ b/govtool/frontend/.storybook/preview.tsx @@ -4,6 +4,9 @@ import React from "react"; import { I18nextProvider } from "react-i18next"; import { QueryClient, QueryClientProvider } from "react-query"; import { MemoryRouter, Route, Routes } from "react-router-dom"; + +import { FeatureFlagProvider } from "../src/context/featureFlag"; +import { AppContextProvider } from "../src/context/appContext"; import { ModalProvider } from "../src/context/modal"; import i18n from "../src/i18n"; import { theme } from "../src/theme"; @@ -23,30 +26,34 @@ const preview: Preview = { decorators: [ (Story) => ( - - - - - - - - - } - /> - - - - - + + + + + + + + + + + } + /> + + + + + + + ), ], diff --git a/govtool/frontend/Dockerfile.qovery b/govtool/frontend/Dockerfile.qovery new file mode 100644 index 000000000..33e83cbe9 --- /dev/null +++ b/govtool/frontend/Dockerfile.qovery @@ -0,0 +1,31 @@ +FROM node:18-alpine as builder + +ARG VITE_APP_ENV='beta' +ARG VITE_BASE_URL +ARG VITE_METADATA_API_URL +ARG VITE_GTM_ID +ARG VITE_NETWORK_FLAG=0 +ARG VITE_SENTRY_DSN +ARG NPMRC_TOKEN +ARG VITE_USERSNAP_SPACE_API_KEY +ARG VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='true' +ARG VITE_PDF_API_URL + +ENV NODE_OPTIONS=--max_old_space_size=8192 + +WORKDIR /src + +# Set npm configuration settings using environment variables +RUN npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global +RUN npm config set //registry.npmjs.org/:_authToken ${NPMRC_TOKEN} --location=global + +COPY package.json package-lock.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM nginx:stable-alpine +EXPOSE 80 +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /src/maintenance-page/index.html /usr/share/nginx/html/maintenance.html +COPY --from=builder /src/dist /usr/share/nginx/html diff --git a/govtool/frontend/index.html b/govtool/frontend/index.html index 9fa7c8404..e3ff67282 100644 --- a/govtool/frontend/index.html +++ b/govtool/frontend/index.html @@ -10,7 +10,7 @@ rel="stylesheet" /> - SanchoNet Govtool + Voltaire Govtool