From 2f8b96fbc31214e72d1dde83111dc7270ffdc50c Mon Sep 17 00:00:00 2001 From: Gang Li Date: Tue, 7 Nov 2023 07:25:41 +0800 Subject: [PATCH] Add mock server for testing and debugging --- src/main/webui/nodemon.js | 3 + src/main/webui/package.json | 1 + src/main/webui/src/server/README.md | 18 ++ src/main/webui/src/server/app.js | 100 +++++++++++ src/main/webui/src/server/config/AppConfig.js | 5 + .../src/server/mock/FakeDisableTimeouts.json | 25 +++ .../src/server/mock/list/FakeGroupList.json | 83 +++++++++ .../src/server/mock/list/FakeHostedList.json | 76 +++++++++ .../src/server/mock/list/FakeRemoteList.json | 159 ++++++++++++++++++ src/main/webui/webpack.config-prod.js | 14 ++ src/main/webui/webpack.config.js | 14 ++ 11 files changed, 498 insertions(+) create mode 100644 src/main/webui/nodemon.js create mode 100644 src/main/webui/src/server/README.md create mode 100644 src/main/webui/src/server/app.js create mode 100644 src/main/webui/src/server/config/AppConfig.js create mode 100644 src/main/webui/src/server/mock/FakeDisableTimeouts.json create mode 100644 src/main/webui/src/server/mock/list/FakeGroupList.json create mode 100644 src/main/webui/src/server/mock/list/FakeHostedList.json create mode 100644 src/main/webui/src/server/mock/list/FakeRemoteList.json diff --git a/src/main/webui/nodemon.js b/src/main/webui/nodemon.js new file mode 100644 index 0000000..fe16291 --- /dev/null +++ b/src/main/webui/nodemon.js @@ -0,0 +1,3 @@ +{ + "watch": ["src/server/"] +} diff --git a/src/main/webui/package.json b/src/main/webui/package.json index e4a4b40..6ef456e 100644 --- a/src/main/webui/package.json +++ b/src/main/webui/package.json @@ -55,6 +55,7 @@ "dev": "webpack-dev-server --open --hot", "lint": "eslint './src/**'", "lint-fix": "eslint './src/**' --fix", + "server": "npm run build && nodemon src/server/app.js --exec babel-node --presets @babel/preset-env", "test": "NODE_ENV=test jest" } } diff --git a/src/main/webui/src/server/README.md b/src/main/webui/src/server/README.md new file mode 100644 index 0000000..05149d9 --- /dev/null +++ b/src/main/webui/src/server/README.md @@ -0,0 +1,18 @@ +# UI Mock Server + +This mock server is used for frontend testing. It is served as a mock backend to provide mock data for frontend component data fetching + +## How to run + +Use + +```bash +npm run server +``` + +to start the server + +## How to add your mocking data + +1. Add your mock data in mock folder, for example: [mock/list/FakeRemoteList.json](mock/list/FakeRemoteList.json) is for the remote listing mock data +2. Add code to provide your mock data through express server code with correct http providers. For details, please check the [app.js](app.js) for details. diff --git a/src/main/webui/src/server/app.js b/src/main/webui/src/server/app.js new file mode 100644 index 0000000..ec19bad --- /dev/null +++ b/src/main/webui/src/server/app.js @@ -0,0 +1,100 @@ +import compression from 'compression'; +import express from 'express'; +import path from 'path'; +import {Config} from './config/AppConfig'; + +const projectRoot = path.resolve(__dirname, '../../dist'); +const indexHtml=path.join(projectRoot+'/index.html'); + +const app = express(); +app.use(compression()); +const server = app.listen(Config.SERVER_PORT, () => { + const host = server.address().address; + const port = server.address().port; + + console.log("Example app listening at http://%s:%s", host, port); +}); +app.use(express.static('dist')); + +// For direct url bar addressing, will send home page directly for client router rendering +app.get([Config.APP_ROOT, `${Config.APP_ROOT}/*`, '/'], (req, res) => { + res.sendFile(indexHtml); +}); + +app.get('/api/admin/stores/_all/remote', (req, res) => { + const remoteList = require('./mock/list/FakeRemoteList.json'); + res.status(200).json(remoteList); +}); + +app.get('/api/admin/stores/_all/hosted', (req, res) => { + const hostedList = require('./mock/list/FakeHostedList.json'); + res.status(200).json(hostedList); +}); + +app.get('/api/admin/stores/_all/group', (req, res) => { + const groupList = require('./mock/list/FakeGroupList.json'); + res.status(200).json(groupList); +}); + +app.get('/api/admin/schedule/store/all/disable-timeout', (req, res) => { + const disableTimeouts = require('./mock/FakeDisableTimeouts.json'); + res.status(200).json(disableTimeouts); +}); + +app.get('/api/admin/schedule/store/:packageType/:type/:name/disable-timeout', (req, res) => { + const group = `${req.params.packageType}:${req.params.type}:${req.params.name}`; + if(group && group.length > 0){ + const disList = require('./mock/FakeDisableTimeouts.json'); + const result = disList.items.find(item=>item.group.includes(group)); + if(result){ + res.status(200).json(result); + }else{ + res.status(404).json({error: "No such store!"}); + } + } +}); + +app.get('/api/admin/stores/maven/remote/:name', (req, res) => { + const name = req.params.name; + if(name){ + const remoteList = require('./mock/list/FakeRemoteList.json'); + const result = remoteList.items.find(item=>item.name===name); + if(result){ + res.status(200).json(result); + }else{ + res.status(404).json({error: "No such store!"}); + } + }else{ + res.status(400).json({error: "Missing store name"}); + } +}); + +app.get('/api/admin/stores/maven/hosted/:name', (req, res) => { + const name=req.params.name; + if(name){ + const remoteList = require('./mock/list/FakeHostedList.json'); + const result = remoteList.items.find(item=>item.name===name); + if(result){ + res.status(200).json(result); + }else{ + res.status(404).json({error: "No such store!"}); + } + }else{ + res.status(400).json({error: "Missing store name"}); + } +}); + +app.get('/api/admin/stores/maven/group/:name', (req, res) => { + const name=req.params.name; + if(name){ + const remoteList = require('./mock/list/FakeGroupList.json'); + const result = remoteList.items.find(item=>item.name===name); + if(result){ + res.status(200).json(result); + }else{ + res.status(404).json({error: "No such store!"}); + } + }else{ + res.status(400).json({error: "Missing store name"}); + } +}); diff --git a/src/main/webui/src/server/config/AppConfig.js b/src/main/webui/src/server/config/AppConfig.js new file mode 100644 index 0000000..c47087b --- /dev/null +++ b/src/main/webui/src/server/config/AppConfig.js @@ -0,0 +1,5 @@ +export const Config = { + SERVER_PORT: 4000, + APP_ROOT: "/#" +}; + diff --git a/src/main/webui/src/server/mock/FakeDisableTimeouts.json b/src/main/webui/src/server/mock/FakeDisableTimeouts.json new file mode 100644 index 0000000..b9da1da --- /dev/null +++ b/src/main/webui/src/server/mock/FakeDisableTimeouts.json @@ -0,0 +1,25 @@ +{ + "items" : [ + { + "name" : "Disable-Timeout", + "group" : "maven:remote:koji-org.jboss.ws-jbossws-common-tools-1.2.4.Final_redhat_1-1", + "expiration": "1541577250077" + }, + { + "name" : "Disable-Timeout", + "group" : "maven:remote:i-maven-restlet-4" + }, + { + "name" : "Disable-Timeout", + "group" : "maven:hosted:FisZYfNgpR" + }, + { + "name" : "Disable-Timeout", + "group" : "maven:group:build_org-keycloak-keycloak-parent-4-x_20180515.1724" + }, + { + "name" : "Disable-Timeout", + "group" : "maven:group:build_org-keycloak-keycloak-parent-4-x_20180531.0218" + } + ] +} diff --git a/src/main/webui/src/server/mock/list/FakeGroupList.json b/src/main/webui/src/server/mock/list/FakeGroupList.json new file mode 100644 index 0000000..6481813 --- /dev/null +++ b/src/main/webui/src/server/mock/list/FakeGroupList.json @@ -0,0 +1,83 @@ +{ + "items" : [ + { + "type" : "group", + "key" : "maven:group:build_org-keycloak-keycloak-parent-4-x_20180515.1724", + "description" : "Aggregation group for PNC build #1859", + "metadata" : { + "changelog" : "Creating repository group for resolving artifacts in build: 1859 (repo: build_org-keycloak-keycloak-parent-4-x_20180515.1724)" + }, + "disabled" : false, + "constituents" : [ "maven:hosted:FisZYfNgpR", "maven:remote:koji-org.jboss.ws-jbossws-common-tools-1.2.4.Final_redhat_1-1", "maven:group:build_vertx-infinispan-3-5-1_20180705.1313"], + "packageType" : "maven", + "name" : "build_org-keycloak-keycloak-parent-4-x_20180515.1724", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "prepend_constituent" : false + }, + { + "type" : "group", + "key" : "maven:group:build_org-keycloak-keycloak-parent-4-x_20180531.0218", + "description" : "Aggregation group for PNC build #1981", + "metadata" : { + "changelog" : "Creating repository group for resolving artifacts in build: 1981 (repo: build_org-keycloak-keycloak-parent-4-x_20180531.0218)" + }, + "disabled" : false, + "constituents" : [ "maven:hosted:tYMtROxQUA", "maven:remote:i-maven-restlet-4"], + "packageType" : "maven", + "name" : "build_org-keycloak-keycloak-parent-4-x_20180531.0218", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "prepend_constituent" : false + }, + { + "type" : "group", + "key" : "maven:group:build_org-keycloak-keycloak-nodejs-auth-utils-3-xnpm_1-2-stage-4_20180104.1216", + "description" : "Aggregation group for PNC build #333", + "metadata" : { + "changelog" : "Creating repository group for resolving artifacts in build: 333 (repo: build_org-keycloak-keycloak-nodejs-auth-utils-3-xnpm_1-2-stage-4_20180104.1216)" + }, + "disabled" : false, + "constituents" : [ "maven:hosted:LYnrVCMAZP", "maven:group:public", "maven:remote:repo.eclipse.org", "maven:remote:microprofile.repo.eclipse.org" ], + "packageType" : "maven", + "name" : "build_org-keycloak-keycloak-nodejs-auth-utils-3-xnpm_1-2-stage-4_20180104.1216", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "prepend_constituent" : false + }, + { + "type" : "group", + "key" : "maven:group:build_vertx-infinispan-3-5-1_20180705.1313", + "description" : "Aggregation group for PNC build #2759", + "metadata" : { + "changelog" : "Creating repository group for resolving artifacts in build: 2759 (repo: build_vertx-infinispan-3-5-1_20180705.1313)" + }, + "disabled" : false, + "constituents" : [ "maven:hosted:build_kie-soup_20180628.0657", "maven:group:public" ], + "packageType" : "maven", + "name" : "build_vertx-infinispan-3-5-1_20180705.1313", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "prepend_constituent" : false + }, + { + "type" : "group", + "key" : "maven:group:public", + "metadata" : { + "changelog" : "test" + }, + "disabled" : false, + "constituents" : [ "maven:remote:central", "maven:remote:mrrc-ga", "maven:remote:repo.eclipse.org", "maven:remote:microprofile.repo.eclipse.org" ], + "packageType" : "maven", + "name" : "public", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "prepend_constituent" : false + } + ] +} diff --git a/src/main/webui/src/server/mock/list/FakeHostedList.json b/src/main/webui/src/server/mock/list/FakeHostedList.json new file mode 100644 index 0000000..1a91973 --- /dev/null +++ b/src/main/webui/src/server/mock/list/FakeHostedList.json @@ -0,0 +1,76 @@ +{ + "items" : [ + { + "type" : "hosted", + "key" : "maven:hosted:FisZYfNgpR", + "description" : "Build output for PNC build #48216536", + "metadata" : { + "changelog" : "Creating hosted repository for build: 48216536 (repo: FisZYfNgpR)" + }, + "disabled" : false, + "snapshotTimeoutSeconds" : 0, + "readonly" : true, + "packageType" : "maven", + "name" : "FisZYfNgpR", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : true, + "allow_snapshots" : false, + "allow_releases" : true + }, + { + "type" : "hosted", + "key" : "maven:hosted:tYMtROxQUA", + "description" : "Build output for PNC build #49682846", + "metadata" : { + "changelog" : "Creating hosted repository for build: 49682846 (repo: tYMtROxQUA)" + }, + "disabled" : false, + "snapshotTimeoutSeconds" : 0, + "readonly" : false, + "packageType" : "maven", + "name" : "tYMtROxQUA", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "allow_snapshots" : false, + "allow_releases" : true + }, + { + "type" : "hosted", + "key" : "maven:hosted:LYnrVCMAZP", + "description" : "Build output for PNC build #40419410", + "metadata" : { + "changelog" : "Creating hosted repository for build: 40419410 (repo: LYnrVCMAZP)" + }, + "disabled" : false, + "snapshotTimeoutSeconds" : 0, + "readonly" : false, + "packageType" : "maven", + "name" : "LYnrVCMAZP", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "allow_snapshots" : false, + "allow_releases" : true + }, + { + "type" : "hosted", + "key" : "maven:hosted:build_kie-soup_20180628.0657", + "description" : "Build output for PNC build #2601", + "metadata" : { + "changelog" : "Creating hosted repository for build: 2601 (repo: build_kie-soup_20180628.0657)" + }, + "disabled" : false, + "snapshotTimeoutSeconds" : 0, + "readonly" : false, + "packageType" : "maven", + "name" : "build_kie-soup_20180628.0657", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "allow_snapshots" : false, + "allow_releases" : true + } + ] +} diff --git a/src/main/webui/src/server/mock/list/FakeRemoteList.json b/src/main/webui/src/server/mock/list/FakeRemoteList.json new file mode 100644 index 0000000..5fa2350 --- /dev/null +++ b/src/main/webui/src/server/mock/list/FakeRemoteList.json @@ -0,0 +1,159 @@ +{ + + "items" : [ + { + "type" : "remote", + "key" : "maven:remote:central", + "metadata" : { + "changelog" : "Update central url", + "implied_stores" : "{\n \"items\" : [ \"maven:remote:sonatype-google-snapshots\", \"maven:remote:sonatype-snapshots\" ]\n}" + }, + "disabled" : false, + "host" : "repo1.maven.org", + "port" : 443, + "name" : "central", + "packageType" : "maven", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "create_time" : "2022-06-27 15:47:33 +0000", + "allow_snapshots" : false, + "allow_releases" : true, + "url" : "https://repo1.maven.org/maven2/", + "timeout_seconds" : 0, + "max_connections" : 30, + "ignore_hostname_verification" : false, + "nfc_timeout_seconds" : 0, + "is_passthrough" : false, + "cache_timeout_seconds" : 86400, + "metadata_timeout_seconds" : 0, + "proxy_port" : 0, + "prefetch_priority" : 0, + "prefetch_rescan" : false, + "prefetch_listing_type" : "html" + }, { + "type" : "remote", + "key" : "maven:remote:i-maven-restlet-4", + "description" : "Implicitly created repo for: Public online Restlet repository (maven-restlet) from repository declaration removed by PME in build 516 (repo: build_org-apache-camel-camel-2-20-0-fuse-000120fuse_test_1_20180128.1929)", + "metadata" : { + "changelog" : "Creating extra remote repository Public online Restlet repository (maven-restlet) for build: 516 (repo: build_org-apache-camel-camel-2-20-0-fuse-000120fuse_test_1_20180128.1929)", + "origin" : "implied-repos" + }, + "disabled" : false, + "host" : "maven.restlet.org", + "port" : 80, + "name" : "i-maven-restlet-4", + "packageType" : "maven", + "disable_timeout" : 0, + "path_style" : "plain", + "authoritative_index" : false, + "allow_snapshots" : true, + "allow_releases" : true, + "url" : "http://maven.restlet.org", + "timeout_seconds" : 0, + "max_connections" : 30, + "ignore_hostname_verification" : false, + "nfc_timeout_seconds" : 0, + "is_passthrough" : false, + "cache_timeout_seconds" : 0, + "metadata_timeout_seconds" : 0, + "proxy_port" : 0, + "prefetch_priority" : 0, + "prefetch_rescan" : false, + "server_certificate_pem" : "------BEGIN CERTIFICATE-----\nMIIEgjCCA2qgAwIBAgIIFt7RyLXkf5cwDQYJKoZIhvcNAQELBQAwVDELMAkGA1UE\nBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczElMCMGA1UEA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remote:mrrc-ga", + "metadata" : { + "changelog" : "a" + }, + "disabled" : false, + "host" : "maven.repository.redhat.com", + "port" : 443, + "packageType" : "maven", + "name" : "mrrc-ga", + "disable_timeout" : -1, + "path_style" : "plain", + "authoritative_index" : false, + "allow_snapshots" : true, + "allow_releases" : true, + "url" : "https://maven.repository.redhat.com/ga/", + "timeout_seconds" : 0, + "max_connections" : 30, + "ignore_hostname_verification" : false, + "nfc_timeout_seconds" : 0, + "is_passthrough" : false, + "cache_timeout_seconds" : 0, + "metadata_timeout_seconds" : 86400, + "proxy_port" : 0, + "prefetch_priority" : 0, + "prefetch_rescan" : false, + "prefetch_listing_type" : "html" + }, + { + "type" : "remote", + "key" : "maven:remote:repo.eclipse.org", + "description" : "Implicitly created repo for: Project Repository - Releases (repo.eclipse.org) from repository declaration in POM: org.eclipse.microprofile.config:microprofile-config-parent:1.3", + "metadata" : { + "origin" : "implied-repos" + }, + "disabled" : false, + "host" : "repo.eclipse.org", + "port" : 443, + "packageType" : "maven", + "name" : "repo.eclipse.org", + "disable_timeout" : 0, + "path_style" : "plain", + "path_mask_patterns" : [ "r|^((?!-redhat-[0-9]+).)*$|" ], + "authoritative_index" : false, + "allow_snapshots" : false, + "allow_releases" : true, + "url" : "https://repo.eclipse.org/content/groups/cbi/", + "timeout_seconds" : 0, + "max_connections" : 30, + "ignore_hostname_verification" : false, + "nfc_timeout_seconds" : 0, + "is_passthrough" : false, + "cache_timeout_seconds" : 0, + "metadata_timeout_seconds" : 0, + "proxy_port" : 0, + "prefetch_priority" : 0, + "prefetch_rescan" : false, + "prefetch_listing_type" : "html" + }, + { + "type" : "remote", + "key" : "maven:remote:microprofile.repo.eclipse.org", + "description" : "Implicitly created repo for: Microprofile Project Repository - Releases (microprofile.repo.eclipse.org) from repository declaration in POM: org.eclipse.microprofile.config:microprofile-config-parent:1.3", + "metadata" : { + "origin" : "implied-repos" + }, + "disabled" : false, + "host" : "repo.eclipse.org", + "port" : 443, + "packageType" : "maven", + "name" : "microprofile.repo.eclipse.org", + "disable_timeout" : 0, + "path_style" : "plain", + "path_mask_patterns" : [ "r|^((?!-redhat-[0-9]+).)*$|" ], + "authoritative_index" : false, + "allow_snapshots" : false, + "allow_releases" : true, + "url" : "https://repo.eclipse.org/content/groups/microprofile/", + "timeout_seconds" : 0, + "max_connections" : 30, + "ignore_hostname_verification" : false, + "nfc_timeout_seconds" : 0, + "is_passthrough" : false, + "cache_timeout_seconds" : 0, + "metadata_timeout_seconds" : 0, + "proxy_port" : 0, + "prefetch_priority" : 0, + "prefetch_rescan" : false, + "prefetch_listing_type" : "html" + } + ] +} diff --git a/src/main/webui/webpack.config-prod.js b/src/main/webui/webpack.config-prod.js index 93a5712..d81cccf 100644 --- a/src/main/webui/webpack.config-prod.js +++ b/src/main/webui/webpack.config-prod.js @@ -15,6 +15,7 @@ */ const path = require('path'); +const TerserPlugin = require('terser-webpack-plugin'); const outputDirectory = 'dist'; @@ -25,6 +26,19 @@ module.exports = { filename: 'app_bundle.js' }, mode: 'production', + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + extractComments: false, + terserOptions: { + format: { + comments: false, + }, + }, + }), + ], + }, module: { rules: [ {test: /\.js$/u, use: 'babel-loader', exclude: /node_modules/u}, diff --git a/src/main/webui/webpack.config.js b/src/main/webui/webpack.config.js index c2effc6..8f238e7 100644 --- a/src/main/webui/webpack.config.js +++ b/src/main/webui/webpack.config.js @@ -15,6 +15,7 @@ */ const path = require('path'); +const TerserPlugin = require('terser-webpack-plugin'); const outputDirectory = 'dist'; @@ -26,6 +27,19 @@ module.exports = { }, mode: 'development', devtool: 'inline-source-map', + optimization: { + minimize: true, + minimizer: [ + new TerserPlugin({ + extractComments: false, + terserOptions: { + format: { + comments: false, + }, + }, + }), + ], + }, module: { rules: [ {test: /\.js$/u, use: 'babel-loader', exclude: /node_modules/u},