Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(dev,proxy,prod): ent-3643 chrome local run, proxy, build #753

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented Jul 30, 2021

What's included

  • build(testing): ent-3643 standalone tests
  • build(dev,proxy,prod): ent-3643 chrome local run, proxy, build
    • babel, moved to independent config from package
    • build, empty module, plugins for html, dotenv replace
    • cspell, ouia keyword added
    • docs, local run descriptions, debugging updated
    • dotenv, locale path, port, build branch
    • eslint, json extensions are now required
    • jest, adjust coverage based on fed mod file adds
    • public, index.html apply esi instead of dotenv params
    • scripts, remove original dev chrome, clean up post, proxy
    • spandx, proxy routing clean up
    • src, fed module file adds, component dev checks removed
    • tests, integration-like tests updated
    • webpack, dev, proxy, prod configs

Notes

  • QE @mirekdlugosz
    • The output will need confirmation once we're in the beta environments, we'll keep you updated!
    • The proxy config we used for getting spandx up and running under the old docker proxy setup has been dramatically scaled down, if we need to adjust it let us know.
  • Platform @Hyperkid123
    • In order to get everything running we ended up having to disable Chrome 2 via the skipChrome2 flag for our two development webpack aspects, noted below in the PR review/comments.
  • Base implementation of updated platform chroming
    • local run with mocks now has left navigation
    • proxy run is now a little bit faster
    • build output is also a little bit faster

How to test

Coverage and basic unit test check

  1. update the NPM packages with $ yarn
  2. $ yarn test
  3. confirm all tests pass

Local run check

  1. confirm the repo directory name as no spaces in it, Docker has issues with strings that aren't escaped properly
  2. update the NPM packages with $ yarn
  3. $ yarn start
  4. confirm the application is accessible at http://localhost:3000/insights/subscriptions/
    • you may need to follow the setup directions here if you're doing a clean install... basically create a .env.local file in the root of the project and add the following params
       REACT_APP_DEBUG_MIDDLEWARE=true
       REACT_APP_DEBUG_ORG_ADMIN=true
       REACT_APP_DEBUG_PERMISSION_APP_ONE=subscriptions:*:*
       REACT_APP_DEBUG_PERMISSION_APP_TWO=inventory:*:*
    

Proxy run check

  1. confirm the repo directory name as no spaces in it, Docker has issues with strings that aren't escaped properly
  2. update the NPM packages with $ yarn
  3. make sure Docker is running, plus on network, then
  4. $ yarn start:proxy
  5. confirm the application is accessible at https://ci.foo.redhat.com/insights/subscriptions/

Check the build

  1. update the NPM packages with $ yarn
  2. $ yarn build
  3. confirm integration-like tests pass

Example

...

Updates issue/story

ent-3643
ent-3642

@cdcabrera cdcabrera added 202108 project phase story New feature, or process work tech debt We've ignored it this long... labels Jul 30, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2021

Codecov Report

Merging #753 (320db77) into ci (4126a4f) will decrease coverage by 0.07%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##               ci     #753      +/-   ##
==========================================
- Coverage   95.29%   95.21%   -0.08%     
==========================================
  Files         100      101       +1     
  Lines        2824     2823       -1     
  Branches     1027     1024       -3     
==========================================
- Hits         2691     2688       -3     
- Misses        126      128       +2     
  Partials        7        7              
Impacted Files Coverage Δ
src/AppEntry.js 0.00% <0.00%> (ø)
src/config/index.js 100.00% <ø> (ø)
src/components/authentication/authentication.js 73.17% <62.50%> (-0.64%) ⬇️
src/components/router/routerHelpers.js 100.00% <100.00%> (ø)
src/hooks/useRouter.js 100.00% <100.00%> (ø)
src/services/platformServices.js 97.61% <100.00%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4126a4f...320db77. Read the comment docs.

@Hyperkid123
Copy link
Contributor

@cdcabrera I was able to run the application in chrome 2 mode using this changes in CSC:

diff --git a/chrome/fed-modules.json b/chrome/fed-modules.json
index 5ffcd23..a3f4085 100644
--- a/chrome/fed-modules.json
+++ b/chrome/fed-modules.json
@@ -141,11 +141,7 @@
                 "id": "openshift",
                 "module": "./RootApp",
                 "routes": [
-                    "/openshift",
-                    {
-                        "pathname": "/openshift/subscriptions",
-                        "dynamic": false
-                    }
+                    "/openshift"
                 ]
             }
         ]
@@ -272,24 +268,20 @@
         ]
     },
     "subscriptions": {
-        "dynamic": false,
+        "manifestLocation": "/apps/subscriptions/fed-mods.json",
         "modules": [
             {
                 "id": "insights-subscriptions",
+                "module": "./RootApp",
                 "routes": [
-                    {
-                        "pathname": "/insights/subscriptions",
-                        "dynamic": false
-                    }
+                    "/insights/subscriptions"
                 ]
             },
             {
                 "id": "openshift-subscriptions",
+                "module": "./RootApp",
                 "routes": [
-                    {
-                        "pathname": "/openshift/subscriptions",
-                        "dynamic": false
-                    }
+                    "/openshift/subscriptions"
                 ]
             }
         ]

Obviously, you also have to remove the skipChrome2 flag in your config.

cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Jul 30, 2021
…tInsights#753)

* babel, moved to independent config from package
* build, empty module, plugins for html, dotenv replace
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
…tInsights#753)

* babel, moved to independent config from package
* build, empty module, plugins for html, dotenv replace
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
@cdcabrera cdcabrera merged commit c87f6cc into RedHatInsights:ci Jul 30, 2021
cdcabrera added a commit that referenced this pull request Jul 30, 2021
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Jul 30, 2021
@cdcabrera
Copy link
Member Author

reopening as PR #756

cdcabrera added a commit that referenced this pull request Aug 3, 2021
cdcabrera added a commit that referenced this pull request Aug 3, 2021
* babel, moved to independent config from package
* build, empty module, plugins for html, dotenv replace
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 3, 2021
cdcabrera added a commit that referenced this pull request Aug 3, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 4, 2021
cdcabrera added a commit that referenced this pull request Aug 4, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 5, 2021
cdcabrera added a commit that referenced this pull request Aug 5, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 9, 2021
cdcabrera added a commit that referenced this pull request Aug 9, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 9, 2021
cdcabrera added a commit that referenced this pull request Aug 9, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 10, 2021
cdcabrera added a commit that referenced this pull request Aug 10, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
cdcabrera added a commit that referenced this pull request Aug 10, 2021
cdcabrera added a commit that referenced this pull request Aug 10, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
This was referenced Aug 10, 2021
cdcabrera added a commit that referenced this pull request Aug 17, 2021
cdcabrera added a commit that referenced this pull request Aug 17, 2021
* babel, moved to independent config from package
* build, empty module, html plugins, dotenv replace, travis
* cspell, ouia keyword added
* docs, local run descriptions, debugging updated
* dotenv, locale path, port, build branch
* eslint, json extensions are now required
* jest, adjust coverage based on fed mod file adds
* public, index.html apply esi instead of dotenv params
* scripts, remove original dev chrome, clean up post, proxy
* spandx, proxy routing clean up
* src, fed module file adds, component dev checks removed
* tests, integration-like tests updated
* webpack, dev, proxy, prod configs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
202108 project phase story New feature, or process work tech debt We've ignored it this long...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants