Skip to content

Commit

Permalink
Merge pull request #779 from IntersectMBO/pretest
Browse files Browse the repository at this point in the history
Pretest: DRep Directory Updates and Backend Enhancements: Improvements and Fixes
  • Loading branch information
pmbinapps authored Apr 19, 2024
2 parents c38b70c + fce6145 commit a210181
Show file tree
Hide file tree
Showing 193 changed files with 8,932 additions and 6,951 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
PIPELINE_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
IP_ADDRESS_BYPASSING_BASIC_AUTH1: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH1 }}
IP_ADDRESS_BYPASSING_BASIC_AUTH2: ${{ secrets.IP_ADDRESS_BYPASSING_BASIC_AUTH2 }}
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
127 changes: 101 additions & 26 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Backend Test
on:
push:
paths:
- .github/workflows/test_backend.yml
- .github/workflows/test_backend.yml
# - govtool/backend
# - tests/govtool-backend

schedule:
- cron: '0 0 * * *'
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
deployment:
Expand All @@ -21,29 +21,104 @@ on:
- "govtool-sanchonet.cardanoapi.io/api"

jobs:
build:
backend-tests:
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/govtool-backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pytest -v --github-report
env:
BASE_URL: https://${{inputs.deployment || 'staging.govtool.byron.network/api' }}
METRICS_URL: https://metrics.cardanoapi.io
METRICS_API_SECRET: "${{ secrets.METRICS_SERVER_SECRET_TOKEN }}"

# - uses: schemathesis/action@v1
# with:
# schema: "http://localhost:8080/swagger.json"
- 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/govtool-backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python -m pytest --alluredir allure-results
env:
BASE_URL: https://${{inputs.deployment || 'staging.govtool.byron.network/api' }}
METRICS_URL: https://metrics.cardanoapi.io
METRICS_API_SECRET: "${{ secrets.METRICS_SERVER_SECRET_TOKEN }}"

- name: Upload report
uses: actions/upload-artifact@v3
if: always()
with:
name: allure-results
path: tests/govtool-backend/allure-results

publish-report:
runs-on: ubuntu-latest
if: always()
needs: backend-tests
steps:
- uses: actions/checkout@v4
- name: Download results
uses: actions/download-artifact@v3
with:
name: allure-results
path: allure-results

- name: Get Allure history
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
repository: ${{vars.GH_PAGES}}
token: ${{secrets.PERSONAL_TOKEN}}

- name: Register report
id: register-project
if: ${{success()}}
run: |
chmod +x ./register_report.sh
./register_report.sh
- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
repository-name: ${{vars.GH_PAGES}}
branch: gh-pages
folder: project

- name: Generate report details
id: report-details
run: |
chmod +x ./generate_report_details.sh
./generate_report_details.sh
- name: Build report
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages/${{env.REPORT_NAME}}
allure_report: allure-report
allure_history: allure-history
keep_reports: 2000
report_url: ${{steps.report-details.outputs.report_url}}
github_run_num: ${{steps.report-details.outputs.report_number}}

- name: Generate Latest Report
run: |
chmod +x ./generate_latest_report_redirect.sh
./generate_latest_report_redirect.sh ${{steps.report-details.outputs.report_number}}
- name: Deploy report to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
repository-name: ${{vars.GH_PAGES}}
branch: gh-pages
folder: build
target-folder: ${{ env.REPORT_NAME }}

env:
REPORT_NAME: backend
GH_PAGES: ${{vars.GH_PAGES}}
132 changes: 132 additions & 0 deletions .github/workflows/test_integration_playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Integration Test [Playwright]

on:
push:
paths:
- .github/workflows/test_integration_playwright.yml
workflow_run:
workflows: ["Build and deploy GovTool to TEST server"]
types: [completed]

jobs:
integration-tests:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' }}
defaults:
run:
working-directory: tests/govtool-frontend/playwright
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: "./tests/govtool-frontend/playwright/package-lock.json"

- name: Install dependencies
run: npm ci

- name: Cache Playwright browsers
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-browsers

- name: Install Playwright browsers if not cached
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

- name: Run tests
run: |
npm test
- name: Upload report
uses: actions/upload-artifact@v3
if: always()
with:
name: allure-results
path: tests/govtool-frontend/playwright/allure-results

env:
FRONTEND_URL: ${{vars.FRONTEND_URL}}
API_URL: ${{vars.API_URL}}
DOCS_URL: ${{ vars.DOCS_URL }}
FAUCET_API_URL: ${{ vars.FAUCET_API_URL }}
FAUCET_API_KEY: ${{secrets.FAUCET_API_KEY}}
KUBER_API_URL: ${{vars.KUBER_API_URL}}
KUBER_API_KEY: ${{secrets.KUBER_API_KEY}}
WORKERS: ${{vars.WORKERS}}

publish-report:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' }}
needs: integration-tests
steps:
- uses: actions/checkout@v4
- name: Download report
uses: actions/download-artifact@v3
with:
name: allure-results
path: allure-results

- name: Get Allure history
uses: actions/checkout@v4
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
repository: ${{vars.GH_PAGES}}
token: ${{ secrets.PERSONAL_TOKEN }}

- name: Register report
id: register-project
if: ${{success()}}
run: |
chmod +x ./register_report.sh
./register_report.sh
- if: steps.register-project.outputs.project_exists != 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
repository-name: ${{vars.GH_PAGES}}
branch: gh-pages
folder: project

- name: Generate report details
id: report-details
run: |
chmod +x ./generate_report_details.sh
./generate_report_details.sh
- name: Build report
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages/${{env.REPORT_NAME}}
allure_report: allure-report
allure_history: allure-history
keep_reports: 2000
report_url: ${{steps.report-details.outputs.report_url}}
github_run_num: ${{steps.report-details.outputs.report_number}}

- name: Generate Latest Report
run: |
chmod +x ./generate_latest_report_redirect.sh
./generate_latest_report_redirect.sh ${{steps.report-details.outputs.report_number}}
- name: Deploy report to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PERSONAL_TOKEN }}
repository-name: ${{vars.GH_PAGES}}
branch: gh-pages
folder: build
target-folder: ${{ env.REPORT_NAME }}

env:
REPORT_NAME: integration
GH_PAGES: ${{vars.GH_PAGES}}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ infra/terraform/.terraform*
scripts/govtool/dev-postgres_db
scripts/govtool/dev-postgres_user
scripts/govtool/dev-postgres_password

# nodejs/yarn

node_modules
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ changes.

## [Unreleased]

- Inicialize Usersnap into App [Issue 546](https://github.com/IntersectMBO/govtool/issues/546)
- Integrate frontend with metadata validation service [Issue 617](https://github.com/IntersectMBO/govtool/issues/617)
- Implement a loading modal for the validation of the metadata [Issue 646](https://github.com/IntersectMBO/govtool/issues/646)
- Fix displaying modals to not block signing transactions [Issue 710](https://github.com/IntersectMBO/govtool/issues/710)
- Change style of url button to trim the file name [Issue 655](https://github.com/IntersectMBO/govtool/issues/655)
- Change regex for parsing urls to match urls without protocol [Issue 655](https://github.com/IntersectMBO/govtool/issues/655)
- Integrate ga displaying metadata validation with the validation service [Issue 712](https://github.com/IntersectMBO/govtool/issues/712)
- Correct text of the governance action type [Issue 651](https://github.com/IntersectMBO/govtool/issues/651)
- Enable coverage tests report

### Added

- added search query param to the `drep/getVotes` [Issue 640](https://github.com/IntersectMBO/govtool/issues/640)
- added filtering and sorting capabilities to the `drep/list` [Issue 722](https://github.com/IntersectMBO/govtool/issues/722)
- added drepView and txHash to the `ada-holder/get-current-delegation` [Issue 689](https://github.com/IntersectMBO/govtool/issues/689)
- addded latestTxHash to the `drep/info` and `drep/list` endpoints [Issue 627](https://github.com/IntersectMBO/govtool/issues/627)
- added `txHash` to `drep/getVotes` [Issue 626](https://github.com/IntersectMBO/govtool/issues/626)
- added `references` to all proposal related endpoints
Expand Down Expand Up @@ -48,6 +58,7 @@ changes.

### Fixed

- drep/info no longer returns null values [Issue 720](https://github.com/IntersectMBO/govtool/issues/720)
- drep/getVotes no longer returns 500 [Issue 685](https://github.com/IntersectMBO/govtool/issues/685)
- drep/info no longer returns 500 [Issue 676](https://github.com/IntersectMBO/govtool/issues/676)
- proposal/list search is case insensitive now [Issue 582](https://github.com/IntersectMBO/govtool/issues/582)
Expand All @@ -72,6 +83,7 @@ changes.

### Changed

- `drep/info` now returns 4 different tx hashes instead of one latest tx hash [Issue 688](https://github.com/IntersectMBO/govtool/issues/688)
- `proposal/list` allows user to search by tx hash [Issue 603](https://github.com/IntersectMBO/govtool/issues/603)
- `proposal/list` returns additional data such ass `expiryEpochNo`, `createdEpochNo`, `title`, `about`, `motivation`,
`rationale`. `TreasuryWithdrawals` GAs also got nicely formated details. [Issue 372](https://github.com/IntersectMBO/govtool/issues/372)
Expand All @@ -96,6 +108,7 @@ changes.
- Extend the eslint config to apply to the style guide of the project [Issue 514](https://github.com/IntersectMBO/govtool/issues/514)
- Update frontend package readme to reflect recent changes [Issue 543](https://github.com/IntersectMBO/govtool/issues/543)
- Change input selection strategy to 3 (random) [Issue 575](https://github.com/IntersectMBO/govtool/issues/575)
- Changed documents to prepare for open source [Issue 737](https://github.com/IntersectMBO/govtool/issues/737)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[XXXX@intersectmbo.org](XXXX@intersectmbo.org).
[oso@intersectmbo.org](oso@intersectmbo.org).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Contributing to the `GovTool` project

⚠️ 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

Thanks for considering contributing and helping us on creating GovTool! 😎

The best way to contribute right now is to try things out and provide feedback, but we also accept contributions to the documentation and the obviously to the code itself.
Expand Down
Loading

0 comments on commit a210181

Please sign in to comment.