Conversation
* 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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis 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
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| 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
Show autofix suggestion
Hide autofix suggestion
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: readbetween 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.
| @@ -7,6 +7,8 @@ | ||
| jobs: | ||
| cypress: | ||
| if: github.event.label.name == 'test-staging' | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout frontend |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
2186135 to
8d7c439
Compare
…sh/fix-nginx-conf
…ontend into cypress-testing
Summary by CodeRabbit
Bug Fixes
Chores