Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions .github/workflows/on-pull-request-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,15 @@ jobs:
with:
install: false
start: npm run docker:run:awx
wait-on: 'http://localhost:4101'
wait-on: 'https://localhost:4101'
record: true
parallel: true
auto-cancel-after-failures: 1
config-file: cypress.awx.config.ts
env:
AWX_PROTOCOL: ${{ secrets.AWX_PROTOCOL }}
AWX_HOST: ${{ secrets.AWX_HOST }}
AWX_SERVER: ${{ secrets.CYPRESS_AWX_SERVER }}
AWX_USERNAME: ${{ secrets.CYPRESS_AWX_USERNAME }}
AWX_PASSWORD: ${{ secrets.CYPRESS_AWX_PASSWORD }}
AWX_SERVER: ${{ vars.AWX_SERVER }}
AWX_USERNAME: ${{ vars.AWX_USERNAME }}
AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_AUI_AWX_E2E_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_AUI_AWX_E2E_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -490,11 +488,9 @@ jobs:
# auto-cancel-after-failures: 1
# config-file: cypress.hub.config.ts
# env:
# HUB_HOST: ${{ secrets.HUB_HOST }}
# HUB_PROTOCOL: ${{ secrets.HUB_PROTOCOL }}
# CYPRESS_HUB_SERVER: http://localhost:5001
# CYPRESS_HUB_USERNAME: admin
# CYPRESS_HUB_PASSWORD: password
# HUB_SERVER: ${{ vars.HUB_SERVER }}
# HUB_USERNAME: ${{ vars.HUB_USERNAME }}
# HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }}
# CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_AUI_HUB_E2E_PROJECT_ID }}
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_AUI_HUB_E2E_RECORD_KEY }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -592,20 +588,18 @@ jobs:
with:
install: false
start: npm run docker:run:eda
wait-on: 'http://localhost:4103'
wait-on: 'https://localhost:4103'
record: true
parallel: true
auto-cancel-after-failures: 1
config-file: cypress.eda.config.ts
env:
EDA_PROTOCOL: ${{ secrets.EDA_PROTOCOL }}
EDA_HOST: ${{ secrets.EDA_HOST }}
AWX_SERVER: ${{ secrets.CYPRESS_AWX_SERVER }}
AWX_USERNAME: ${{ secrets.CYPRESS_AWX_USERNAME }}
AWX_PASSWORD: ${{ secrets.CYPRESS_AWX_PASSWORD }}
EDA_SERVER: ${{ secrets.CYPRESS_EDA_SERVER }}
EDA_USERNAME: ${{ secrets.CYPRESS_EDA_USERNAME }}
EDA_PASSWORD: ${{ secrets.CYPRESS_EDA_PASSWORD }}
AWX_SERVER: ${{ vars.AWX_SERVER }}
AWX_USERNAME: ${{ vars.AWX_USERNAME }}
AWX_PASSWORD: ${{ secrets.AWX_PASSWORD }}
EDA_SERVER: ${{ vars.EDA_SERVER }}
EDA_USERNAME: ${{ vars.EDA_USERNAME }}
EDA_PASSWORD: ${{ secrets.EDA_PASSWORD }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_AUI_EDA_E2E_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_AUI_EDA_E2E_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
FROM nginx:alpine as certificate
RUN apk add --no-cache openssl
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/nginx-selfsigned.key -out /etc/ssl/nginx-selfsigned.crt -subj "/C=US/ST=State/L=City/O=Organization/CN=localhost"

# base - nginx + openshift
#
# https://docs.openshift.com/container-platform/4.13/openshift_images/create-images.html#use-uid_create-images
Expand All @@ -11,8 +15,11 @@
# and be read/writable by that group. Files to be executed must also have group execute permissions.
#
FROM --platform=${TARGETPLATFORM:-linux/amd64} nginx:alpine as base
RUN chmod g+rwx /etc/nginx/nginx.conf /etc/nginx/conf.d /etc/nginx/conf.d/default.conf /var/cache/nginx /var/run /var/log/nginx
COPY --from=certificate /etc/ssl/nginx-selfsigned.crt /etc/ssl/nginx-selfsigned.crt
COPY --from=certificate /etc/ssl/nginx-selfsigned.key /etc/ssl/nginx-selfsigned.key
RUN chmod g+rwx /etc/nginx/nginx.conf /etc/nginx/conf.d /etc/nginx/conf.d/default.conf /var/cache/nginx /var/run /var/log/nginx /etc/ssl
COPY /nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 443

# awx-ui
FROM base as awx-ui
Expand Down
2 changes: 1 addition & 1 deletion cypress.awx.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import setValue from 'set-value';
import { baseConfig } from './cypress.base.config';

baseConfig.e2e!.specPattern = 'cypress/e2e/awx/**/*.cy.ts';
baseConfig.e2e!.baseUrl = 'http://localhost:4101';
baseConfig.e2e!.baseUrl = 'https://localhost:4101';
baseConfig.component!.specPattern = 'frontend/awx/**/*.cy.{js,jsx,ts,tsx}';
setValue(baseConfig, 'component.devServer.webpackConfig.devServer.port', 4201);

Expand Down
2 changes: 1 addition & 1 deletion cypress.eda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { baseConfig } from './cypress.base.config';
import setValue from 'set-value';

baseConfig.e2e!.specPattern = 'cypress/e2e/eda/**/*.cy.ts';
baseConfig.e2e!.baseUrl = 'http://localhost:4103';
baseConfig.e2e!.baseUrl = 'https://localhost:4103';
baseConfig.component!.specPattern = 'frontend/eda/**/*.cy.{js,jsx,ts,tsx}';
setValue(baseConfig, 'component.devServer.webpackConfig.devServer.port', 4203);

Expand Down
2 changes: 1 addition & 1 deletion cypress.hub.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import setValue from 'set-value';
import { baseConfig } from './cypress.base.config';

baseConfig.e2e!.specPattern = 'cypress/e2e/hub/**/*.cy.ts';
baseConfig.e2e!.baseUrl = 'http://localhost:4102';
baseConfig.e2e!.baseUrl = 'https://localhost:4102';
baseConfig.component!.specPattern = 'frontend/hub/**/*.cy.{js,jsx,ts,tsx}';
setValue(baseConfig, 'component.devServer.webpackConfig.devServer.port', 4202);

Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/eda/Projects/project-sync.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ describe('EDA Projects Syncing', () => {
cy.createEdaProject().then((edaProject) => {
cy.navigateTo('eda', 'projects');
cy.clickTableRowActionIcon(edaProject?.name, 'Sync project');
cy.contains('h4.pf-c-alert__title', `Syncing ${edaProject.name}`).should('be.visible');

// Cannot test the alert title because it showing is based on timing.
// cy.contains('h4.pf-c-alert__title', `Syncing ${edaProject.name}`).should('be.visible');

cy.get('td[data-label="Status"]').should('contain', 'Completed').should('be.visible');
cy.deleteEdaProject(edaProject);
});
Expand Down
2 changes: 1 addition & 1 deletion framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A framework for building applications using [PatternFly](https://www.patternfly.org), developed by the Ansible UI developers.

[Documentation](https://github.com/ansible/ansible-ui/wiki/Ansible-UI-Framework)
[Documentation](https://github.com/ansible/ansible-ui/wiki/Ansible-UI-Framework).
27 changes: 16 additions & 11 deletions nginx/awx.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
server {
listen 8080 default_server;
listen [::]:8080;
listen 80;
listen [::]:80;
server_name _
server_tokens off;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
server_tokens off;

ssl_certificate /etc/ssl/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/nginx-selfsigned.key;

access_log off;
# error_log off;

Expand All @@ -20,18 +30,13 @@ server {
root /usr/share/nginx/html;

location /api {
proxy_pass $AWX_PROTOCOL://$AWX_HOST;
proxy_set_header Host $AWX_HOST;
proxy_set_header Origin $AWX_PROTOCOL://$AWX_HOST;
proxy_set_header Referer $AWX_PROTOCOL://$AWX_HOST;
proxy_pass $AWX_SERVER;
proxy_set_header Origin $AWX_SERVER;
}

location /websocket {
proxy_pass $AWX_PROTOCOL://$AWX_HOST;
proxy_set_header Host $AWX_HOST;
proxy_set_header Origin $AWX_PROTOCOL://$AWX_HOST;
proxy_set_header Referer $AWX_PROTOCOL://$AWX_HOST;

proxy_pass $AWX_SERVER;
proxy_set_header Origin $AWX_SERVER;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
Expand Down
33 changes: 19 additions & 14 deletions nginx/eda.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
server {
listen 8080 default_server;
listen [::]:8080;
listen 80;
listen [::]:80;
server_name _
server_tokens off;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
server_tokens off;

ssl_certificate /etc/ssl/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/nginx-selfsigned.key;

access_log off;
# error_log off;

Expand All @@ -19,24 +29,19 @@ server {

root /usr/share/nginx/html;

location ~ ^/api/eda/ws/[0-9a-z-]+ {
proxy_pass $EDA_PROTOCOL://$EDA_HOST;
proxy_set_header Host $EDA_HOST;
proxy_set_header Origin $EDA_PROTOCOL://$EDA_HOST;
proxy_set_header Referer $EDA_PROTOCOL://$EDA_HOST;
location ~ ^/api/eda/v[0-9]+/ {
proxy_pass $EDA_SERVER;
proxy_set_header Origin $EDA_SERVER;
}

location ~ ^/api/eda/ws/[0-9a-z-]+ {
proxy_pass $EDA_SERVER;
proxy_set_header Origin $EDA_SERVER;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}

location ~ ^/api/eda/v[0-9]+/ {
proxy_pass $EDA_PROTOCOL://$EDA_HOST;
proxy_set_header Host $EDA_HOST;
proxy_set_header Origin $EDA_PROTOCOL://$EDA_HOST;
proxy_set_header Referer $EDA_PROTOCOL://$EDA_HOST;
}

location ~* \.(json|woff|woff2|jpe?g|png|gif|ico|svg|css|js)$ {
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
Expand Down
20 changes: 14 additions & 6 deletions nginx/hub.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
server {
listen 8080 default_server;
listen [::]:8080;
listen 80;
listen [::]:80;
server_name _
server_tokens off;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name _;
server_tokens off;

ssl_certificate /etc/ssl/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/nginx-selfsigned.key;

access_log off;
# error_log off;

Expand All @@ -20,10 +30,8 @@ server {
root /usr/share/nginx/html;

location /api {
proxy_pass $HUB_PROTOCOL://$HUB_HOST;
proxy_set_header Host $HUB_HOST;
proxy_set_header Origin $HUB_PROTOCOL://$HUB_HOST;
proxy_set_header Referer $HUB_PROTOCOL://$HUB_HOST;
proxy_pass $HUB_SERVER;
proxy_set_header Origin $HUB_SERVER;
}

location ~* \.(json|woff|woff2|jpe?g|png|gif|ico|svg|css|js)$ {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"docker:build:hub": "docker build --target hub-ui --tag hub-ui .",
"docker:build:eda": "docker build --target eda-ui --tag eda-ui .",
"docker:run": "concurrently npm:docker:run:awx npm:docker:run:hub npm:docker:run:eda -c cyan,green,blue",
"docker:run:awx": "echo http://localhost:4101 && docker run --name awx-ui --rm -e LOG_LEVEL=debug -p 4101:8080 -e AWX_HOST=$AWX_HOST -e AWX_PROTOCOL=$AWX_PROTOCOL awx-ui",
"docker:run:hub": "echo http://localhost:4102 && docker run --name hub-ui --rm -e LOG_LEVEL=debug -p 4102:8080 -e HUB_HOST=$HUB_HOST -e HUB_PROTOCOL=$HUB_PROTOCOL hub-ui",
"docker:run:eda": "echo http://localhost:4103 && docker run --name eda-ui --rm -e LOG_LEVEL=debug -p 4103:8080 -e EDA_HOST=$EDA_HOST -e EDA_PROTOCOL=$EDA_PROTOCOL eda-ui"
"docker:run:awx": "echo https://localhost:4101 && docker run --name awx-ui --rm -e LOG_LEVEL=debug -p 4101:443 -e AWX_SERVER=$AWX_SERVER awx-ui",
"docker:run:hub": "echo https://localhost:4102 && docker run --name hub-ui --rm -e LOG_LEVEL=debug -p 4102:443 -e HUB_SERVER=$HUB_SERVER hub-ui",
"docker:run:eda": "echo https://localhost:4103 && docker run --name eda-ui --rm -e LOG_LEVEL=debug -p 4103:443 -e EDA_SERVER=$EDA_SERVER eda-ui"
},
"dependencies": {
"@ansible/react-json-chart-builder": "^1.15.2",
Expand Down
1 change: 1 addition & 0 deletions webpack/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ module.exports = function (env, argv) {
],
},
devServer: {
https: true, // Enable for using oAuth in dev environment
historyApiFallback: true,
compress: true,
hot: true,
Expand Down