From 9dc5584ca52b311454b521c2e5fc9f9c7351f8b7 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 12:54:22 +0300 Subject: [PATCH 1/7] Updating ohri esms to publish (npmjs) a package tagged for staging env, This tag comes from the current state of the branch --- .github/workflows/node.working.js.yml | 84 +++++++++++++++++++++++++- frontend/spa-build-config.json | 85 ++++++++++++++------------- package.json | 1 + 3 files changed, 127 insertions(+), 43 deletions(-) diff --git a/.github/workflows/node.working.js.yml b/.github/workflows/node.working.js.yml index e1fbef549..6192002d1 100644 --- a/.github/workflows/node.working.js.yml +++ b/.github/workflows/node.working.js.yml @@ -1,4 +1,4 @@ -name: OHRI CI - @esm and Docker Image +name: OHRI CI - @esm and Docker Image Working/QA on: push: @@ -11,8 +11,88 @@ on: types: [opened, synchronize] jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Cache dependencies + id: cache + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --immutable + + - name: Run tests + run: yarn run test + + - name: Run build + run: yarn turbo run build --color --concurrency=5 --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}" + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: packages + path: | + packages/**/dist + + qa: + runs-on: ubuntu-latest + needs: build + + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/working' }} + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Cache dependencies + id: cache + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --immutable + + - name: Version + run: yarn workspaces foreach --worktree --topological --exclude @ohri/openmrs-esm-ohri version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" + + - name: Build + run: yarn turbo run build --color --concurrency=5 + + - name: qa + run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn run ci:qa + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: packages + path: | + packages/**/dist + docker_workingserver_frontend: runs-on: ubuntu-latest + needs: qa steps: - name: Wait for 5 min - Let @esms reflect on NPM registry @@ -37,7 +117,7 @@ jobs: file: ./frontend/Dockerfile platforms: linux/amd64,linux/arm64 push: ${{ github.event_name != 'pull_request' }} - tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:next,${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:ci_${{ github.run_number }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:qa,${{ secrets.DOCKERHUB_USERNAME }}/ohri-working-frontend:ci_${{ github.run_number }} cache-from: type=inline,ref=user/app:buildcache cache-to: type=inline,ref=user/app:buildcache,mode=max diff --git a/frontend/spa-build-config.json b/frontend/spa-build-config.json index 35a595280..e2b2a8179 100644 --- a/frontend/spa-build-config.json +++ b/frontend/spa-build-config.json @@ -1,46 +1,49 @@ { "frontendModules": { - "@openmrs/esm-devtools-app": "5.3.3-pre.1301", - "@openmrs/esm-implementer-tools-app": "5.3.3-pre.1301", - "@openmrs/esm-login-app": "5.3.3-pre.1301", - "@openmrs/esm-primary-navigation-app": "5.3.3-pre.1301", - "@openmrs/esm-home-app": "5.2.1-pre.305", - "@openmrs/esm-form-entry-app": "6.1.1-pre.3293", - "@openmrs/esm-generic-patient-widgets-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-allergies-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-appointments-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-attachments-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-banner-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-chart-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-conditions-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-forms-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-flags-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-labs-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-lists-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-medications-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-notes-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-orders-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-programs-app": "6.1.1-pre.3293", - "@openmrs/esm-patient-vitals-app": "6.1.1-pre.3293", - "@openmrs/esm-active-visits-app": "5.2.2-pre.2432", - "@openmrs/esm-appointments-app": "5.2.2-pre.2432", - "@openmrs/esm-service-queues-app": "5.2.2-pre.2432", - "@openmrs/esm-patient-list-management-app": "5.2.2-pre.2432", - "@openmrs/esm-patient-registration-app": "5.2.2-pre.2432", - "@openmrs/esm-patient-search-app": "5.2.2-pre.2432", - "@openmrs/esm-openconceptlab-app": "4.0.2-pre.88", - "@openmrs/esm-system-admin-app": "4.0.2-pre.88", - "@openmrs/esm-dispensing-app": "1.2.2-pre.256", - "@openmrs/esm-fast-data-entry-app": "1.0.1-pre.117", - "@openmrs/esm-cohort-builder-app": "3.0.1-pre.183", - "@openmrs/esm-form-builder-app": "2.2.2-pre.654", - "@ohri/openmrs-esm-ohri-core-app": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-hiv-app": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-covid-app": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-pmtct": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-tb-app": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-cervical-cancer-app": "2.1.0-pre.3192", - "@ohri/openmrs-esm-ohri-form-render-app": "2.1.0-pre.3192" + "@openmrs/esm-devtools-app": "next", + "@openmrs/esm-implementer-tools-app": "next", + "@openmrs/esm-login-app": "next", + "@openmrs/esm-primary-navigation-app": "next", + "@openmrs/esm-home-app": "next", + "@openmrs/esm-form-engine-app": "next", + "@openmrs/esm-generic-patient-widgets-app": "next", + "@openmrs/esm-patient-allergies-app": "next", + "@openmrs/esm-patient-attachments-app": "next", + "@openmrs/esm-patient-banner-app": "next", + "@ohri/esm-patient-chart-app": "next", + "@openmrs/esm-patient-conditions-app": "next", + "@openmrs/esm-patient-forms-app": "next", + "@openmrs/esm-patient-flags-app": "next", + "@openmrs/esm-patient-labs-app": "next", + "@openmrs/esm-patient-lists-app": "next", + "@openmrs/esm-patient-medications-app": "next", + "@openmrs/esm-patient-notes-app": "next", + "@openmrs/esm-patient-orders-app": "next", + "@openmrs/esm-patient-programs-app": "next", + "@openmrs/esm-patient-vitals-app": "next", + "@openmrs/esm-active-visits-app": "next", + "@openmrs/esm-appointments-app": "next", + "@openmrs/esm-service-queues-app": "next", + "@openmrs/esm-patient-list-management-app": "next", + "@openmrs/esm-patient-registration-app": "next", + "@openmrs/esm-patient-search-app": "next", + "@openmrs/esm-openconceptlab-app": "next", + "@openmrs/esm-system-admin-app": "next", + "@openmrs/esm-dispensing-app": "next", + "@openmrs/esm-fast-data-entry-app": "next", + "@openmrs/esm-cohort-builder-app": "next", + "@ohri/openmrs-esm-ohri-core-app": "qa", + "@ohri/openmrs-esm-ohri-hiv-care-treatment-app": "qa", + "@ohri/openmrs-esm-ohri-hiv-prevention-app": "qa", + "@ohri/openmrs-esm-ohri-covid-app": "qa", + "@ohri/openmrs-esm-ohri-pmtct-app": "qa", + "@ohri/openmrs-esm-ohri-tb-app": "qa", + "@ohri/openmrs-esm-ohri-cervical-cancer-app": "qa", + "@ohri/openmrs-esm-ohri-form-render-app": "qa", + "@openmrs/esm-stock-management-app": "next", + "@openmrs/esm-billing-app": "next", + "@ohri/openmrs-esm-ohri-opd-app": "qa", + "@openmrs/esm-form-builder-app": "next" }, "spaPath": "$SPA_PATH", "apiUrl": "$API_URL", diff --git a/package.json b/package.json index c47927628..0c7b21bef 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "verify": "turbo run lint && turbo run typescript && yarn test --coverage", "ci:prepublish": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag next", "ci:publish": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag latest", + "ci:qa": "yarn workspaces foreach --all --topological --exclude @ohri/openmrs-esm-ohri npm publish --access public --tag qa", "release": "yarn workspaces foreach --all --topological version", "coverage": "yarn test --coverage", "badges": "yarn coverage && yarn jest-coverage-badges --output './badges' ", From 9537ae82c1ddcbe0c998c79f879a1acc9e435e5d Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 13:12:50 +0300 Subject: [PATCH 2/7] Removing duplicate tbPreventionDashboardMeta in packages/esm-tb-app/src/dashboard.meta.tsx --- packages/esm-tb-app/src/dashboard.meta.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/esm-tb-app/src/dashboard.meta.tsx b/packages/esm-tb-app/src/dashboard.meta.tsx index 4d3d5ea58..e387cbc50 100644 --- a/packages/esm-tb-app/src/dashboard.meta.tsx +++ b/packages/esm-tb-app/src/dashboard.meta.tsx @@ -44,12 +44,6 @@ export const tbClinicalViewDashboardMeta = { isFolder: true, title: 'Tuberculosis', }; -export const tbPreventionDashboardMeta = { - name: 'tb-prevention', - slot: 'tb-prevention-dashboard-slot', - config: { columns: 1, type: 'grid', programme: 'tpt', dashboardTitle: 'TB Prevention'}, - title: 'TB Prevention', -}; export const tbPreventionDashboardMeta = { name: 'tb-prevention', From 41bc8c93f91fe0022d17791fd7dc1cebdb49f507 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 13:33:56 +0300 Subject: [PATCH 3/7] Updating workflow --- .github/workflows/node.working.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.working.js.yml b/.github/workflows/node.working.js.yml index 6192002d1..cd3029bf4 100644 --- a/.github/workflows/node.working.js.yml +++ b/.github/workflows/node.working.js.yml @@ -73,7 +73,7 @@ jobs: run: yarn install --immutable - name: Version - run: yarn workspaces foreach --worktree --topological --exclude @ohri/openmrs-esm-ohri version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-pre.${{ github.run_number }}" + run: yarn workspaces foreach --worktree --topological --exclude @ohri/openmrs-esm-ohri version "$(node -e "console.log(require('semver').inc(require('./package.json').version, 'patch'))")-qa.${{ github.run_number }}" - name: Build run: yarn turbo run build --color --concurrency=5 From ff7fc01bc71f302b7b79c63480cef25d3c704649 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 14:04:16 +0300 Subject: [PATCH 4/7] Updating changesetBaseRefs to include working --- .yarnrc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.yarnrc.yml b/.yarnrc.yml index 5ce885524..93a28075a 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -16,4 +16,7 @@ changesetBaseRefs: [ "dev", "origin/dev", "upstream/dev", + "working", + "origin/working", + "upstream/working", ] From 4bd90d0cca8fb40ba7feb560bb3159911111c8a2 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 14:27:22 +0300 Subject: [PATCH 5/7] Updated spa assemble - hivv packages have not been split in working branch --- frontend/spa-build-config.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/spa-build-config.json b/frontend/spa-build-config.json index e2b2a8179..580b38d98 100644 --- a/frontend/spa-build-config.json +++ b/frontend/spa-build-config.json @@ -33,8 +33,7 @@ "@openmrs/esm-fast-data-entry-app": "next", "@openmrs/esm-cohort-builder-app": "next", "@ohri/openmrs-esm-ohri-core-app": "qa", - "@ohri/openmrs-esm-ohri-hiv-care-treatment-app": "qa", - "@ohri/openmrs-esm-ohri-hiv-prevention-app": "qa", + "@ohri/openmrs-esm-ohri-hiv-app": "qa", "@ohri/openmrs-esm-ohri-covid-app": "qa", "@ohri/openmrs-esm-ohri-pmtct-app": "qa", "@ohri/openmrs-esm-ohri-tb-app": "qa", From 79d713dc4cc3b0814eb7709b85567b244ffd7e35 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 14:51:29 +0300 Subject: [PATCH 6/7] Update packages/esm-ohri-pmtct-app/package.json name from @ohri/openmrs-esm-ohri-pmtct to @ohri/openmrs-esm-ohri-pmtct-app --- packages/esm-ohri-pmtct-app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/esm-ohri-pmtct-app/package.json b/packages/esm-ohri-pmtct-app/package.json index 8d1515735..0412ae703 100644 --- a/packages/esm-ohri-pmtct-app/package.json +++ b/packages/esm-ohri-pmtct-app/package.json @@ -1,5 +1,5 @@ { - "name": "@ohri/openmrs-esm-ohri-pmtct", + "name": "@ohri/openmrs-esm-ohri-pmtct-app", "version": "2.3.3", "description": "PMTCT microfrontend for OpenMRS HIV Reference Implementation (OHRI)", "browser": "dist/ohri-pmtct-app.js", From 287f6626a41a870f2cde839e4c817d66682869d8 Mon Sep 17 00:00:00 2001 From: Amos Laboso Date: Fri, 14 Jun 2024 14:53:26 +0300 Subject: [PATCH 7/7] Update yarn lock file to reflect renaming of pmtct app --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6c60ef592..32b966715 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2869,9 +2869,9 @@ __metadata: languageName: unknown linkType: soft -"@ohri/openmrs-esm-ohri-pmtct@workspace:packages/esm-ohri-pmtct-app": +"@ohri/openmrs-esm-ohri-pmtct-app@workspace:packages/esm-ohri-pmtct-app": version: 0.0.0-use.local - resolution: "@ohri/openmrs-esm-ohri-pmtct@workspace:packages/esm-ohri-pmtct-app" + resolution: "@ohri/openmrs-esm-ohri-pmtct-app@workspace:packages/esm-ohri-pmtct-app" dependencies: "@carbon/react": "npm:^1.13.0" webpack: "npm:^5.88.2"