Skip to content

Commit b1f014f

Browse files
authored
Insights: support /preview/ as well as /beta/ (#3343)
* Insights: switch /beta/ to /preview/ No-Issue * appUrl, deployment - app url to array, deployment back to beta /preview/ only affects frontend routing, assets stay at /beta/ * update README, keep beta too
1 parent b1eb382 commit b1f014f

8 files changed

+18
-11
lines changed

.github/workflows/cypress.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
run: |
211211
echo waiting for containers to start
212212
sleep 30
213-
curl http://localhost:8002/beta/ansible/automation-hub/ | tee /dev/stderr | grep '/beta/apps/chrome/js/'
213+
curl http://localhost:8002/preview/ansible/automation-hub/ | tee /dev/stderr | grep '/beta/apps/chrome/js/'
214214
sleep 30
215215
216216
- name: "Ensure galaxykit can connect to API (standalone)"

.github/workflows/cypress/cypress.env.json.insights

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"apiPrefix": "/api/automation-hub/",
33
"pulpPrefix": "/api/automation-hub/pulp/api/v3/",
4-
"uiPrefix": "/beta/ansible/automation-hub/",
4+
"uiPrefix": "/preview/ansible/automation-hub/",
55
"username": "admin",
66
"password": "admin",
77
"galaxykit": "galaxykit --ignore-certs --auth-url 'http://localhost:8002/auth/realms/redhat-external/protocol/openid-connect/token'",

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The app will run on http://localhost:8002/ui and proxy requests for `/api` to th
3939
1. Start the API with `COMPOSE_PROFILE=insights` (compose) or `COMPOSE_PROFILE=galaxy_ng/base:galaxy_ng/insights` (oci-env)
4040
2. `npm run start-insights`
4141

42-
The app will run on http://localhost:8002/beta/ansible/automation-hub and proxy requests for `/api/automation-hub` to the api on `http://localhost:5001`.
42+
The app will run on http://localhost:8002/preview/ansible/automation-hub (and http://localhost:8002/beta/ansible/automation-hub) and proxy requests for `/api/automation-hub` to the api on `http://localhost:5001`.
4343

4444
## Deploying
4545

@@ -55,9 +55,9 @@ The Github Action invokes the [RedHatInsights/insights-frontend-builder-common//
5555
- any push to the `prod-stable` branch will deploy to a `ansible-hub-ui-build` `prod-stable` branch
5656
- the `ansible-hub-ui-build` `master` branch is not used, as PRs against `master` end up in `qa-beta`
5757

58-
- `qa-beta` builds end up on `console.stage.redhat.com/beta`
58+
- `qa-beta` builds end up on `console.stage.redhat.com/preview` (and `/beta`)
5959
- `qa-stable` builds end up on `console.stage.redhat.com`
60-
- `prod-beta` builds end up on `console.redhat.com/beta`
60+
- `prod-beta` builds end up on `console.redhat.com/preview` (and `/beta`)
6161
- `prod-stable` builds end up on `console.redhat.com`
6262

6363
### Workflows

config/insights.dev.webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = webpackBase({
1818
// Path on the host where the UI is found. EX: /apps/automation-hub
1919
UI_BASE_PATH:
2020
cloudBeta !== 'false'
21-
? '/beta/ansible/automation-hub/'
21+
? '/preview/ansible/automation-hub/'
2222
: '/ansible/automation-hub/',
2323

2424
// Port that the UI is served over

config/insights.prod.webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = webpackBase({
88
API_BASE_PATH: '/api/automation-hub/',
99
UI_BASE_PATH:
1010
cloudBeta === 'true'
11-
? '/beta/ansible/automation-hub/'
11+
? '/preview/ansible/automation-hub/'
1212
: '/ansible/automation-hub/',
1313
DEPLOYMENT_MODE: 'insights',
1414
NAMESPACE_TERM: 'partners',

config/webpack.base.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ module.exports = (inputConfigs) => {
122122
// insights dev
123123
...(!isStandalone &&
124124
!isBuild && {
125-
appUrl: customConfigs.UI_BASE_PATH,
125+
appUrl: customConfigs.UI_BASE_PATH.includes('/preview/')
126+
? [
127+
customConfigs.UI_BASE_PATH,
128+
customConfigs.UI_BASE_PATH.replace('/preview/', '/beta/'),
129+
]
130+
: customConfigs.UI_BASE_PATH,
126131
deployment: cloudBeta !== 'false' ? 'beta/apps' : 'apps',
127132
standalone: {
128133
api: {

src/paths.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { Constants } from 'src/constants';
33
import { ParamHelper, ParamType } from 'src/utilities';
44

55
export function formatPath(path: Paths, data = {}, params?: ParamType) {
6-
// insights router has basename="/" or "/beta/", with hub under a nested "ansible/automation-hub" route - our urls are relative to that
6+
// insights router has basename="/", "/beta/" or "/preview/", with hub under a nested "ansible/automation-hub" route - our urls are relative to that
77
let url =
88
DEPLOYMENT_MODE === Constants.INSIGHTS_DEPLOYMENT_MODE
9-
? UI_BASE_PATH.replace('/beta/', '/').replace(/\/$/, '')
9+
? UI_BASE_PATH.replace('/preview/', '/')
10+
.replace('/beta/', '/')
11+
.replace(/\/$/, '')
1012
: '';
1113
url += (path as string) + '/';
1214

test/cypress.env.json.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{
1616
"apiPrefix": "/api/automation-hub/",
1717
"pulpPrefix": "/api/automation-hub/pulp/api/v3/",
18-
"uiPrefix": "/beta/ansible/automation-hub/",
18+
"uiPrefix": "/preview/ansible/automation-hub/",
1919
"username": "admin",
2020
"password": "admin",
2121
"galaxykit": "galaxykit --ignore-certs --auth-url 'http://localhost:8002/auth/realms/redhat-external/protocol/openid-connect/token'",

0 commit comments

Comments
 (0)