Route Updates
If you have route updates that need to be made for one of your services, you can either have them completed as part of a deployment or separately. Route updates are submitted as a pull request to the HAPS platform team to complete.
Separate Route Update
-
From a ticket for that service in the Jira project space, use the "PO: <Project> Route Update (non-release)" automation. This will create the RM ticket for you with the route template. Fill in the basic information that you need.
-
In the MACM project in code repo, create a branch named as the RM ticket name (example:
DHAPI-1117/dhapi_portal_staff_route) within the correct repo depending on what kind of route update you need (see Choosing the Repository). Create the branch fromsqafor SQA or fromprodfor production. -
Make the changes (see Making the Change). DO NOT CREATE A PULL REQUEST.
-
Share the RM ticket with the RM. They will review the ticket, create the appropriate ticket for the HAPS team, create the PR that is linked to that new ticket for the HAPS team and submit it.
-
The PR will show up on both the RM ticket and the ticket for the HAPS team.
-
-
Once the ticket is merged and completed, it will be closed out and the RM will close out the linked RM ticket.
Route Update with a Deployment
-
From a ticket for that service in the Jira project space, use the "PO: <Project> Deploy Task (templated)" automation. This will create the RM deploy ticket for you. At the top of the ticket, there is a space asking if a route update is needed. Type
Yand fill in the basic information that you need. -
In the MACM project in code repo, create a branch named as the RM ticket name (example:
DHAPI-1117/dhapi_portal_staff_route) within the correct repo depending on what kind of route update you need (see Choosing the Repository). Create the branch fromsqafor SQA or fromprodfor production. -
Make the changes (see Making the Change). DO NOT CREATE A PULL REQUEST.
-
Share the RM ticket with the RM. They will review the ticket and create the appropriate ticket for the HAPS team. As part of preparing the deployment ticket, they will create the PR and link it to the route subtask ticket for the HAPS team. They will submit the deployment ticket.
-
The PR will show up on both the RM ticket and the route subtask ticket for the HAPS team.
-
-
Once the deployment is completed, which includes the route change being merged and completed, it will be closed out and the RM will close out the linked RM ticket.
Choosing the Repository
Routes live in the MACM project as JSON files, which Terraform loads into Consul. There is one repo per route type and environment, and the repo you change (not the contents of the file) decides which gateway serves the route.
| Route type | SQA (branch from sqa) |
Production (branch from prod) |
|---|---|---|
Staff route |
||
API gateway route |
-
A service that has to be available on both gateways needs a route file in both repos for that environment. For example,
dhapi-partner-portal-webgot its API gateway route in DHAPI-1078 and its staff route in DHAPI-1117. -
Not sure which gateway your service uses? Check whether the server URLs in its OpenAPI contract use a
staff.appsor aveteran.appshost, or search the repos above for its existing route file.
|
The staging repos also have long-lived branches for other staging
namespaces ( The other |
Making the Change
Each route is a JSON file in the repo’s 3.0/services/ folder, usually
named after the service and its major version (for example
3.0/services/dhapi-partner-portal-web-v1.json).
-
To change an existing route, edit the service’s existing file.
-
To add a route, copy the file of a similar service and adjust it. Each file has one
location, so a service with more than one path has more than one file (for exampleurl-shortener-service-v1.jsonandurl-shortener-service-v1-go.json).
This is the file that DHAPI-1117 added to
vaec-map-routes-staging-tf-staff:
{
"location": "/dhapi-portal/",
"service": "dhapi-partner-portal-web-v1.sqa",
"redirect": "off",
"request_headers": "on",
"headers": {
"X-Real-IP": "$remote_addr",
"X-Forwarded-For": "$proxy_add_x_forwarded_for",
"X-Forwarded-Server": "$http_host",
"X-Forwarded-Host": "$http_host"
}
}
| Field | What it does |
|---|---|
|
The URL path on the gateway. Here, |
|
The Kubernetes service that receives the traffic, written as
|
|
Headers passed to the service. These differ between services, so copy them from a similar route. |
Other fields |
Settings such as |
The RM and the HAPS team review the change before it is merged.
Worked Example: DHAPI-1117
dhapi-partner-portal-web already had an API gateway route in SQA from
DHAPI-1078 and needed a staff route as well.
-
The PO answered the SQA configuration questions at the top of DHAPI-1117:
Are Vault changes needed? N Are Route changes needed? Y Are any infrastructure changes necessary (Database creation/changes, ApiGateway route changes)? N
Answer
Yto the route question for a change in either route repo. DHAPI-1078, which added the API gateway route file, also answeredNto the infrastructure question. -
Because it was a staff route in SQA, the branch
DHAPI-1117/dhapi_portal_staff_routewas created fromsqainvaec-map-routes-staging-tf-staff. -
The only change was the new
3.0/services/dhapi-partner-portal-web-v1.jsonfile shown in Making the Change. The PO did not open a pull request. -
The RM created the HAPS ticket NGD-34017 (SQA: dhapi-partner-portal-web route update) and opened PR #730 (NGD-34017: Add DHAPI Portal route) from that branch into
sqa. -
The HAPS team approved the PR and it was merged. NGD-34017 was closed, and then the RM closed DHAPI-1117.