release-registry

module
v0.0.0-...-e0271d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: Apache-2.0

README

Release Registry

A mechanism to mark, identify and search release artifacts using Quality Milestones.

Documentation

Bootstrapping

  1. Update example/config.yaml to reflect your environment. All options can be found in the configuration package.
  2. Generate localhost certificates for the gRPC gateway: make server-renew-cert. They will be placed in the example directory.
Authentication

Follow the guide in the infra-auth-lib to create your OIDC configuration file.

Reference the path to this configuration file in the main configuration file under tenant.oidcConfigFile.

Local Docker run

After finishing the previous bootstrapping steps, run:

docker run -p 8443:8443 -v $(pwd)/example:/example quay.io/rhacs-eng/release-registry:$(make tag)

If the image does not exist, run make server-image first. Choose a free port on your system, if 8443 is already used. Use different paths to mount if your configuration files specify so - the command above works with the example configuration files and bootstrapping commands as specified.

Helm

If you want to deploy to GKE, create a new global IP:

gcloud compute addresses create --project <PROJECT> <NAME OF ADDRESS> --global --ip-version IPV4

The name of the address should be recorded in .Values.reservedAddressName.

Developing

Tests are available in the tests directory and the Go packages. They contain unit, integration and end-to-end tests.

  • Unit tests assert function output on individual package level.
  • Integration tests test interplay between components with mocked dependencies.
  • End-to-end tests emulate user behaviour and test the external interfaces of the service.
Requirements

For the end-to-end tests, must obtain a test token or create your own for the robot user roxbot+release-registry-e2e@redhat.com. This token must be available in the environment variable RELREG_TEST_TOKEN when running end-to-end-tests.

The example assumes you run a local server with self-signed certificates. If running against dev or production infrastructure, remove the --insecure flag and change the location.

curl --insecure --location 'https://localhost:8443/v1/token-create' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <ENTER PASSWORD FROM CONFIG tenant.password HERE>' \
--data-raw '{
    "Name": "release-registry-e2e-gha",
    "Description": "CI token used for E2E tests on release-registry (GHA)",
    "Email": "roxbot+release-registry-e2e@redhat.com"
}'

Directories

Path Synopsis
cmd
gen
go/proto/api/v1
Package v1 is a reverse proxy.
Package v1 is a reverse proxy.
pkg
configuration
Package configuration provides global configuration through files, environment variables and command flags
Package configuration provides global configuration through files, environment variables and command flags
logging
Package logging provides wrappers around zap logging.
Package logging provides wrappers around zap logging.
service
Package service contains only a stub function.
Package service contains only a stub function.
service/healthz
Package healthz contains handlers for readiness and liveness checks.
Package healthz contains handlers for readiness and liveness checks.
service/qualitymilestonedefinition
Package qualitymilestonedefinition contains the server to manage QualityMilestoneDefinitions.
Package qualitymilestonedefinition contains the server to manage QualityMilestoneDefinitions.
service/release
Package release contains the server to manage Releases.
Package release contains the server to manage Releases.
storage
Package storage contains database and ORM layers.
Package storage contains database and ORM layers.
storage/models
Package models contains the ORM layer
Package models contains the ORM layer
utils/conversions
Package conversions converts business objects from storage to service representation and back.
Package conversions converts business objects from storage to service representation and back.
utils/validate
Package validate contains utility functions for input validation.
Package validate contains utility functions for input validation.
utils/version
Package version provides support for semantic versions.
Package version provides support for semantic versions.
tests
e2e/utils
Package utils contains end-to-end utils.
Package utils contains end-to-end utils.
integration
Package integration contains integration tests and utils.
Package integration contains integration tests and utils.
utils
Package utils contains shared test helpers.
Package utils contains shared test helpers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL