The Platform Console API: for creating and deploying applications on the VA Platform.
The intention of this project is to work out integrations with underlying VA services (e.g. K8s, SSM, AWS) which will provide API services for the Platform Console UI and Platform Console CLI. UI work contained within this project is only to aid in defining API features.
From the root of the repository, run:
brew install postgres
brew services start postgresql
bin/setup
bin/dev
This will:
- Install and run Postgres.
- Install the necessary gems, create the pg database, and seed the database.
- Start the Rails server and Tailwind watcher.
This has been tested on macOS Monterey using Ruby 3.1 and PG 14.1.
This repository uses semantic releases triggered via Github Actions. When committing to the master branch, a semantic release will be triggered via Github Actions, but the commit message must follow the syntax in the semantic release documentation.
1. feat: add my feature
2. fix: fix the bug
3. BREAKING CHANGE: fix the breaking change
4. perf: remove some change
All schema migrations are run automatically upon a successful semantic release and deploy. The initContainers configuration in the platform-console-api k8s deployment spec will start and execute migrations before the other containers in the pod start.
All data migrations will need to be run via a manual process.
To run all tests, run:
rails test:all
If you'd like a coverage report generated, preface the command with COVERAGE=true
.
To run a single test, run:
rails test test/path/to/the_test.rb:123
With respect to semantic release syntax, each commit to master is automatically built and the image is pushed to ECR. The image tag is then updated in the manifests repo in the deployment.yml
Instructions for running and initializing Keycloak locally: To setup keycloak, run:
bin/keycloak
This will create a keycloak database, docker image, and a docker container (Keycloak). You can access keycloak at http://localhost:8080
ADMIN Credentials (Create Realms):
username: admin
password: password
Keycloak SSO credentials:
username: [email protected]
password: password
See the Argo Integration docs in Confluence
The Rswag gem is used to automatically generate documentation for the platform console API endpoints. Documentation can be viewed in an embedded version of swagger-ui by running rails server
and then visiting the /api-docs/index.html
path.
If the API has changed and the documentation needs to be updated, rswag can generate an updated Swagger file using the following command:
SWAGGER_DRY_RUN=0 RAILS_ENV=test rails rswag
This will create an updated Swagger JSON file using the request specs in the spec/requests/api/v1
folder.