From 6a029840dd41c367773df78f43359ba9dd939068 Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Wed, 21 Jun 2023 13:53:14 -0500 Subject: [PATCH 01/30] let draft site use the staging starter to avoid backports --- src/main/content/_assets/js/builds.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 9db10ba6f0..3e92acbc4a 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -21,7 +21,7 @@ var versArr = []; var builds_url = '/api/builds/data'; var starter_domain = - isStagingSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://start.openliberty.io'; + isNotProdSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://start.openliberty.io'; var starter_info_url = starter_domain + '/api/start/info'; var starter_submit_url = starter_domain + '/api/start'; var failed_builds_request = false; @@ -83,9 +83,14 @@ if (site_lang != 'en') { baseURL = '/'+site_lang; } -function isStagingSite() { +function isNotProdSite() { + // both staging and draft will point to the staging branch of the starter repo var host = window.location.hostname; - return host.indexOf('staging') > -1; + if ((host.indexOf('staging') > -1) || (host.indexOf('draft') > -1)) { + return true; + } else { + return false; + } } /** From 83ca6d9eda2fd7b3762c67a3670c97ca9b19c086 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 21 Jun 2023 14:41:24 -0500 Subject: [PATCH 02/30] Create cypressgeneraltests.yml --- .github/workflows/cypressgeneraltests.yml | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/cypressgeneraltests.yml diff --git a/.github/workflows/cypressgeneraltests.yml b/.github/workflows/cypressgeneraltests.yml new file mode 100644 index 0000000000..1a9427d9f6 --- /dev/null +++ b/.github/workflows/cypressgeneraltests.yml @@ -0,0 +1,65 @@ +# This workflow will run the cypress tests that are unrelated to the downloading and +# testing of the starter zip files + +name: Test Feature Versions RedirectURls and Runtime Release Versions +on: + workflow_dispatch: + +jobs: + use-cypress-test-FeatureVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: + - uses: actions/checkout@v3.3.0 + - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testFeatureVersions.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testFeatureVersions.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-videos + path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testFeatureVersions.cy.js.mp4 + + use-cypress-test-RuntimeReleaseVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: + - uses: actions/checkout@v3.3.0 + - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRuntimeReleaseVersions.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testRuntimeReleaseVersions.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-videos + path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRuntimeReleaseVersions.cy.js.mp4 + + use-cypress-test-RedirectURLS: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: + - uses: actions/checkout@v3.3.0 + - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRedirectURLs.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testRedirectURLs.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-videos + path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 + From 91dcd08ad632feb145738ee708469f9bf0ea1eeb Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Mon, 26 Jun 2023 12:42:03 -0500 Subject: [PATCH 03/30] adding defaults test --- ...raltests.yml => cypress-general-tests.yml} | 22 ++++++++++- ...ults.cy.js => testOLStarterDefaults.cy.js} | 17 +------- .../e2e/testOLStarterGradleDefaults.cy.js | 39 ------------------- 3 files changed, 23 insertions(+), 55 deletions(-) rename .github/workflows/{cypressgeneraltests.yml => cypress-general-tests.yml} (75%) rename src/test/cypressjs/cypress/e2e/{testOLStarterMavenDefaults.cy.js => testOLStarterDefaults.cy.js} (54%) delete mode 100644 src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js diff --git a/.github/workflows/cypressgeneraltests.yml b/.github/workflows/cypress-general-tests.yml similarity index 75% rename from .github/workflows/cypressgeneraltests.yml rename to .github/workflows/cypress-general-tests.yml index 1a9427d9f6..a14119c6e7 100644 --- a/.github/workflows/cypressgeneraltests.yml +++ b/.github/workflows/cypress-general-tests.yml @@ -1,7 +1,7 @@ # This workflow will run the cypress tests that are unrelated to the downloading and # testing of the starter zip files -name: Test Feature Versions RedirectURls and Runtime Release Versions +name: General Starter and Redirect Tests on: workflow_dispatch: @@ -63,3 +63,23 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 + use-cypress-test-StarterDefaults: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: + - uses: actions/checkout@v3.3.0 + - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-screenshots + path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testOLStarterDefaults.cy.js + + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: cypress-videos + path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testOLStarterDefaults.cy.js.mp4 + + diff --git a/src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js b/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js similarity index 54% rename from src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js rename to src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js index 7f5aa2100c..249b159497 100644 --- a/src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js +++ b/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js @@ -1,9 +1,7 @@ describe('Test Open Liberty Starter - Maven Default EE and MP', () => { - // Allow users to specify URL via variables found in cypress.env.json - // java home path for jdk17, jdk11, jdk8 can be change via cypress.env.json base on user env var - // this test will only download the starter for the default_jdk in that file - + // Test the default values for the starter + const default_javahome = Cypress.env('jdk_11_home'); const appname = "app-name-m-default"; const downloadsFolder = Cypress.config('downloadsFolder'); @@ -22,15 +20,4 @@ describe('Test Open Liberty Starter - Maven Default EE and MP', () => { cy.get("#Starter_MicroProfile_Version").should("have.value", mpDefault); }); - it('Test zip file is downloaded with default values', () => { - cy.exec(`rm -rf ${downloadsFolder}`, { failOnNonZeroExit: false }); - // download zip for the defaults - cy.log('appname ' + appname); - cy.log('javaLevel ' + javaDefault); - cy.goToOpenLibertyStarter(); - cy.downloadAndUnzipFile(appname, eeDefault, mpDefault,'m'); - cy.runMVNWLibertyDev(appname, default_javahome); - cy.checkLocalSplashPage(); - cy.runMVNWLibertyStop(appname, default_javahome); - }); }); \ No newline at end of file diff --git a/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js b/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js deleted file mode 100644 index fdd5caa0c5..0000000000 --- a/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js +++ /dev/null @@ -1,39 +0,0 @@ - -describe('Test Open Liberty Starter - Gradle Default EE and MP', () => { - - // Allow users to specify URL via variables found in cypress.env.json - // java home path for jdk17, jdk11, jdk8 can be change via cypress.env.json base on user env var - // this test will only download the starter for the default_jdk in that file - - const default_javahome = Cypress.env('jdk_11_home'); - const appname = "app-name-g-default"; - const downloadsFolder = Cypress.config('downloadsFolder'); - const eeDefault = "10.0"; - const mpDefault = "6.0" - const javaDefault = Cypress.env('default_jdk'); - - // tests - it('Default values for Open Liberty Starter', () => { - cy.goToOpenLibertyStarter(); - cy.get("#Starter_Base_Package").should("have.value", "com.demo"); - cy.get("#Starter_App_Name").should("have.value", "app-name"); - cy.get('#build_system_gradle').click(); - cy.get("#starter_section input[type=radio]:checked").should("have.value", "gradle"); - cy.get("#Starter_Java_Version").should("have.value", javaDefault); - cy.get("#Starter_Jakarta_Version").should("have.value", eeDefault); - cy.get("#Starter_MicroProfile_Version").should("have.value", mpDefault); - }); - - it('Test zip file is downloaded with default values', () => { - cy.exec(`rm -rf ${downloadsFolder}`, { failOnNonZeroExit: false }); - // download zip for the defaults - cy.log('appname ' + appname); - cy.log('javaLevel ' + javaDefault); - cy.goToOpenLibertyStarter(); - cy.downloadAndUnzipFile(appname, eeDefault, mpDefault,'g'); - cy.runGradlewLibertyDev(appname, default_javahome); - cy.checkLocalSplashPage(); - cy.runGradlewLibertyStop(appname, default_javahome); - }); - -}); \ No newline at end of file From caa29947fb2d8b63b23af22701193b0fd1772c50 Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Mon, 26 Jun 2023 14:00:58 -0500 Subject: [PATCH 04/30] update the readme --- src/test/cypressjs/README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/test/cypressjs/README.md b/src/test/cypressjs/README.md index c2d78ad485..e6c33037c2 100644 --- a/src/test/cypressjs/README.md +++ b/src/test/cypressjs/README.md @@ -1,13 +1,13 @@ -# How to run [Cypress.io](https://www.cypress.io/) automated UI tests +# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locallly ## Step 1: First time setting up local environment with Cypress - Run `npm install` in the directory containing this `README.md` - `node_modules` is created containing Cypress and its dependencies. ## Step 2: Setup URL you want the to test and the default java (2 options) - Update the value for `default_website_url` in `cypress.config.js` with target URL, update - the default_jdk with which java you want to test for tests that only test one, update the - locations of the java levels on your local machine + Update the value for `default_website_url` in `cypress.config.js` with target URL (usually either + the staging or production site). To execute the testOLStarterAll*.cy.js tests update the default java + and the location of the java levels on your local machine to the version you wish to test. NOTE - do not check in the cypress.config.js file with any changes for your local environment @@ -18,3 +18,11 @@ NOTE - do not check in the cypress.config.js file with any changes for your loca NOTE - the testOLStarterAllGradle.cy.js and cypress/e2e/testOLMavenAllGradle.cy.js tests use a lot of system memory and run more reliably headless + +# Alternatively - Run Tests with GitHub Actions In Git + +## Step 1: Go to https://github.com/OpenLiberty/openliberty.io/actions + Here you will see an action called 'General Starter and Redirect Tests'. This action will execute all of the tests in + the cypressjs/cypress/e2e directory with the exception of the testOLStarterAllMaven and testOLStarterAllGradle. These + two tests can be run from the starter repo - https://github.com/OpenLiberty/start.openliberty.io/actions. + From 6a9d669e580feb45bee390c6a6201cab5d15da2a Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Mon, 26 Jun 2023 14:05:27 -0500 Subject: [PATCH 05/30] fix typo --- src/test/cypressjs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/cypressjs/README.md b/src/test/cypressjs/README.md index e6c33037c2..1274a2ccd8 100644 --- a/src/test/cypressjs/README.md +++ b/src/test/cypressjs/README.md @@ -1,4 +1,4 @@ -# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locallly +# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locally ## Step 1: First time setting up local environment with Cypress - Run `npm install` in the directory containing this `README.md` From a7af8163851adbdd5d420155179730f4de7a319d Mon Sep 17 00:00:00 2001 From: amyreit Date: Mon, 26 Jun 2023 14:06:33 -0500 Subject: [PATCH 06/30] Update README.md --- src/test/cypressjs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/cypressjs/README.md b/src/test/cypressjs/README.md index 1274a2ccd8..b888fb75d6 100644 --- a/src/test/cypressjs/README.md +++ b/src/test/cypressjs/README.md @@ -1,4 +1,4 @@ -# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locally +# How to run [Cypress.io](https://www.cypress.io/) automated UI tests locally ## Step 1: First time setting up local environment with Cypress - Run `npm install` in the directory containing this `README.md` From 20263581e695195c81d8b4341faaf58b1c6b3317 Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Mon, 26 Jun 2023 21:35:16 -0500 Subject: [PATCH 07/30] change to allow it to use all chars --- src/main/content/_assets/js/builds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 3e92acbc4a..dfc0466d41 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -839,7 +839,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for the first package name include a-z. Subpackages also allow A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' + '

Valid characters for package names include a-z, A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' ); } div.append(warning_icon).append(message); @@ -862,7 +862,7 @@ function add_invalid_message(field_id, valid) { function validate_group_name() { // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-z]+(\.[A-Za-z]\w*)+$/g; + var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From 5a51efac6f888853d948775ca36e5632bae308eb Mon Sep 17 00:00:00 2001 From: amyreit Date: Tue, 27 Jun 2023 11:48:39 -0500 Subject: [PATCH 08/30] Update and rename cypress-general-tests.yml to cypress-general-tests.ym --- ...ral-tests.yml => cypress-general-tests.ym} | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) rename .github/workflows/{cypress-general-tests.yml => cypress-general-tests.ym} (87%) diff --git a/.github/workflows/cypress-general-tests.yml b/.github/workflows/cypress-general-tests.ym similarity index 87% rename from .github/workflows/cypress-general-tests.yml rename to .github/workflows/cypress-general-tests.ym index a14119c6e7..1d42cad71f 100644 --- a/.github/workflows/cypress-general-tests.yml +++ b/.github/workflows/cypress-general-tests.ym @@ -6,10 +6,10 @@ on: workflow_dispatch: jobs: - use-cypress-test-FeatureVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-FeatureVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testFeatureVersions.cy.js @@ -25,10 +25,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testFeatureVersions.cy.js.mp4 - use-cypress-test-RuntimeReleaseVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-RuntimeReleaseVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRuntimeReleaseVersions.cy.js @@ -44,10 +44,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRuntimeReleaseVersions.cy.js.mp4 - use-cypress-test-RedirectURLS: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-RedirectURLS: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRedirectURLs.cy.js @@ -63,10 +63,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 - use-cypress-test-StarterDefaults: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-StarterDefaults: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js From 5583b1ec8482aec8eeaf9bb16291dcab06dbc01e Mon Sep 17 00:00:00 2001 From: amyreit Date: Tue, 27 Jun 2023 11:58:58 -0500 Subject: [PATCH 09/30] Rename cypress-general-tests.ym to cypress-general-tests.yml --- .../{cypress-general-tests.ym => cypress-general-tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{cypress-general-tests.ym => cypress-general-tests.yml} (100%) diff --git a/.github/workflows/cypress-general-tests.ym b/.github/workflows/cypress-general-tests.yml similarity index 100% rename from .github/workflows/cypress-general-tests.ym rename to .github/workflows/cypress-general-tests.yml From 71050770b7b6440c94241999b16f92365a0f7506 Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Tue, 27 Jun 2023 13:47:43 -0500 Subject: [PATCH 10/30] fix comment --- src/main/content/_assets/js/builds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index dfc0466d41..31d0692e80 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -860,8 +860,8 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), - // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 + // Each group name package can contain letters (either lower or uppercase), + // numbers and underscores all separated by periods Eg: com.Acme.my_widget.v2 var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); From 53238c0a83b7d1d8d8b2933725d36923a53ab3b2 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:35:43 -0500 Subject: [PATCH 11/30] Revert "Fix comment for group" --- src/main/content/_assets/js/builds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 31d0692e80..dfc0466d41 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -860,8 +860,8 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Each group name package can contain letters (either lower or uppercase), - // numbers and underscores all separated by periods Eg: com.Acme.my_widget.v2 + // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), + // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); From 3e842257d354aa5d5786aa6cf7487193d4e1e09c Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:36:58 -0500 Subject: [PATCH 12/30] Revert "Update cypress-general-tests.yml " --- .github/workflows/cypress-general-tests.yml | 32 ++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cypress-general-tests.yml b/.github/workflows/cypress-general-tests.yml index 1d42cad71f..a14119c6e7 100644 --- a/.github/workflows/cypress-general-tests.yml +++ b/.github/workflows/cypress-general-tests.yml @@ -6,10 +6,10 @@ on: workflow_dispatch: jobs: - use-cypress-test-FeatureVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-FeatureVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testFeatureVersions.cy.js @@ -25,10 +25,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testFeatureVersions.cy.js.mp4 - use-cypress-test-RuntimeReleaseVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-RuntimeReleaseVersions: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRuntimeReleaseVersions.cy.js @@ -44,10 +44,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRuntimeReleaseVersions.cy.js.mp4 - use-cypress-test-RedirectURLS: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-RedirectURLS: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRedirectURLs.cy.js @@ -63,10 +63,10 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 - use-cypress-test-StarterDefaults: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: + use-cypress-test-StarterDefaults: + runs-on: ubuntu-latest + container: cypress/included:12.5.1 + steps: - uses: actions/checkout@v3.3.0 - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js From 5645442f094b10202bec28665c31ff8264c117fc Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:37:29 -0500 Subject: [PATCH 13/30] Revert "Change group rules" --- src/main/content/_assets/js/builds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index dfc0466d41..3e92acbc4a 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -839,7 +839,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for package names include a-z, A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' + '

Valid characters for the first package name include a-z. Subpackages also allow A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' ); } div.append(warning_icon).append(message); @@ -862,7 +862,7 @@ function add_invalid_message(field_id, valid) { function validate_group_name() { // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; + var valid_syntax = /^[a-z]+(\.[A-Za-z]\w*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From 05cc467b3c862dbb6966d2b90d1168611736fb74 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:38:04 -0500 Subject: [PATCH 14/30] Revert "Fixtypo" --- src/test/cypressjs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/cypressjs/README.md b/src/test/cypressjs/README.md index b888fb75d6..e6c33037c2 100644 --- a/src/test/cypressjs/README.md +++ b/src/test/cypressjs/README.md @@ -1,4 +1,4 @@ -# How to run [Cypress.io](https://www.cypress.io/) automated UI tests locally +# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locallly ## Step 1: First time setting up local environment with Cypress - Run `npm install` in the directory containing this `README.md` From 19b7629c6553c5b47097eccdcc31c67ae46b986f Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:38:28 -0500 Subject: [PATCH 15/30] Revert "Changing default test" --- ...eral-tests.yml => cypressgeneraltests.yml} | 22 +---------- src/test/cypressjs/README.md | 16 ++------ .../e2e/testOLStarterGradleDefaults.cy.js | 39 +++++++++++++++++++ ...cy.js => testOLStarterMavenDefaults.cy.js} | 17 +++++++- 4 files changed, 59 insertions(+), 35 deletions(-) rename .github/workflows/{cypress-general-tests.yml => cypressgeneraltests.yml} (75%) create mode 100644 src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js rename src/test/cypressjs/cypress/e2e/{testOLStarterDefaults.cy.js => testOLStarterMavenDefaults.cy.js} (54%) diff --git a/.github/workflows/cypress-general-tests.yml b/.github/workflows/cypressgeneraltests.yml similarity index 75% rename from .github/workflows/cypress-general-tests.yml rename to .github/workflows/cypressgeneraltests.yml index a14119c6e7..1a9427d9f6 100644 --- a/.github/workflows/cypress-general-tests.yml +++ b/.github/workflows/cypressgeneraltests.yml @@ -1,7 +1,7 @@ # This workflow will run the cypress tests that are unrelated to the downloading and # testing of the starter zip files -name: General Starter and Redirect Tests +name: Test Feature Versions RedirectURls and Runtime Release Versions on: workflow_dispatch: @@ -63,23 +63,3 @@ jobs: name: cypress-videos path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 - use-cypress-test-StarterDefaults: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: - - uses: actions/checkout@v3.3.0 - - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-screenshots - path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testOLStarterDefaults.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-videos - path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testOLStarterDefaults.cy.js.mp4 - - diff --git a/src/test/cypressjs/README.md b/src/test/cypressjs/README.md index e6c33037c2..c2d78ad485 100644 --- a/src/test/cypressjs/README.md +++ b/src/test/cypressjs/README.md @@ -1,13 +1,13 @@ -# How to run [Cypress.io](https://www.cypress.io/) automated UI tests Locallly +# How to run [Cypress.io](https://www.cypress.io/) automated UI tests ## Step 1: First time setting up local environment with Cypress - Run `npm install` in the directory containing this `README.md` - `node_modules` is created containing Cypress and its dependencies. ## Step 2: Setup URL you want the to test and the default java (2 options) - Update the value for `default_website_url` in `cypress.config.js` with target URL (usually either - the staging or production site). To execute the testOLStarterAll*.cy.js tests update the default java - and the location of the java levels on your local machine to the version you wish to test. + Update the value for `default_website_url` in `cypress.config.js` with target URL, update + the default_jdk with which java you want to test for tests that only test one, update the + locations of the java levels on your local machine NOTE - do not check in the cypress.config.js file with any changes for your local environment @@ -18,11 +18,3 @@ NOTE - do not check in the cypress.config.js file with any changes for your loca NOTE - the testOLStarterAllGradle.cy.js and cypress/e2e/testOLMavenAllGradle.cy.js tests use a lot of system memory and run more reliably headless - -# Alternatively - Run Tests with GitHub Actions In Git - -## Step 1: Go to https://github.com/OpenLiberty/openliberty.io/actions - Here you will see an action called 'General Starter and Redirect Tests'. This action will execute all of the tests in - the cypressjs/cypress/e2e directory with the exception of the testOLStarterAllMaven and testOLStarterAllGradle. These - two tests can be run from the starter repo - https://github.com/OpenLiberty/start.openliberty.io/actions. - diff --git a/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js b/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js new file mode 100644 index 0000000000..fdd5caa0c5 --- /dev/null +++ b/src/test/cypressjs/cypress/e2e/testOLStarterGradleDefaults.cy.js @@ -0,0 +1,39 @@ + +describe('Test Open Liberty Starter - Gradle Default EE and MP', () => { + + // Allow users to specify URL via variables found in cypress.env.json + // java home path for jdk17, jdk11, jdk8 can be change via cypress.env.json base on user env var + // this test will only download the starter for the default_jdk in that file + + const default_javahome = Cypress.env('jdk_11_home'); + const appname = "app-name-g-default"; + const downloadsFolder = Cypress.config('downloadsFolder'); + const eeDefault = "10.0"; + const mpDefault = "6.0" + const javaDefault = Cypress.env('default_jdk'); + + // tests + it('Default values for Open Liberty Starter', () => { + cy.goToOpenLibertyStarter(); + cy.get("#Starter_Base_Package").should("have.value", "com.demo"); + cy.get("#Starter_App_Name").should("have.value", "app-name"); + cy.get('#build_system_gradle').click(); + cy.get("#starter_section input[type=radio]:checked").should("have.value", "gradle"); + cy.get("#Starter_Java_Version").should("have.value", javaDefault); + cy.get("#Starter_Jakarta_Version").should("have.value", eeDefault); + cy.get("#Starter_MicroProfile_Version").should("have.value", mpDefault); + }); + + it('Test zip file is downloaded with default values', () => { + cy.exec(`rm -rf ${downloadsFolder}`, { failOnNonZeroExit: false }); + // download zip for the defaults + cy.log('appname ' + appname); + cy.log('javaLevel ' + javaDefault); + cy.goToOpenLibertyStarter(); + cy.downloadAndUnzipFile(appname, eeDefault, mpDefault,'g'); + cy.runGradlewLibertyDev(appname, default_javahome); + cy.checkLocalSplashPage(); + cy.runGradlewLibertyStop(appname, default_javahome); + }); + +}); \ No newline at end of file diff --git a/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js b/src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js similarity index 54% rename from src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js rename to src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js index 249b159497..7f5aa2100c 100644 --- a/src/test/cypressjs/cypress/e2e/testOLStarterDefaults.cy.js +++ b/src/test/cypressjs/cypress/e2e/testOLStarterMavenDefaults.cy.js @@ -1,7 +1,9 @@ describe('Test Open Liberty Starter - Maven Default EE and MP', () => { - // Test the default values for the starter - + // Allow users to specify URL via variables found in cypress.env.json + // java home path for jdk17, jdk11, jdk8 can be change via cypress.env.json base on user env var + // this test will only download the starter for the default_jdk in that file + const default_javahome = Cypress.env('jdk_11_home'); const appname = "app-name-m-default"; const downloadsFolder = Cypress.config('downloadsFolder'); @@ -20,4 +22,15 @@ describe('Test Open Liberty Starter - Maven Default EE and MP', () => { cy.get("#Starter_MicroProfile_Version").should("have.value", mpDefault); }); + it('Test zip file is downloaded with default values', () => { + cy.exec(`rm -rf ${downloadsFolder}`, { failOnNonZeroExit: false }); + // download zip for the defaults + cy.log('appname ' + appname); + cy.log('javaLevel ' + javaDefault); + cy.goToOpenLibertyStarter(); + cy.downloadAndUnzipFile(appname, eeDefault, mpDefault,'m'); + cy.runMVNWLibertyDev(appname, default_javahome); + cy.checkLocalSplashPage(); + cy.runMVNWLibertyStop(appname, default_javahome); + }); }); \ No newline at end of file From 7beb2eef1cc6f875b7bf87e41db7dcecd6cc4d2f Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:39:25 -0500 Subject: [PATCH 16/30] Revert "Create cypressgeneraltests.yml" --- .github/workflows/cypressgeneraltests.yml | 65 ----------------------- 1 file changed, 65 deletions(-) delete mode 100644 .github/workflows/cypressgeneraltests.yml diff --git a/.github/workflows/cypressgeneraltests.yml b/.github/workflows/cypressgeneraltests.yml deleted file mode 100644 index 1a9427d9f6..0000000000 --- a/.github/workflows/cypressgeneraltests.yml +++ /dev/null @@ -1,65 +0,0 @@ -# This workflow will run the cypress tests that are unrelated to the downloading and -# testing of the starter zip files - -name: Test Feature Versions RedirectURls and Runtime Release Versions -on: - workflow_dispatch: - -jobs: - use-cypress-test-FeatureVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: - - uses: actions/checkout@v3.3.0 - - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testFeatureVersions.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-screenshots - path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testFeatureVersions.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-videos - path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testFeatureVersions.cy.js.mp4 - - use-cypress-test-RuntimeReleaseVersions: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: - - uses: actions/checkout@v3.3.0 - - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRuntimeReleaseVersions.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-screenshots - path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testRuntimeReleaseVersions.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-videos - path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRuntimeReleaseVersions.cy.js.mp4 - - use-cypress-test-RedirectURLS: - runs-on: ubuntu-latest - container: cypress/included:12.5.1 - steps: - - uses: actions/checkout@v3.3.0 - - run: cypress run --browser chrome --env JDK_VERSION="${{ inputs.java_version }}" --config-file /__w/start.openliberty.io/start.openliberty.io/src/test/cypressjs/cypress.config.js --spec /__w/openliberty.io/openliberty.io/src/test/cypressjs/cypress/e2e/testRedirectURLs.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-screenshots - path: /__w/start.openliberty.io/start.openliberty.io/cypress/screenshots/testRedirectURLs.cy.js - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: cypress-videos - path: /__w/start.openliberty.io/start.openliberty.io/cypress/videos/testRedirectURLs.cy.js.mp4 - From 36049cd16eee987a6bc6915f41068632dab11f27 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:39:50 -0500 Subject: [PATCH 17/30] Revert "let draft site use the staging starter to avoid backports" --- src/main/content/_assets/js/builds.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 3e92acbc4a..9db10ba6f0 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -21,7 +21,7 @@ var versArr = []; var builds_url = '/api/builds/data'; var starter_domain = - isNotProdSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://start.openliberty.io'; + isStagingSite() ? 'https://starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud' : 'https://start.openliberty.io'; var starter_info_url = starter_domain + '/api/start/info'; var starter_submit_url = starter_domain + '/api/start'; var failed_builds_request = false; @@ -83,14 +83,9 @@ if (site_lang != 'en') { baseURL = '/'+site_lang; } -function isNotProdSite() { - // both staging and draft will point to the staging branch of the starter repo +function isStagingSite() { var host = window.location.hostname; - if ((host.indexOf('staging') > -1) || (host.indexOf('draft') > -1)) { - return true; - } else { - return false; - } + return host.indexOf('staging') > -1; } /** From ba0b7bc20fcf359f3519de2884318ff6ada5c8b0 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 12:40:31 -0500 Subject: [PATCH 18/30] Revert "135 group id rules" --- src/main/content/_assets/js/builds.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 9db10ba6f0..7c393d18c9 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -834,7 +834,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for the first package name include a-z. Subpackages also allow A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' + '

Valid characters include a-z separated by \'.\'

' ); } div.append(warning_icon).append(message); @@ -855,9 +855,7 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), - // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-z]+(\.[A-Za-z]\w*)+$/g; + var valid_syntax = /^([a-z]+\.)*[a-z]+$/g; // Starts with a lowercase char and only contains letters and periods. var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From 3cf578246b25d4b1c18da8a73e4579fa0eeb0d0d Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Wed, 28 Jun 2023 14:52:11 -0500 Subject: [PATCH 19/30] change allowed characters for group name --- src/main/content/_assets/js/builds.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 9db10ba6f0..fcd9147afb 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -834,8 +834,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for the first package name include a-z. Subpackages also allow A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' - ); + '

Valid characters for package names include a-z, A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' ); } div.append(warning_icon).append(message); $('.starter_field[data-starter-field=\'' + field_id + '\']').append( @@ -855,9 +854,9 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), - // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-z]+(\.[A-Za-z]\w*)+$/g; + // Each group name package can contain letters (either lower or uppercase), + // numbers and underscores all separated by periods Eg: com.Acme.my_widget.v2 + var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From 020a7d3862c30412bdc7c51408ad95db91436f06 Mon Sep 17 00:00:00 2001 From: amyreit Date: Wed, 28 Jun 2023 15:41:31 -0500 Subject: [PATCH 20/30] Revert "change allowed characters for group name" --- src/main/content/_assets/js/builds.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 71ca4b3234..535308621b 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -839,7 +839,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for package names include a-z, A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' + '

Valid characters include a-z separated by \'.\'

' ); } div.append(warning_icon).append(message); @@ -860,9 +860,7 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Each group name package can contain letters (either lower or uppercase), - // numbers and underscores all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; + var valid_syntax = /^([a-z]+\.)*[a-z]+$/g; // Starts with a lowercase char and only contains letters and periods. var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From 5422d95540214d629631a34b15f7aae14624c8e6 Mon Sep 17 00:00:00 2001 From: Amy Reitmeyer Date: Thu, 29 Jun 2023 13:55:58 -0500 Subject: [PATCH 21/30] added my code --- src/main/content/_assets/js/builds.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 9db10ba6f0..fb2ae2536f 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -834,7 +834,7 @@ function add_invalid_message(field_id, valid) { ); } else if (field_id == 'g') { message = $( - '

Valid characters for the first package name include a-z. Subpackages also allow A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' + '

Valid characters for package names include a-z, A-Z, \'_\' and 0-9. Packages must be separated by \'.\'

' ); } div.append(warning_icon).append(message); @@ -855,9 +855,9 @@ function add_invalid_message(field_id, valid) { // Base package name function validate_group_name() { - // Starts with a package of all lowercase char string and then contains letters (either lower or uppercase), - // numbers, underscores in other subpackages all separated by periods Eg: com.Acme.my_widget.v2 - var valid_syntax = /^[a-z]+(\.[A-Za-z]\w*)+$/g; + // Each group name package can contain letters (either lower or uppercase), + // numbers and underscores all separated by periods Eg: com.Acme.my_widget.v2 + var valid_syntax = /^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]*)+$/g; var value = $('.starter_field[data-starter-field=\'g\'] input').val(); var valid = value == '' ? false : valid_syntax.test(value); add_invalid_message('g', valid); From cf04f40b4cac4afc7d34b4cf937c80385cbc7564 Mon Sep 17 00:00:00 2001 From: natalie-bernhard <84740311+natalie-bernhard@users.noreply.github.com> Date: Thu, 20 Jul 2023 10:49:40 -0500 Subject: [PATCH 22/30] Revert "Update en.yml" --- src/main/content/_i18n/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/content/_i18n/en.yml b/src/main/content/_i18n/en.yml index aea947dfdc..97be7b1c30 100644 --- a/src/main/content/_i18n/en.yml +++ b/src/main/content/_i18n/en.yml @@ -233,7 +233,7 @@ guides: copied_to_clipboard: Copied to clipboard back_to_text: Back to text blog: - see_all_blog_posts: See all blog posts :) + see_all_blog_posts: See all blog posts never_miss_a_post: Never miss a post! be_sure_to_follow: Be sure to follow twitter_or_subscribe: on Twitter or subscribe to our From a5e8bd3bd6ae0db3be86bb4f1054ad209feaa914 Mon Sep 17 00:00:00 2001 From: natalie-bernhard <84740311+natalie-bernhard@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:32:19 -0500 Subject: [PATCH 23/30] Revert "Too many files workaround" --- docker/Dockerfile.demo | 2 -- docker/Dockerfile.draft | 2 -- docker/Dockerfile.prod | 2 -- docker/Dockerfile.staging | 2 -- docker/docs/Dockerfile.docs.draft | 2 -- docker/docs/Dockerfile.docs.staging | 2 -- scripts/build/docs_part_2.sh | 8 ++++++++ scripts/build/javadoc_modify.sh | 14 +++++++------- 8 files changed, 15 insertions(+), 19 deletions(-) diff --git a/docker/Dockerfile.demo b/docker/Dockerfile.demo index 931b7e7482..d6daae1694 100644 --- a/docker/Dockerfile.demo +++ b/docker/Dockerfile.demo @@ -61,8 +61,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime RUN configure.sh diff --git a/docker/Dockerfile.draft b/docker/Dockerfile.draft index e830d3d4de..88e6492626 100644 --- a/docker/Dockerfile.draft +++ b/docker/Dockerfile.draft @@ -62,8 +62,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime RUN configure.sh diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 72ec7a9b51..1402266a47 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -65,8 +65,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime ARG VERBOSE=true diff --git a/docker/Dockerfile.staging b/docker/Dockerfile.staging index 96963a0e1b..b61a9d9b93 100644 --- a/docker/Dockerfile.staging +++ b/docker/Dockerfile.staging @@ -62,8 +62,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime ARG VERBOSE=true diff --git a/docker/docs/Dockerfile.docs.draft b/docker/docs/Dockerfile.docs.draft index a2242367f6..82980ee1e1 100644 --- a/docker/docs/Dockerfile.docs.draft +++ b/docker/docs/Dockerfile.docs.draft @@ -66,8 +66,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime RUN configure.sh diff --git a/docker/docs/Dockerfile.docs.staging b/docker/docs/Dockerfile.docs.staging index c3838597b6..1d2cdd6c9f 100644 --- a/docker/docs/Dockerfile.docs.staging +++ b/docker/docs/Dockerfile.docs.staging @@ -66,8 +66,6 @@ RUN features.sh COPY --from=war --chown=1001:0 target/openliberty-website-1.0-SNAPSHOT /config/apps/openliberty.war -COPY --from=docs --chown=1001:0 src/main/content/docs-javadoc/modules /config/apps/openliberty.war/docs - # This script will add the requested server configurations, apply any interim fixes and populate caches to # optimize runtime RUN configure.sh diff --git a/scripts/build/docs_part_2.sh b/scripts/build/docs_part_2.sh index ec26a6caea..c2940649c8 100755 --- a/scripts/build/docs_part_2.sh +++ b/scripts/build/docs_part_2.sh @@ -11,6 +11,14 @@ echo "Total execution time for parsing the features toc: '$(date -u --date @$(( echo "Begin building javadoc content" $BUILD_SCRIPTS_DIR/javadoc_clone.sh +# Move the javadocs into the web app +echo "Moving javadocs to the jekyll webapp" +timer_start=$(date +%s) +cp -r src/main/content/docs-javadoc/modules target/jekyll-webapp/docs +timer_end=$(date +%s) +echo "Total execution time for copying javadoc to webapp: '$(date -u --date @$(( $timer_end - $timer_start )) +%H:%M:%S)'" + + # Special handling for javadocs $BUILD_SCRIPTS_DIR/javadoc_modify.sh diff --git a/scripts/build/javadoc_modify.sh b/scripts/build/javadoc_modify.sh index 94eebd5561..611036ff00 100755 --- a/scripts/build/javadoc_modify.sh +++ b/scripts/build/javadoc_modify.sh @@ -41,12 +41,12 @@ export -f modifyStylesheetFrameless export -f modifySearch export -f modifyRedirect -find src/main/content/docs-javadoc/modules -path "*microprofile*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; -find src/main/content/docs-javadoc/modules -path "*liberty-*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; -find src/main/content/docs-javadoc/modules -path "*io.openliberty*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; -find src/main/content/docs-javadoc/modules -path "*com.ibm.websphere.appserver*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; -find src/main/content/docs-javadoc/modules -name search.js -exec bash -c 'modifySearch {}' \; -find src/main/content/docs-javadoc/modules -name script.js -exec bash -c 'modifyRedirect {}' \; +find target/jekyll-webapp/docs -path "*microprofile*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; +find target/jekyll-webapp/docs -path "*liberty-*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; +find target/jekyll-webapp/docs -path "*io.openliberty*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; +find target/jekyll-webapp/docs -path "*com.ibm.websphere.appserver*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; +find target/jekyll-webapp/docs -name search.js -exec bash -c 'modifySearch {}' \; +find target/jekyll-webapp/docs -name script.js -exec bash -c 'modifyRedirect {}' \; timer_end=$(date +%s) -echo "Total execution time for modifying the javadoc: '$(date -u --date @$(( $timer_end - $timer_start )) +%H:%M:%S)'" +echo "Total execution time for modifying the javadoc: '$(date -u --date @$(( $timer_end - $timer_start )) +%H:%M:%S)'" \ No newline at end of file From f38095b3a1d08a64ef3859ebeef7438d53a0dc54 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Fri, 13 Oct 2023 12:29:45 +0530 Subject: [PATCH 24/30] Edited homepage --- src/main/content/_assets/css/home.scss | 5 +++ src/main/content/index.html | 61 ++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/main/content/_assets/css/home.scss b/src/main/content/_assets/css/home.scss index e0c6dc8f9a..d176e27bad 100644 --- a/src/main/content/_assets/css/home.scss +++ b/src/main/content/_assets/css/home.scss @@ -595,6 +595,11 @@ body { background: #ffffff; margin-bottom: 18px; } + +#blog_col { + flex:50%, +} + .blog_post_title{ &:hover { .blog_post_title_link{ diff --git a/src/main/content/index.html b/src/main/content/index.html index 79956947c6..89b8f06d34 100644 --- a/src/main/content/index.html +++ b/src/main/content/index.html @@ -215,8 +215,9 @@

{% t home.openlibery_opensource_community_title %}

{% t home.openliberty_news %}

{% t home.openliberty_news_text %}

-
-
+ +
+
{% for post in site.posts limit:1 %} {% if post.redirect_link %}

{{ post.title | escape }} @@ -264,10 +265,64 @@

{% t home.link_to_blog_post %}

+ +
+
+ {% for post in site.posts limit:1 %} + {% if post.redirect_link %} +

{{ post.title | escape }} + + + {% assign continue_text = ' [Continued on ' %} + {% assign domain_name = post.redirect_link | remove: "https://" | remove: "http://" | remove: "www." | append: "]" %} + {{ continue_text | append: domain_name }} + + +

+ {% else %} +

{{ post.title | escape }}

+ {% endif %} + + {% assign additional_author_count = 0 %} + {% for author in post.additional_authors %} + {% assign additional_author_count = additional_author_count | plus: 1 %} + {% endfor %} + + +

+ {% if post.blog_description %} + {{ post.blog_description }} + {% else %} + {{ post.content | strip_html | truncatewords: 60 }} + {% endif %} +

+ {% endfor %} + View all release blog posts +
+
From bfff6e10b505ccc724d43edb79f6144ed4274887 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Fri, 13 Oct 2023 20:55:16 +0530 Subject: [PATCH 25/30] Added 2 blogs in home --- src/main/content/index.html | 174 +++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 82 deletions(-) diff --git a/src/main/content/index.html b/src/main/content/index.html index 89b8f06d34..635183f210 100644 --- a/src/main/content/index.html +++ b/src/main/content/index.html @@ -218,107 +218,117 @@

{% t home.openliberty_news %}

- {% for post in site.posts limit:1 %} - {% if post.redirect_link %} -

{{ post.title | escape }} - - - {% assign continue_text = ' [Continued on ' %} - {% assign domain_name = post.redirect_link | remove: "https://" | remove: "http://" | remove: "www." | append: "]" %} - {{ continue_text | append: domain_name }} - - -

+ {% for post in site.posts %} + {% if post.tags contains "release" %} + {% continue %} {% else %} -

{{ post.title | escape }}

- {% endif %} + {% if post.redirect_link %} +

{{ post.title | escape }} + + + {% assign continue_text = ' [Continued on ' %} + {% assign domain_name = post.redirect_link | remove: "https://" | remove: "http://" | remove: "www." | append: "]" %} + {{ continue_text | append: domain_name }} + + +

+ {% else %} +

{{ post.title | escape }}

+ {% endif %} - {% assign additional_author_count = 0 %} - {% for author in post.additional_authors %} - {% assign additional_author_count = additional_author_count | plus: 1 %} - {% endfor %} -
- {% for post in site.posts limit:1 %} - {% if post.redirect_link %} -

{{ post.title | escape }} - - - {% assign continue_text = ' [Continued on ' %} - {% assign domain_name = post.redirect_link | remove: "https://" | remove: "http://" | remove: "www." | append: "]" %} - {{ continue_text | append: domain_name }} - - -

- {% else %} -

{{ post.title | escape }}

- {% endif %} + {% for post in site.posts %} + {% if post.tags contains "release" %} + {% if post.redirect_link %} +

{{ post.title | escape }} + + + {% assign continue_text = ' [Continued on ' %} + {% assign domain_name = post.redirect_link | remove: "https://" | remove: "http://" | remove: "www." | append: "]" %} + {{ continue_text | append: domain_name }} + + +

+ {% else %} +

{{ post.title | escape }}

+ {% endif %} - {% assign additional_author_count = 0 %} - {% for author in post.additional_authors %} - {% assign additional_author_count = additional_author_count | plus: 1 %} - {% endfor %} - From 70b4e9892c3d3f4474e9d733a294fd89c1bb79b3 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Mon, 16 Oct 2023 12:31:45 +0530 Subject: [PATCH 26/30] Edited duplicate id --- src/main/content/_assets/css/home.scss | 4 ---- src/main/content/index.html | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/content/_assets/css/home.scss b/src/main/content/_assets/css/home.scss index d176e27bad..2e905af9ff 100644 --- a/src/main/content/_assets/css/home.scss +++ b/src/main/content/_assets/css/home.scss @@ -596,10 +596,6 @@ body { margin-bottom: 18px; } -#blog_col { - flex:50%, -} - .blog_post_title{ &:hover { .blog_post_title_link{ diff --git a/src/main/content/index.html b/src/main/content/index.html index 635183f210..7413fcdbad 100644 --- a/src/main/content/index.html +++ b/src/main/content/index.html @@ -216,7 +216,7 @@

{% t home.openliberty_news %}

{% t home.openliberty_news_text %}

-
+
{% for post in site.posts %} {% if post.tags contains "release" %} @@ -275,7 +275,7 @@

+
{% for post in site.posts %} {% if post.tags contains "release" %} From a60b8fa35723571c7d1db7d9590fac40ec7731af Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Mon, 16 Oct 2023 22:28:28 +0530 Subject: [PATCH 27/30] Removed blog_col --- src/main/content/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/content/index.html b/src/main/content/index.html index 7413fcdbad..c3d082f172 100644 --- a/src/main/content/index.html +++ b/src/main/content/index.html @@ -216,7 +216,7 @@

{% t home.openliberty_news %}

{% t home.openliberty_news_text %}

-
+ @@ -162,7 +162,7 @@

{% t start.get_OL_section_title %}

Copied to clipboard
-
<dependency>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>[19.0.0.9,)</version>
<type>zip</type>
</dependency>
+
<dependency>
<groupId>io.openliberty</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>[19.0.0.9,)</version>
<type>zip</type>
</dependency>

{% t start.find_out %} {% t start.how_to_use_maven %} @@ -212,15 +212,15 @@

{% t start.ide_tools.section_title %}

From 1502c159fa46c25063400c11200eeaeaaaf6fba0 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Tue, 17 Oct 2023 15:59:29 +0530 Subject: [PATCH 29/30] fixed accessibility errors in contribute --- src/main/content/contribute.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/content/contribute.html b/src/main/content/contribute.html index 5d360588fb..5f239d2ced 100644 --- a/src/main/content/contribute.html +++ b/src/main/content/contribute.html @@ -78,8 +78,8 @@

{% t contribute.fix_a_bug %}

- - + +

From 5d6407b21e857c22c933bb5c66e8567553707d97 Mon Sep 17 00:00:00 2001 From: natalie-bernhard Date: Tue, 17 Oct 2023 10:33:26 -0500 Subject: [PATCH 30/30] open pem file in new tab --- src/main/content/_assets/js/builds.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/content/_assets/js/builds.js b/src/main/content/_assets/js/builds.js index 8ebf9a4424..1b53827dd9 100644 --- a/src/main/content/_assets/js/builds.js +++ b/src/main/content/_assets/js/builds.js @@ -309,7 +309,7 @@ function render_builds(builds, parent) { var verification_column2 = $( '' + // Optional sig file download button - (sig_href ? '' + download_arrow +'PEM' : '' ) + + (sig_href ? '' + download_arrow +'PEM' : '' ) + '' ); @@ -1091,7 +1091,10 @@ function validate_starter_inputs(event) { } } -function displayMessage(message,javaMsg = false) { +function displayMessage(message,javaMsg) { + if(!javaMsg){ + javaMsg = false; + } // Display a message when MP/Jakarta EE Version get changed. var close_icon = $( '\'Close\''