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 to Stage updates #255

Merged
merged 118 commits into from
Feb 23, 2024
Merged

Test to Stage updates #255

merged 118 commits into from
Feb 23, 2024

Conversation

pmbinapps
Copy link

List of changes from test branch

Refactor input to follow atomic design approach
#109

[Duplicate Test-Ids] Same test-ids are used in multiple elements
#28

Rebrand VVA to govtool in infrastructure configuration
#97

Fix configuration issue for SanchoNet Cardano DB Sync in Docker environment
#181

Multiple instances of the wallet opening
#75

Implementing i18next
#80

Fix misleading metadata hash text
#90

Chore: bump frontend to use CSL 12 alpha 16
#156

Add optional filter to proposal/list endpoint
#92

Strange Governance Actions Appear
#73

Enhance deployment script for conditional generation of BasicAuth configuration files
#171

Update Changelog to reflect recent changes in infrastructure configuration
#203

Create new atom checkbox component
#113

Use your voting power - Signal no confidence, Abstain: blank screen after click Next step
#236 - Issues that is not occuring any more.

Integrate OAuth Token for Secure Deployment Notifications on Slack
#194

Refine backend Nix configuration
#187

Implement simple Cardano Node with DBSync stack on SanchoNet with Docker Compose for developers purposes
#225

Fix Maintenance Page Copy
#180

jankun4 and others added 30 commits February 5, 2024 00:49
Accept optional DRepHash. When provided, filter out governance actions on which the given DRep has already voted on.
…o fix/75-multiple-instances-of-the-wallet-opening
Co-authored-by: Ryan Williams <44342099+Ryun1@users.noreply.github.com>
Signed-off-by: Igor Velickovic <igor.velickovic@gmail.com>
This commit updates the README.md file to align with the new backend/frontend
naming convention for the SanchoNet GovTool project, as part of the ongoing
effort detailed in ticket #85. Previously, the documentation links used the old
'vva-be' and 'vva-fe' naming, which is now replaced with 'backend' and 'frontend'
respectively. This change ensures consistency across our project documentation,
following the updates made by @adgud.
This commit involves updating the README.md files for both the backend and
frontend components of the GovTool project. These changes are part of the
ongoing efforts for ticket #85, ensuring that all references to the old 'vva-be'
and 'vva-fe' codenames are replaced with the new 'backend' and 'frontend'
naming convention. This is a continuation of the work done by @adgud, aiming to
maintain consistency across the project's documentation and directory structure.
This commit updates the DEPLOY.md documentation in the docs/operations folder,
as part of the work outlined in ticket #85. The purpose of these changes is to
ensure that our deployment documentation reflects the new naming convention.

Technical Details:
- Updated the reference in the AWS setup instructions, changing the directory path
  from `./src/terraform` to `./infra/terraform`.
  This reflects the new directory structure under the 'infra' directory.
In this commit, we're updating the docker-compose.yml file within the
scripts/govtool directory. This is in line with the ongoing efforts for
ticket #85, focusing on aligning all parts of our project with the new
backend/frontend naming convention. This update changes the build contexts
for both the backend and frontend services in the Docker Compose configuration,
replacing the outdated paths with the new ones that reflect our current project
structure. This is an important step to ensure consistency across all our
development and deployment tools.

Technical Details:
- The build context for the 'vva-be' service in docker-compose.yml was updated
  from `vva-be` to `../../govtool/backend`.
- Similarly, the build context for the 'vva-fe' service was changed from `vva-fe`
  to `../../govtool/frontend`.
This commit involves renaming various configuration files related to the backend
service of the GovTool project. The change is part of the ongoing work for
ticket #85, where we're aligning all aspects of the project with the new
backend/frontend naming convention. This update specifically targets the
configuration files, changing the 'vva-be' references to 'backend'.

Technical Details:
- Renamed the configuration file from `.github/vva-be-config.json` to
  `.github/backend-config.json`.
- Updated the configuration file paths in the scripts/govtool directory, changing
  from `scripts/govtool/config/secrets/vva-be-config.json` and
  `scripts/govtool/config/secrets/vva-be-config.json.tpl` to
  `scripts/govtool/config/secrets/backend-config.json` and
  `scripts/govtool/config/secrets/backend-config.json.tpl` respectively.
- In both the `docker-compose.yml` and `docker-compose.sanchonet.yml` files,
  updated the command and secrets sections to use the new `backend-config.json`
  file. This ensures that the Docker containers for the backend service use the
  correct configuration file when deployed.
- Updated the `prepare-config.sh` script to replace the old template path with
  the new `backend-config.json.tpl`, ensuring the script correctly generates the
  required configuration files for deployment and development environments.
This commit focuses on renaming container services in various Docker Compose
and Grafana configuration files as part of the efforts detailed in ticket #85.
The goal is to align all service names with the new backend/frontend naming
convention.

Technical Details:
- In the Grafana provisioning alerting configuration (alerting.yml), updated
  the Prometheus expression to use `backend@docker` instead of `vva-be@docker`.
  This change is crucial for accurate monitoring and alerting based on the
  new service names.
- Updated the Grafana dashboard configuration (vva.json), changing the Prometheus
  expression to reference `frontend@docker` instead of `vva-fe@docker`. This ensures
  that the dashboard accurately reflects the traffic and metrics for the frontend
  service.
- In both the `docker-compose.sanchonet.yml` and `docker-compose.yml` files,
  renamed the services from `vva-be` to `backend` and from `vva-fe` to `frontend`.
  This update affects how these services are referenced and managed within our
  Docker Compose environments, aligning them with the new project naming standards.
…rvices

This commit revises the Traefik configuration labels within our Docker Compose
files (docker-compose.yml and docker-compose.sanchonet.yml), as part of the
work specified in ticket #85. The aim is to replace the old 'vva-be' and 'vva-fe'
labels with 'backend' and 'frontend', in line with the new naming convention
adopted across the project.

Technical Details:
- In the `docker-compose.sanchonet.yml` file, updated all Traefik labels for
  the backend service, replacing 'vva-be' with 'backend'. This includes updates
  to router rules, middlewares, and service definitions.
- Similarly, updated the frontend service labels in the same file, changing
  'vva-fe' to 'frontend'. This change affects router rules and service
  definitions, ensuring the frontend service is correctly identified and
  routed by Traefik.
- Made analogous updates in the `docker-compose.yml` file, ensuring that local
  development environments also reflect these changes. This includes updating
  the Traefik labels for both the backend and frontend services to use the new
  service names.
This commit updates the volume mappings for the FakeDB database schema in the
docker-compose.yml file, as a part of the work detailed in ticket #85. The
modification is necessary to reflect the new backend/frontend naming convention
and directory structure in the GovTool project. Specifically, this change
ensures that the database initialization scripts for the FakeDB service are
correctly sourced from the updated locations within the project.

Technical Details:
- Changed the volume mappings for the FakeDB service within the
  docker-compose.yml file. The paths for the database initialization scripts
  'fakedbsync_users.sql' and 'schema6.sql' have been updated from
  `./vva-be/misc/...` to `../../govtool/backend/misc/...`.
- This update ensures that when the FakeDB service is started, it correctly
  locates and executes the initialization scripts stored in the new backend
  directory, maintaining the integrity and functionality of the development
  environment.
…docker compose

This commit changes the local domain names for the backend and frontend services
in the docker-compose.yml file, as part of the initiative in ticket #85. The
modification is aimed at aligning the local development environment with the
new backend/frontend naming convention. By updating the domain names, we ensure
that the local URLs used for accessing these services reflect the updated
project structure and naming standards.

Technical Details:
- Updated the Traefik router rule for the backend service. The local domain
  name is changed from `vva-be.localhost` to `backend-govtool.localhost`. This
  alteration is specified in the label `traefik.http.routers.backend.rule`.
- For the frontend service, updated the Traefik router rule to change its
  local domain from `vva-fe.localhost` to `frontend-govtool.localhost`. This
  change is reflected in the label `traefik.http.routers.frontend.rule`.
This commit updates the Makefile within the scripts/govtool directory to
reflect the new project naming conventions as outlined in ticket #85. The
change involves renaming the Docker Compose project from the old 'vva' prefix
to 'govtool'. This renaming is crucial to maintain consistency throughout
the project's infrastructure and deployment scripts, aligning them with
the updated naming standards.

Technical Details:
- Modified the Docker Compose commands in the Makefile. Changed the project
  name prefix in the `-p` (project name) option from `vva-$(env)-$(cardano_network)`
  to `govtool-$(env)-$(cardano_network)`. This affects both the `deploy-stack`
  and `toggle-maintenance` targets in the Makefile.
- These changes ensure that when deploying or managing the Docker Compose
  stacks, the correct, updated project name is used, which is vital for
  proper identification and management of the containers in different
  environments.
This commit focuses on updating the database name for the FakeDB service from 'vva' to 'govtool'. This change is made across various configuration files and workflows as part of the efforts described in ticket #85. The update is essential to ensure that the database name aligns with the new backend/frontend naming convention and provides consistency across the project's development, testing, and deployment environments.

Technical Details:
- Updated the `backend-config.json` file in the `.github` directory and the `scripts/govtool/config/secrets` directory. Changed the 'dbname' field from 'vva' to 'govtool' in the 'fakedbsyncconfig' object.
- Modified the `.github/workflows/build-and-deploy.yml` file, updating the `FAKEDBSYNC_POSTGRES_DB` environment variable from 'vva' to 'govtool'. This change ensures that the GitHub Actions workflows utilize the correct database name during build and deployment processes.
- Changed the `FAKEDBSYNC_POSTGRES_DB` variable in the `.env.example` file in the `scripts/govtool` directory, ensuring that local development environments are correctly configured to use the new database name.
- In the `docker-compose.yml` file within the `scripts/govtool` directory, updated the `POSTGRES_DB` environment variable for the postgres service from 'vva' to 'govtool'. This ensures that the correct database is created and used when running the Docker Compose setup.
This commit updates the README.md file in the govtool/backend directory, adding a crucial note regarding the potential renaming of the backend executable. As part of the ongoing efforts outlined in ticket #85, this note is essential to prepare for the upcoming changes that align with the project's rebranding and development strategies.

This note informs readers and developers that the executable previously known as 'vva-be' is anticipated to be officially renamed to 'govtool-backend'.  The change is in line with the project's updated branding and functional scope. It is planned to be implemented soon as part of a planned refactor
This commit introduces a new functionality in the GovTool deployment Makefile to establish an SSH connection to a target environment. This feature is particularly useful in the context of the ongoing efforts to improve infrastructure configuration and management. The addition of this SSH helper simplifies the process of connecting to various environments, aligning with the goal of enhancing operational efficiency and ease of access for maintenance and deployment tasks.

The technical implementation involves adding a new `ssh` target in the Makefile. This target ensures that necessary environment variables such as `cardano_network` and `env` are defined before initiating the SSH connection. The implementation sets the terminal type to `xterm-256color` to avoid issues with different terminal settings and then executes the SSH command using the `ssh_url` variable.
This commit renames the Grafana dashboard configuration file from 'vva.json' to
'govtool.json' in the scripts/govtool/config/grafana-provisioning/dashboards
directory. This change is a continuation of the effort detailed in ticket #111,
as an extension of the issue #85, where we are updating various components
of the project to align with the new naming convention.

Technical Details:
- Renamed the Grafana dashboard configuration file from
  `scripts/govtool/config/grafana-provisioning/dashboards/vva.json` to
  `scripts/govtool/config/grafana-provisioning/dashboards/govtool.json`.
- Also updated the 'id' property of the dashboard within the file from 2 to 3.
  This change is a routine update to maintain the uniqueness and
  integrity of the dashboard's identification within the Grafana system.
This commit updates the Traefik Let's Encrypt (LE) admin email address in the
`.github/workflows/build-and-deploy.yml` file. The change is a part of the
ongoing rebranding efforts detailed in epic ticket #111, where 'vva' is being
replaced with 'govtool'. The updated email address, `admin+govtool@binarapps.com`,
reflects this rebranding, ensuring that the administrative contact for Traefik LE
certificates is consistent with the new project name.

Technical Details:
- Modified the `TRAEFIK_LE_EMAIL` environment variable in the GitHub Actions
  workflow file. Changed from `admin+vva@binarapps.com` to
  `admin+govtool@binarapps.com`. This change was made in two places within the
  file to ensure consistency across different job configurations.
This commit updates Prometheus configuration in prepare-config.sh as part
of the ongoing efforts in rebranding epic #111.
The change is a part of the broader initiative to update all project components
to the new 'govtool' naming, ensuring consistency and clarity as the project
moves towards open-source community involvement.

Technical details:
- In the `scripts/govtool/prepare-config.sh` script, the external label for Prometheus
  monitoring has been updated from 'vva' to 'govtool'. This change ensures that
  metrics scraped by Prometheus are correctly associated with the GovTool project,
  reflecting the new project name and aiding in consistent monitoring and analytics.
.
@pmbinapps pmbinapps changed the title Test Test to Stage updates Feb 22, 2024
Copy link
Contributor

@MSzalowski MSzalowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait with merge for the tickets review

@MSzalowski MSzalowski self-requested a review February 22, 2024 09:15
Copy link
Contributor

@MSzalowski MSzalowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tickets needs to be reviewed.

@MSzalowski
Copy link
Contributor

@MSzalowski MSzalowski self-requested a review February 22, 2024 13:14
@MSzalowski
Copy link
Contributor

Doesn't resolve the governance actions issue - fixed here.
Discussed here.
And internally with @Ryun1 and @jankun4

Sworzen1 and others added 17 commits February 23, 2024 09:03
Introduces a new Dockerfile.base within the govtool/backend directory,
aimed at creating a base image for the Haskell backend project. This
base image includes all necessary pre-compiled dependencies, following
the initiative to expedite the build process for deployment.

The Dockerfile is based on the `haskell:9.2-buster` image and sets up an
environment optimized for the GovTool project by pre-installing all
dependencies. By removing the source code after dependency installation,
we ensure that the image only contains what's necessary for future
builds, thus aligning with our goal to reduce build and deployment times
significantly.

This change addresses part of the acceptance criteria for speeding up
the deployment process by preparing and maintaining a base image with
all pre-compiled dependencies required by the application.
This commit introduces a new Terraform module instantiation for creating
an AWS ECR repository dedicated to the backend base Docker image. The
repository, named `backend-base`, is aimed at storing pre-compiled
dependencies for the backend, in line with the project's goal to speed
up build and deployment times.

Changes to `infra/terraform/main.tf` include the addition of the
`govtool-ecr-backend-base` module, specifying the `backend-base` as the
repository name. This ensures a separate and organized repository for
the base image, facilitating better management and access control.

Furthermore, the AWS IAM policy `cicd_ecr` is updated to include
permissions for the new `backend-base` repository. This adjustment
allows CI/CD pipelines to push and pull images, ensuring seamless
integration with existing workflows.

The outputs are also expanded to include the URL of the newly created
`backend-base` ECR repository, enhancing accessibility for deployment
scripts and CI/CD pipelines.

This setup supports the acceptance criteria by establishing the
necessary infrastructure to store and manage the base image, ultimately
contributing to reduced deployment times.
This commit updates the Dockerfile for the GovTool backend to utilize
the newly created base image, which contains all necessary pre-compiled
Haskell dependencies. By changing the base image from
`haskell:9.2-buster` to the custom `backend-base` image hosted on AWS
ECR, the build process for the backend Docker image is significantly
optimized.

The key changes include:
- Modifying the FROM directive to point to the `backend-base` image,
  ensuring that the environment is pre-setup with all the dependencies
  required for the backend build.
- Simplifying the build command to `cabal build` since `cabal update`,
  `cabal configure`, and dependency installations are no longer
  necessary, being already handled in the base image creation process.

This adjustment ensures that the backend Dockerfile leverages the
pre-compiled dependencies in the base image, directly contributing to a
faster build and deployment process. This change aligns with the
project's acceptance criteria by ensuring that only the
application-specific code is compiled during the build process,
leveraging the efficiencies offered by the base image.
Updates the `scripts/govtool/Makefile` to require Docker login
(`docker-login` target) before executing push operations for backend and
frontend images, as well as before deploying the stack. This change
ensures that users are authenticated with Docker, specifically with the
AWS ECR, before attempting to push or pull images. This modification is
critical for maintaining security and access control, particularly for
actions involving sensitive operations such as pushing images to a
repository.

By integrating the `docker-login` prerequisite to the `push-backend`,
`push-frontend`, and `deploy-stack` targets, we enforce a workflow that
aligns with best practices for Docker image management and deployment.
This approach safeguards against unauthorized access and ensures that
the CI/CD pipeline operates smoothly with authenticated sessions.

This change directly supports the project's operational security and
efficiency, particularly in the context of speeding up the deployment
process by leveraging pre-compiled Docker images.
This commit refines the `scripts/govtool/Makefile` to ensure all Docker
commands utilize the predefined `docker` variable instead of hardcoded
`docker` command references. This change enhances the flexibility and
configurability of the build scripts, allowing for seamless integration
with environments where Docker commands might need to be wrapped or
aliased (e.g., for logging, security, or versioning purposes).

By replacing direct `docker` and `docker compose` command calls with the
`$(docker)` variable, we standardize command execution and increase the
scripts' adaptability to different CI/CD environments. This adjustment
is particularly relevant for operations like deploying the stack,
destroying specific containers and volumes, and toggling maintenance
mode, ensuring that all Docker interactions are executed through a
single, configurable point of reference.

This update supports the broader goal of improving the project's build
and deployment process efficiency, aligning with best practices for
script maintenance and execution flexibility.
This commit enhances the `scripts/govtool/Makefile` by introducing new targets `build-backend-base` and `push-backend-base`. These additions facilitate the process of building and pushing the base Docker image for the backend, which contains all necessary pre-compiled dependencies to expedite subsequent builds.

- The `build-backend-base` target is responsible for building the base image using the `Dockerfile.base` located in the `govtool/backend` directory. It tags the image with the commit hash, providing a clear linkage between the image and the source code state from which it was built.
- The `push-backend-base` target, dependent on a successful Docker login (`docker-login`), pushes the newly built base image to the configured repository. This ensures that the image is available for use by the CI/CD pipelines and developers for building the actual backend application image.

These targets are crucial for implementing the strategy to speed up the backend build and deployment process by leveraging a Docker image with pre-compiled dependencies. This approach aligns with the acceptance criteria set forth for the project, aiming at reducing build and deployment times through efficient dependency management.
This commit introduces a significant enhancement to the Docker build
process for the backend by making the base image versioning dependent on
the `vva-be.cabal` file. This change ensures that the base Docker image
is closely tied to the project's Haskell dependencies, as specified in
the cabal file.

- In `govtool/backend/Dockerfile`, an `ARG BASE_IMAGE_TAG` is
  introduced, allowing for dynamic specification of the base image tag
  during the build process. This facilitates using different versions of
  the base image as dependencies evolve.
- The `scripts/govtool/Makefile` is updated to calculate the
  `base_backend_image_tag` by hashing the `vva-be.cabal` file. This hash
  becomes the tag for the base image, ensuring that any changes in the
  cabal file result in a new base image version. This mechanism automates
  the versioning process, ensuring that the backend is always built
  against the correct set of pre-compiled dependencies.

By linking the base image version directly to the cabal file's hash,
this approach guarantees that any changes in dependencies are
automatically accounted for, thereby streamlining the build process and
enhancing consistency across builds.
This commit optimizes the build process for the backend base Docker
image in the `scripts/govtool/Makefile`. It introduces conditional logic
to build or push the base image only if it doesn't already exist in the
repository, significantly reducing unnecessary builds and pushes,
thereby saving time and resources.

Key changes include:
- The `build-backend` target now depends on `build-backend-base`,
  ensuring the base image is available before building the backend
  image. However, the base image will only be built if it is not already
  present, as checked by `docker manifest inspect`.
- Similarly, `push-backend-base` incorporates a condition to push the
  base image only if it is not already available in the repository,
  using `docker manifest inspect` to verify its existence.

This logic prevents redundant builds and uploads of the base image when
no changes have occurred to the `vva-be.cabal` file, making the CI/CD
pipeline more efficient. By building the base image only when necessary,
we align with best practices for Docker image management and optimize
our deployment workflow.
This commit updates the domain references within the
docker-compose.test.yml for the test environment. Changes include
updating the GF_SERVER_ROOT_URL and the traefik routing rules to point
to the new test domain test-sanchonet.govtool.byron.network from the
previous test.govtool.byron.network. These modifications ensure that the
services such as Grafana, status-service, backend, and frontend are
correctly accessible through the updated domain, aligning with
infrastructure changes or domain migration needs. This update is crucial
for maintaining seamless access and functionality of the test
environment's services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants