-
Notifications
You must be signed in to change notification settings - Fork 57
staging testing #3820
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
Open
akanshaaa19
wants to merge
16
commits into
master
Choose a base branch
from
cypress-testing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
staging testing #3820
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
603c8d0
chore: update buildpacks and add nginx configuration (#3807)
akanshaaa19 eb70922
Handling null message body (#3809)
shijithkjayan d18eb16
Bump version to 6.9.1
shijithkjayan d84ecb6
use nginx static and set log files
rvignesh89 6777b7c
modify nginx access_log format
rvignesh89 85f312e
Add staging integration testing workflow for Cypress
akanshaaa19 3022e5e
Update pull request trigger to listen for specific branch
akanshaaa19 324395e
Remove conditional check for label in Cypress staging integration tes…
akanshaaa19 cc8fd29
Refactor buildpacks and add Nginx configuration; remove static.json
akanshaaa19 19acf1c
Bump version to 6.9.1
shijithkjayan c948954
use nginx static and set log files
rvignesh89 45cdd7b
modify nginx access_log format
rvignesh89 8d7c439
yarn and run cypress inside subfolder
rvignesh89 18d79b8
Merge branch '6.9.1' of github.com:glific/glific-frontend into rvigne…
akanshaaa19 83ab82e
Update NGINX configuration to change access log format and simplify l…
akanshaaa19 d9ee7cf
Merge branch 'rvignesh/fix-nginx-conf' of github.com:glific/glific-fr…
akanshaaa19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| https://github.com/heroku/heroku-buildpack-nginx.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Staging Integration Testing | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [rvignesh/fix-nginx-conf] | ||
|
|
||
| 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 [email protected] | ||
| 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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| web: bin/start-nginx-static |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| daemon off; | ||
|
|
||
| worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>; | ||
|
|
||
| pid /app/nginx.pid; | ||
| error_log stderr error; | ||
|
|
||
| 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 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; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions
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 theGITHUB_TOKENto the minimal scopes required, typicallycontents: readfor 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
cypressjob 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 requirescontents: read. The most targeted fix is to add apermissions:block directly under thecypressjob definition, at the same indentation level asif:andruns-on:, withcontents: 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 theGITHUB_TOKEN.Concretely, in
.github/workflows/staging-testing.yml, insert:between the
if: github.event.label.name == 'test-staging'line and theruns-on: ubuntu-latestline for thecypressjob. No imports or additional definitions are needed, aspermissionsis a native GitHub Actions workflow key.