Skip to content

staging testing#3820

Open
akanshaaa19 wants to merge 16 commits intomasterfrom
cypress-testing
Open

staging testing#3820
akanshaaa19 wants to merge 16 commits intomasterfrom
cypress-testing

Conversation

@akanshaaa19
Copy link
Copy Markdown
Member

@akanshaaa19 akanshaaa19 commented Mar 6, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved chat message display to handle edge cases with null or undefined messages without throwing errors.
    • Fixed text truncation in chat conversations to properly show ellipsis only when text exceeds 35 characters.
    • Updated newline handling in chat messages to render as spaces for better readability.
  • Chores

    • Updated version to 6.9.1.
    • Removed promotional content from the login flow.
    • Updated deployment infrastructure configuration.

akanshaaa19 and others added 7 commits March 5, 2026 21:05
* 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
* fix: 🐛 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 <vignesh@rvignesh.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 76de23ee-f1a2-4aa8-950f-eaa5b129fb0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This pull request migrates the application from Netlify static hosting to Heroku with NGINX while adding staging environment testing capabilities. Changes include: replacing buildpacks configuration with nginx buildpack, adding a new GitHub Actions workflow for Cypress-based integration testing against staging, creating NGINX configuration with security headers and static asset serving, adding a Procfile for process management, removing the Promotion component from the Auth login flow, updating ChatConversation component to handle null/undefined message bodies with corresponding test coverage, bumping the package version from 6.9.0 to 6.9.1, and removing the Netlify static.json configuration file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

staging, test-staging

Suggested reviewers

  • rvignesh89
  • mdshamoon
  • shijithkjayan

Poem

🐰 A rabbit hops from Netlify's nest,
To Heroku's NGINX, now passing the test!
With staging workflows and security tight,
Cypress runs daily—everything's right! ✨
Version 6.9.1 shines oh so bright!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'staging testing' is vague and generic. While the PR does introduce staging-related testing (GitHub Actions workflow, Procfile, nginx config), the title uses overly broad, non-descriptive terms that don't clearly convey the main technical changes or purpose. Consider a more specific title that captures the key changes, such as 'Add nginx static server and staging E2E testing workflow' or 'Migrate from static buildpack to nginx with Cypress integration tests'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cypress-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@akanshaaa19 akanshaaa19 changed the base branch from master to rvignesh/fix-nginx-conf March 6, 2026 04:51
Comment on lines +9 to +36
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

Check warning

Code scanning / CodeQL

Workflow does not contain permissions

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {{contents: read}}

Copilot Autofix

AI about 1 month ago

In general, the problem is fixed by explicitly defining a permissions: block either at the workflow root (applies to all jobs) or within the individual job to restrict the GITHUB_TOKEN to the minimal scopes required, typically contents: read for workflows that only need to read the repository. This documents the intended access and ensures the workflow remains least‑privilege even if repo/org defaults change later.

For this specific workflow, the cypress job only needs to check out code and run tests. It does not create or modify GitHub resources (no pushes, no issue or PR updates, no releases), so it only requires contents: read. The most targeted fix is to add a permissions: block directly under the cypress job definition, at the same indentation level as if: and runs-on:, with contents: read. This avoids affecting any other jobs that might exist in the file (none are shown, but scoping at job level is still precise) and does not change runtime behavior except for reducing available privileges on the GITHUB_TOKEN.

Concretely, in .github/workflows/staging-testing.yml, insert:

    permissions:
      contents: read

between the if: github.event.label.name == 'test-staging' line and the runs-on: ubuntu-latest line for the cypress job. No imports or additional definitions are needed, as permissions is a native GitHub Actions workflow key.

Suggested changeset 1
.github/workflows/staging-testing.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/staging-testing.yml b/.github/workflows/staging-testing.yml
--- a/.github/workflows/staging-testing.yml
+++ b/.github/workflows/staging-testing.yml
@@ -7,6 +7,8 @@
 jobs:
   cypress:
     if: github.event.label.name == 'test-staging'
+    permissions:
+      contents: read
     runs-on: ubuntu-latest
     steps:
       - name: Checkout frontend
EOF
@@ -7,6 +7,8 @@
jobs:
cypress:
if: github.event.label.name == 'test-staging'
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout frontend
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.46%. Comparing base (5d830c2) to head (d9ee7cf).
⚠️ Report is 31 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3820   +/-   ##
=======================================
  Coverage   82.45%   82.46%           
=======================================
  Files         335      335           
  Lines       13019    13017    -2     
  Branches     2871     2871           
=======================================
- Hits        10735    10734    -1     
- Misses       1378     1381    +3     
+ Partials      906      902    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link
Copy Markdown

cypress bot commented Mar 6, 2026

Glific    Run #7573

Run Properties:  status check failed Failed #7573  •  git commit fc5b9b634d ℹ️: Merge d9ee7cf478fd670e5de6944d37942da0c722c444 into 83ab82e3c1cddc63b4087d6e7c54...
Project Glific
Branch Review cypress-testing
Run status status check failed Failed #7573
Run duration 37m 51s
Commit git commit fc5b9b634d ℹ️: Merge d9ee7cf478fd670e5de6944d37942da0c722c444 into 83ab82e3c1cddc63b4087d6e7c54...
Committer Akansha Sakhre
View all properties for this run ↗︎

Test results
Tests that failed  Failures 28
Tests that were flaky  Flaky 1
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 184
View all changes introduced in this branch ↗︎

Tests for review

Failed  auth/ForgotPassword.spec.ts • 1 failed test

View Output

Test Artifacts
Forgot password page > Successful otp send Test Replay Screenshots
Failed  chat/Chat.spec.ts • 3 failed tests

View Output

Test Artifacts
Chats > should send the speed send Test Replay Screenshots
Chats > should send the templates Test Replay Screenshots
Chats > should check gupshup wallet balance Test Replay Screenshots
Failed  contactBar/ContactBar.spec.ts • 1 failed test

View Output

Test Artifacts
Contact bar > should start a flow Test Replay Screenshots
Failed  filesearch/Filesearch.spec.ts • 11 failed tests

View Output

Test Artifacts
File search > should show placeholder text when no assistant is selected Test Replay Screenshots
File search > should open the create form with all fields when clicking Create button Test Replay Screenshots
File search > should display form helper texts in create mode Test Replay Screenshots
File search > should create a new assistant with file upload Test Replay Screenshots
File search > should clear search and restore the full list Test Replay Screenshots
File search > should select an assistant and display its details in the form Test Replay Screenshots
File search > should show unsaved changes indicator when name is modified Test Replay Screenshots
File search > should show unsaved changes indicator when temperature is modified Test Replay Screenshots
File search > should edit instructions in the expanded dialog and save Test Replay Screenshots
File search > should disable OK button when all files are removed from the dialog Test Replay Screenshots
The first 10 failed tests are shown, see all 11 tests in Cypress Cloud.
Failed  flow/Flow.spec.ts • 3 failed tests

View Output

Test Artifacts
Flow > sorting by title should work perfectly Test Replay Screenshots
Flow > should check require field validation Test Replay Screenshots
Flow > should throw keyword already exists validation Test Replay Screenshots

The first 5 failed specs are shown, see all 12 specs in Cypress Cloud.

Flakiness  cypress/e2e/filesearch/Filesearch.spec.ts • 1 flaky test

View Output

Test Artifacts
File search > should show error for temperature value above 2 Test Replay Screenshots

@akanshaaa19 akanshaaa19 force-pushed the rvignesh/fix-nginx-conf branch from 2186135 to 8d7c439 Compare March 6, 2026 06:42
Base automatically changed from rvignesh/fix-nginx-conf to 6.9.1 March 6, 2026 08:18
Base automatically changed from 6.9.1 to master March 9, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants