From 603c8d05b41b161dd7da2f5bd17420739f78ad6a Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Thu, 5 Mar 2026 17:29:10 +0530 Subject: [PATCH 01/14] chore: update buildpacks and add nginx configuration (#3807) * chore: update buildpacks and add nginx configuration * chore: update nginx buildpack URL to the official repository * chore: add initial nginx configuration file * chore: remove nginx buildpack and add Procfile for serving the application * chore: remove nginx configuration file * chore: add cypress staging integration testing workflow * chore: update cypress staging workflow to trigger on labeled pull requests * chore: update cypress staging workflow to checkout the correct branch and add backend URL * chore: update buildpacks, configure NGINX, and remove static.json * chore: remove git checkout command for unified_assistant in cypress setup * chore: remove cypress staging integration testing workflow --- .buildpacks | 3 +-- Procfile | 1 + config/nginx.conf.erb | 35 +++++++++++++++++++++++++++++++++++ static.json | 16 ---------------- 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 Procfile create mode 100644 config/nginx.conf.erb delete mode 100644 static.json diff --git a/.buildpacks b/.buildpacks index 13b8dbf8d2..1a1690f082 100644 --- a/.buildpacks +++ b/.buildpacks @@ -1,3 +1,2 @@ https://github.com/heroku/heroku-buildpack-nodejs.git#v183 -https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0 -https://github.com/heroku/heroku-buildpack-static.git#v5 \ No newline at end of file +https://github.com/heroku/heroku-buildpack-nginx.git \ No newline at end of file diff --git a/Procfile b/Procfile new file mode 100644 index 0000000000..c7330c9f83 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bin/start-nginx diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb new file mode 100644 index 0000000000..4bf1043231 --- /dev/null +++ b/config/nginx.conf.erb @@ -0,0 +1,35 @@ +daemon off; + +worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; + +events { + use epoll; + accept_mutex on; + worker_connections 1024; +} + +http { + include mime.types; + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + server { + listen <%= ENV['PORT'] %>; + root /app/build; + index index.html; + + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header X-Frame-Options "deny" always; + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always; + add_header Content-Security-Policy "default-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; script-src-elem 'self' 'unsafe-inline' https://www.google.com https://www.gstatic.com https://js.stripe.com; frame-src 'self' https://js.stripe.com https://www.canva.com https://www.google.com https://www.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src *;" always; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/static.json b/static.json deleted file mode 100644 index 9895b628d7..0000000000 --- a/static.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "root": "build/", - "routes": { - "/**": "index.html" - }, - "https_only": true, - "headers": { - "/**": { - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "X-Frame-Options": "deny", - "Content-Security-Policy": "default-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; script-src-elem 'self' 'unsafe-inline' https://www.google.com https://www.gstatic.com https://js.stripe.com; frame-src 'self' https://js.stripe.com https://www.canva.com https://www.google.com https://www.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src *;", - "Strict-Transport-Security": "max-age=63072000; includeSubdomains; preload" - } - } -} From eb709223851774102cf8815d2c91cea65b971732 Mon Sep 17 00:00:00 2001 From: Shijith Karumathil Date: Thu, 5 Mar 2026 21:59:29 +0530 Subject: [PATCH 02/14] Handling null message body (#3809) * fix: :bug: Add optional chaining to prevent null reference errors * Add tests for ChatConversation message handling Test null/undefined message bodies, text truncation at 35 characters, and newline replacement in TEXT messages. * handle null for BoldedText component * Remove promotion component from login page --------- Co-authored-by: Vignesh Rajasekaran --- src/containers/Auth/Auth.tsx | 4 -- .../ChatConversation.test.tsx | 51 ++++++++++++++++++- .../ChatConversation/ChatConversation.tsx | 24 ++++----- 3 files changed, 60 insertions(+), 19 deletions(-) diff --git a/src/containers/Auth/Auth.tsx b/src/containers/Auth/Auth.tsx index d170fe8c8e..4bc01fe8fa 100644 --- a/src/containers/Auth/Auth.tsx +++ b/src/containers/Auth/Auth.tsx @@ -15,8 +15,6 @@ import setLogs from 'config/logs'; import { checkOrgStatus } from 'services/AuthService'; import { TERMS_OF_USE_LINK } from 'common/constants'; -import { Promotion } from './Promotion/Promotion'; - export interface AuthProps { pageTitle: string; buttonText: string; @@ -302,8 +300,6 @@ export const Auth = ({ ) : null} - - {mode === 'login' && } ); }; diff --git a/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.test.tsx b/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.test.tsx index a7555614bf..fd1a6f913b 100644 --- a/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.test.tsx +++ b/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.test.tsx @@ -1,10 +1,10 @@ +import { MockedProvider } from '@apollo/client/testing'; import { fireEvent, render } from '@testing-library/react'; import dayjs from 'dayjs'; -import { MockedProvider } from '@apollo/client/testing'; import { MemoryRouter } from 'react-router'; -import { MARK_AS_READ } from 'graphql/mutations/Chat'; import { SHORT_DATE_FORMAT } from 'common/constants'; +import { MARK_AS_READ } from 'graphql/mutations/Chat'; import ChatConversation from './ChatConversation'; const mockCallback = vi.fn(); @@ -79,3 +79,50 @@ test('it should call the callback function on click action', () => { fireEvent.click(getAllByTestId('list')[0]); expect(mockCallback).toHaveBeenCalled(); }); + +test('it should not throw when lastMessage body is null', () => { + const props = { + ...defaultProps, + highlightSearch: 'test', + lastMessage: { body: null, insertedAt, type: 'TEXT' }, + }; + expect(() => render(wrapperContainer(props))).not.toThrow(); +}); + +test('it should not throw when lastMessage body is undefined', () => { + const props = { + ...defaultProps, + highlightSearch: 'test', + lastMessage: { body: undefined, insertedAt, type: 'TEXT' }, + }; + expect(() => render(wrapperContainer(props))).not.toThrow(); +}); + +test('it should truncate message body longer than 35 characters', () => { + const longBody = 'This is a very long message that exceeds the limit'; + const props = { + ...defaultProps, + lastMessage: { body: longBody, insertedAt, type: 'TEXT' }, + }; + const { getByTestId } = render(wrapperContainer(props)); + expect(getByTestId('content').textContent).toContain('...'); +}); + +test('it should not truncate message body within 35 characters', () => { + const shortBody = 'Short message'; + const props = { + ...defaultProps, + lastMessage: { body: shortBody, insertedAt, type: 'TEXT' }, + }; + const { getByTestId } = render(wrapperContainer(props)); + expect(getByTestId('content').textContent).not.toContain('...'); +}); + +test('it should replace newlines with spaces in TEXT messages', () => { + const props = { + ...defaultProps, + lastMessage: { body: 'Hello\nWorld', insertedAt, type: 'TEXT' }, + }; + const { getByTestId } = render(wrapperContainer(props)); + expect(getByTestId('content').textContent).not.toContain('\n'); +}); diff --git a/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.tsx b/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.tsx index 0a16abc485..e14f335e54 100644 --- a/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.tsx +++ b/src/containers/Chat/ChatConversations/ChatConversation/ChatConversation.tsx @@ -1,18 +1,18 @@ +import { useApolloClient, useMutation } from '@apollo/client'; import { ListItemButton } from '@mui/material'; -import { Link, useLocation } from 'react-router'; import dayjs from 'dayjs'; -import { useApolloClient, useMutation } from '@apollo/client'; +import { Link, useLocation } from 'react-router'; import { COMPACT_MESSAGE_LENGTH, SHORT_DATE_FORMAT } from 'common/constants'; -import { MARK_AS_READ } from 'graphql/mutations/Chat'; -import { SEARCH_OFFSET } from 'graphql/queries/Search'; import { WhatsAppToJsx } from 'common/RichEditor'; -import { MessageType } from '../MessageType/MessageType'; -import styles from './ChatConversation.module.css'; -import Track from 'services/TrackService'; import { slicedString, updateContactCache } from 'common/utils'; import { AvatarDisplay } from 'components/UI/AvatarDisplay/AvatarDisplay'; import { Timer } from 'components/UI/Timer/Timer'; +import { MARK_AS_READ } from 'graphql/mutations/Chat'; +import { SEARCH_OFFSET } from 'graphql/queries/Search'; +import Track from 'services/TrackService'; +import { MessageType } from '../MessageType/MessageType'; +import styles from './ChatConversation.module.css'; export interface ChatConversationProps { entityId: number; @@ -24,7 +24,7 @@ export interface ChatConversationProps { index: number; lastMessage: { id: number; - body: string; + body: string | null | undefined; insertedAt: string; type: string; media: any; @@ -130,13 +130,11 @@ const ChatConversation = ({ } const name = slicedString(contactName, 20); - const { type, body } = lastMessage; const isTextType = type === 'TEXT'; + let originalText = body ?? ''; + let displayMSG: any = ; - let displayMSG: any = ; - - let originalText = body; if (isTextType) { // let's shorten the text message to display correctly if (originalText.length > COMPACT_MESSAGE_LENGTH) { @@ -203,7 +201,7 @@ const ChatConversation = ({ {name}
- {isTextType && highlightSearch ? BoldedText(body, highlightSearch) : displayMSG} + {isTextType && highlightSearch ? BoldedText(originalText, highlightSearch) : displayMSG}
From d18eb161baf08c0602544211e50ea4742f702039 Mon Sep 17 00:00:00 2001 From: Shijith Date: Thu, 5 Mar 2026 22:01:59 +0530 Subject: [PATCH 03/14] Bump version to 6.9.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6e8f260d5..bbb2f137d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "glific-frontend", - "version": "6.9.0", + "version": "6.9.1", "private": true, "type": "module", "license": { From d84ecb6e75aadda5719a44488e28819369c61f77 Mon Sep 17 00:00:00 2001 From: Vignesh Rajasekaran Date: Fri, 6 Mar 2026 07:37:14 +0530 Subject: [PATCH 04/14] use nginx static and set log files --- Procfile | 2 +- config/nginx.conf.erb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Procfile b/Procfile index c7330c9f83..27811c6811 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: bin/start-nginx +web: bin/start-nginx-static diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb index 4bf1043231..68dcc31065 100644 --- a/config/nginx.conf.erb +++ b/config/nginx.conf.erb @@ -2,6 +2,9 @@ daemon off; worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; +pid /app/nginx.pid; +error_log stderr error; + events { use epoll; accept_mutex on; @@ -13,6 +16,9 @@ http { gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; + access_log /dev/stdout l2met; + server { listen <%= ENV['PORT'] %>; root /app/build; From 6777b7c6b069c926c6b3d7af8cc364f8298e005f Mon Sep 17 00:00:00 2001 From: Vignesh Rajasekaran Date: Fri, 6 Mar 2026 08:32:22 +0530 Subject: [PATCH 05/14] modify nginx access_log format --- config/nginx.conf.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb index 68dcc31065..b2d5f6b482 100644 --- a/config/nginx.conf.erb +++ b/config/nginx.conf.erb @@ -16,8 +16,10 @@ http { gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; - access_log /dev/stdout l2met; + log_format detailed '$remote_addr - $remote_user [$time_local] ' + '"$request" $request_time $status $body_bytes_sent ' + '"$http_referer" "$http_user_agent"'; + access_log /dev/stdout detailed; server { listen <%= ENV['PORT'] %>; From 85f312e34386d8a901b908b73bbd1236561590d3 Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Fri, 6 Mar 2026 10:18:45 +0530 Subject: [PATCH 06/14] Add staging integration testing workflow for Cypress --- .github/workflows/staging-testing.yml | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/staging-testing.yml diff --git a/.github/workflows/staging-testing.yml b/.github/workflows/staging-testing.yml new file mode 100644 index 0000000000..fe0ae515c9 --- /dev/null +++ b/.github/workflows/staging-testing.yml @@ -0,0 +1,36 @@ +name: Staging Integration Testing + +on: + pull_request: + types: [labeled] + +jobs: + cypress: + if: github.event.label.name == 'test-staging' + runs-on: ubuntu-latest + steps: + - name: Checkout frontend + uses: actions/checkout@v3 + + - name: Use latest Node.js + uses: actions/setup-node@v3 + + - name: Install dependencies + run: yarn setup + + - name: Setup Cypress + run: | + git clone https://github.com/glific/cypress-testing.git + cd cypress-testing + git checkout test_staging + cd .. + cp -r cypress-testing/cypress cypress + yarn add cypress@13.6.2 + cp cypress-testing/cypress.config.ts.example cypress.config.ts + + - name: Cypress run + env: + CYPRESS_BASE_URL: https://staging.glific.com + CYPRESS_BACKEND_URL: https://api.staging.glific.com/api + run: | + yarn run cypress run --record --key ${{ secrets.CYPRESS_DASHBOARD_KEY }} \ No newline at end of file From 3022e5e28b6ac97bc20f6ccb5b86249e051ea101 Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Fri, 6 Mar 2026 10:20:57 +0530 Subject: [PATCH 07/14] Update pull request trigger to listen for specific branch --- .github/workflows/staging-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staging-testing.yml b/.github/workflows/staging-testing.yml index fe0ae515c9..97da8fdf82 100644 --- a/.github/workflows/staging-testing.yml +++ b/.github/workflows/staging-testing.yml @@ -2,7 +2,7 @@ name: Staging Integration Testing on: pull_request: - types: [labeled] + branches: [rvignesh/fix-nginx-conf] jobs: cypress: From 324395ec033ca49c74bb7a139d6d063b877ea35f Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Fri, 6 Mar 2026 11:06:24 +0530 Subject: [PATCH 08/14] Remove conditional check for label in Cypress staging integration testing workflow --- .github/workflows/staging-testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/staging-testing.yml b/.github/workflows/staging-testing.yml index 97da8fdf82..4ca156927d 100644 --- a/.github/workflows/staging-testing.yml +++ b/.github/workflows/staging-testing.yml @@ -6,7 +6,6 @@ on: jobs: cypress: - if: github.event.label.name == 'test-staging' runs-on: ubuntu-latest steps: - name: Checkout frontend From cc8fd299a95de1e1dd299beb4035ae07b84450b8 Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Fri, 6 Mar 2026 11:36:02 +0530 Subject: [PATCH 09/14] Refactor buildpacks and add Nginx configuration; remove static.json --- .buildpacks | 3 +-- Procfile | 1 + config/nginx.conf.erb | 35 +++++++++++++++++++++++++++++++++++ static.json | 16 ---------------- 4 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 Procfile create mode 100644 config/nginx.conf.erb delete mode 100644 static.json diff --git a/.buildpacks b/.buildpacks index 13b8dbf8d2..1a1690f082 100644 --- a/.buildpacks +++ b/.buildpacks @@ -1,3 +1,2 @@ https://github.com/heroku/heroku-buildpack-nodejs.git#v183 -https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0 -https://github.com/heroku/heroku-buildpack-static.git#v5 \ No newline at end of file +https://github.com/heroku/heroku-buildpack-nginx.git \ No newline at end of file diff --git a/Procfile b/Procfile new file mode 100644 index 0000000000..c7330c9f83 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bin/start-nginx diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb new file mode 100644 index 0000000000..4bf1043231 --- /dev/null +++ b/config/nginx.conf.erb @@ -0,0 +1,35 @@ +daemon off; + +worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; + +events { + use epoll; + accept_mutex on; + worker_connections 1024; +} + +http { + include mime.types; + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + server { + listen <%= ENV['PORT'] %>; + root /app/build; + index index.html; + + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header X-Frame-Options "deny" always; + add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always; + add_header Content-Security-Policy "default-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; script-src-elem 'self' 'unsafe-inline' https://www.google.com https://www.gstatic.com https://js.stripe.com; frame-src 'self' https://js.stripe.com https://www.canva.com https://www.google.com https://www.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src *;" always; + + if ($http_x_forwarded_proto != "https") { + return 301 https://$host$request_uri; + } + + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/static.json b/static.json deleted file mode 100644 index 9895b628d7..0000000000 --- a/static.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "root": "build/", - "routes": { - "/**": "index.html" - }, - "https_only": true, - "headers": { - "/**": { - "X-Content-Type-Options": "nosniff", - "X-XSS-Protection": "1; mode=block", - "X-Frame-Options": "deny", - "Content-Security-Policy": "default-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; script-src-elem 'self' 'unsafe-inline' https://www.google.com https://www.gstatic.com https://js.stripe.com; frame-src 'self' https://js.stripe.com https://www.canva.com https://www.google.com https://www.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src *;", - "Strict-Transport-Security": "max-age=63072000; includeSubdomains; preload" - } - } -} From 19acf1cf762fcb07275c0c88165bf8ca55fe370a Mon Sep 17 00:00:00 2001 From: Shijith Date: Thu, 5 Mar 2026 22:01:59 +0530 Subject: [PATCH 10/14] Bump version to 6.9.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6e8f260d5..bbb2f137d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "glific-frontend", - "version": "6.9.0", + "version": "6.9.1", "private": true, "type": "module", "license": { From c9489541cb160138a02e093bfa3dd20aba52ff27 Mon Sep 17 00:00:00 2001 From: Vignesh Rajasekaran Date: Fri, 6 Mar 2026 07:37:14 +0530 Subject: [PATCH 11/14] use nginx static and set log files --- Procfile | 2 +- config/nginx.conf.erb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Procfile b/Procfile index c7330c9f83..27811c6811 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: bin/start-nginx +web: bin/start-nginx-static diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb index 4bf1043231..68dcc31065 100644 --- a/config/nginx.conf.erb +++ b/config/nginx.conf.erb @@ -2,6 +2,9 @@ daemon off; worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; +pid /app/nginx.pid; +error_log stderr error; + events { use epoll; accept_mutex on; @@ -13,6 +16,9 @@ http { gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; + access_log /dev/stdout l2met; + server { listen <%= ENV['PORT'] %>; root /app/build; From 45cdd7bb24a9addeaa510bdbd2e445651fb4b356 Mon Sep 17 00:00:00 2001 From: Vignesh Rajasekaran Date: Fri, 6 Mar 2026 08:32:22 +0530 Subject: [PATCH 12/14] modify nginx access_log format --- config/nginx.conf.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb index 68dcc31065..b2d5f6b482 100644 --- a/config/nginx.conf.erb +++ b/config/nginx.conf.erb @@ -16,8 +16,10 @@ http { gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; - access_log /dev/stdout l2met; + log_format detailed '$remote_addr - $remote_user [$time_local] ' + '"$request" $request_time $status $body_bytes_sent ' + '"$http_referer" "$http_user_agent"'; + access_log /dev/stdout detailed; server { listen <%= ENV['PORT'] %>; From 8d7c439770467ce17191f8ee2311c07a157b0cc6 Mon Sep 17 00:00:00 2001 From: Vignesh Rajasekaran Date: Fri, 6 Mar 2026 10:44:05 +0530 Subject: [PATCH 13/14] yarn and run cypress inside subfolder --- .github/workflows/cypress-testing.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cypress-testing.yml b/.github/workflows/cypress-testing.yml index 4b6e1ac15d..a389d87308 100644 --- a/.github/workflows/cypress-testing.yml +++ b/.github/workflows/cypress-testing.yml @@ -28,18 +28,12 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # frontend setup - - name: Setup frontend + - name: Checkout frontend uses: actions/checkout@v3 - name: Use latest Node.js uses: actions/setup-node@v3 - - name: Setup elixir - uses: erlef/setup-beam@v1 - with: - elixir-version: ${{ matrix.elixir }} - otp-version: ${{ matrix.otp }} - - name: Setup frontend run: | echo copy env file. @@ -54,6 +48,12 @@ jobs: yarn setup echo done. + - name: Setup elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} + # backend setup - name: Setup backend run: | @@ -94,13 +94,9 @@ jobs: run: | echo clone cypress repo git clone https://github.com/glific/cypress-testing.git - echo done. go to dir. cd cypress-testing - cd .. - cp -r cypress-testing/cypress cypress - yarn add cypress@13.6.2 - echo Create cypress.config.ts from example - cp cypress-testing/cypress.config.ts.example cypress.config.ts + cp cypress.config.ts.example cypress.config.ts + yarn # Run frontend - name: Run glific frontend @@ -120,5 +116,6 @@ jobs: # Run cypress - name: Cypress run + working-directory: cypress-testing run: | yarn run cypress run --record --key ${{ secrets.CYPRESS_DASHBOARD_KEY }} From 83ab82e3c1cddc63b4087d6e7c54d3478417d5b2 Mon Sep 17 00:00:00 2001 From: Akansha Sakhre Date: Fri, 6 Mar 2026 12:17:24 +0530 Subject: [PATCH 14/14] Update NGINX configuration to change access log format and simplify logging --- config/nginx.conf.erb | 42 +++--------------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb index 894b576ee8..4043bd1764 100644 --- a/config/nginx.conf.erb +++ b/config/nginx.conf.erb @@ -16,45 +16,9 @@ http { gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - log_format detailed '$remote_addr - $remote_user [$time_local] ' - '"$request" $request_time $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"'; - access_log /dev/stdout detailed; - - server { - listen <%= ENV['PORT'] %>; - root /app/build; - index index.html; - - add_header X-Content-Type-Options "nosniff" always; - add_header X-XSS-Protection "1; mode=block" always; - add_header X-Frame-Options "deny" always; - add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload" always; - add_header Content-Security-Policy "default-src * data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; script-src-elem 'self' 'unsafe-inline' https://www.google.com https://www.gstatic.com https://js.stripe.com; frame-src 'self' https://js.stripe.com https://www.canva.com https://www.google.com https://www.gstatic.com data:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; connect-src *;" always; - - if ($http_x_forwarded_proto != "https") { - return 301 https://$host$request_uri; - } - - location / { - try_files $uri $uri/ /index.html; - } - } -}daemon off; - -worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; - -events { - use epoll; - accept_mutex on; - worker_connections 1024; -} - -http { - include mime.types; - gzip on; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; - + log_format l2met 'measure#nginx.service=$request_time request_id=$http_x_request_id'; + access_log /dev/stdout l2met; + server { listen <%= ENV['PORT'] %>; root /app/build;