Skip to content

Commit fc377de

Browse files
committed
Merge latest changes from origin/latest into 3d-playground
2 parents 63cb29a + 6bfec31 commit fc377de

File tree

1,732 files changed

+116805
-15637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,732 files changed

+116805
-15637
lines changed

.eslintrc.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = {
55
'airbnb',
66
'plugin:prettier/recommended',
77
'plugin:jsx-a11y/recommended',
8-
'plugin:cypress/recommended',
98
],
109
env: {
1110
es6: true,
@@ -25,6 +24,7 @@ module.exports = {
2524
ignorePatterns: [
2625
'**/tz/**',
2726
'index.stories.jsx',
27+
'index.stories.tsx',
2828
'index.amp.stories.jsx',
2929
'.storybook/**/*',
3030
],
@@ -37,6 +37,22 @@ module.exports = {
3737
'import',
3838
'no-only-tests',
3939
],
40+
globals: {
41+
cy: false,
42+
Cypress: false,
43+
expect: false,
44+
assert: false,
45+
chai: false,
46+
before: false,
47+
beforeEach: false,
48+
after: false,
49+
afterEach: false,
50+
describe: false,
51+
it: false,
52+
context: false,
53+
specify: false,
54+
test: false,
55+
},
4056
rules: {
4157
'react/prop-types': 'off',
4258
'react/forbid-foreign-prop-types': 'error',
@@ -78,6 +94,10 @@ module.exports = {
7894
'jsx-a11y/no-redundant-roles': 'off',
7995
'no-only-tests/no-only-tests': 'error',
8096
'no-unsafe-optional-chaining': 'error',
97+
'cypress/no-assigning-return-values': 'error',
98+
'cypress/no-unnecessary-waiting': 'error',
99+
'cypress/no-async-tests': 'error',
100+
'cypress/unsafe-to-chain-command': 'error',
81101
},
82102
settings: {
83103
'import/resolver': {

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/ws-nextjs-app/package.json @bbc/simorgh
33
/.yarn/cache @bbc/simorgh
44
/yarn.lock @bbc/simorgh
5+
/.github/workflows/*.yml @bbc/simorgh-admins

.github/dependabot.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ updates:
66
interval: 'weekly'
77
day: 'wednesday'
88
time: '16:00'
9+
cooldown:
10+
default-days: 7
911
ignore:
10-
- dependency-name: 'webpack'
11-
update-types: ['version-update:semver-major']
12+
# https://bbc.atlassian.net/browse/WS-106 - Replace `winston` logger because we currently have a workaround patch to fix a memory leak
1213
- dependency-name: 'winston'
1314
# https://jira.dev.bbc.co.uk/browse/NEWSWORLDSERVICE-2185: Latest version of eslint has breaking changes
1415
- dependency-name: eslint

.github/workflows/main.yml

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,60 @@ name: Notify on PR with >12 Comments
33
on:
44
issue_comment:
55
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
68

79
jobs:
810
notify-on-comments:
911
runs-on: ubuntu-latest
10-
if: github.event.issue.pull_request && github.event.issue.state == 'open'
1112
steps:
1213
- name: Get PR comments count
1314
id: get_comments
1415
uses: actions/github-script@v7
1516
with:
1617
script: |
17-
const prNumber = context.payload.issue.number;
18+
let prNumber;
19+
let totalComments = 0;
20+
21+
if (context.eventName === 'pull_request') {
22+
prNumber = context.payload.pull_request.number;
23+
} else if (context.eventName === 'issue_comment') {
24+
// Check if the comment is on a PR
25+
if (!context.payload.issue.pull_request) {
26+
console.log('Comment is not on a PR, skipping');
27+
return;
28+
}
29+
prNumber = context.payload.issue.number;
30+
} else if (context.eventName === 'pull_request_review_comment') {
31+
prNumber = context.payload.pull_request.number;
32+
} else {
33+
console.log('Unsupported event type:', context.eventName);
34+
return;
35+
}
1836
console.log('prNumber', prNumber);
1937
const { data: comments } = await github.rest.issues.listComments({
2038
owner: context.repo.owner,
2139
repo: context.repo.repo,
2240
issue_number: prNumber,
2341
});
24-
console.log('comments', comments.length);
25-
return comments.length;
42+
const { data: review_comments } = await github.rest.pulls.listReviewComments({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
pull_number: prNumber,
46+
});
47+
console.log('review_comments.length', review_comments.length);
48+
49+
totalComments = review_comments.length + comments.length;
50+
console.log('totalComments', totalComments);
51+
core.setOutput("totalComments", totalComments);
52+
core.setOutput("prNumber", prNumber);
2653
result-encoding: string
2754

2855
- name: Send slack message if comment threshold is exceeded
29-
if: steps.get_comments.outputs.result > 12
56+
if: steps.get_comments.outputs.totalComments > 12
3057
uses: slackapi/[email protected]
3158
with:
3259
webhook: ${{ secrets.SLACK_PR_COMMENTS_WEBHOOK_URL }}
3360
webhook-type: incoming-webhook
3461
payload: |
35-
"text": "Pull Request #${{ github.event.issue.number }} (\"${{ github.event.issue.title }}\") now has over 12 comments.\n<${{ github.event.issue.html_url }}|View Pull Request>\nCurrent comment count: ${{ steps.get_comments.outputs.result }}"
62+
"text": "Pull Request #${{ steps.get_comments.outputs.prNumber }} now has over 12 comments.\n<https://github.com/bbc/simorgh/pull/${{ steps.get_comments.outputs.prNumber }}|View Pull Request>\nCurrent comment count: ${{ steps.get_comments.outputs.totalComments }}"

.github/workflows/simorgh-unit-tests.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
env:
1616
CI: true
1717
LOG_LEVEL: 'error'
18-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
19-
GIT_COMMIT_SHA: ${{ github.sha }}
2018

2119
steps:
2220
- uses: actions/checkout@v4
@@ -25,16 +23,6 @@ jobs:
2523
with:
2624
node-version: ${{ matrix.node-version }}
2725

28-
# Sets the GIT_BRANCH env variable on a push event which occurs when we merge a PR. ${GITHUB_REF##*/} is the shorthand syntax for getting the short branch name
29-
- name: Set GIT_BRANCH Environment Variable For Push Event
30-
if: ${{ github.event_name == 'push' }}
31-
run: echo "GIT_BRANCH=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
32-
33-
# Sets the GIT_BRANCH env variable on a pull request event which occurs when we create/update a PR. ${{ github.head_ref }} is the syntax for getting the short branch name
34-
- name: Set GIT_BRANCH Environment Variable For Pull Request Event
35-
if: ${{ github.event_name == 'pull_request' }}
36-
run: echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
37-
3826
- name: Cache Node Modules
3927
id: cache
4028
uses: actions/cache@v4
@@ -55,22 +43,9 @@ jobs:
5543
working-directory: ./ws-nextjs-app
5644
run: yarn build
5745

58-
- name: Setup Code Climate Test Coverage
59-
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/simorgh' }} # Only run if PR originates from the Simorgh repo
60-
run: |
61-
echo $GIT_BRANCH
62-
echo $GIT_COMMIT_SHA
63-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
64-
chmod +x ./cc-test-reporter
65-
./cc-test-reporter before-build
66-
6746
- name: Unit Tests - Express App
6847
run: yarn test:unit:ci
6948

7049
- name: Unit Tests - Next.JS App
7150
working-directory: ./ws-nextjs-app
7251
run: yarn test
73-
74-
- name: Report Code Climate Test Coverage
75-
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bbc/simorgh' }} # Only run if PR originates from the Simorgh repo
76-
run: ./cc-test-reporter after-build -t lcov --debug --exit-code 0

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.14.0
1+
v22.18.0

.storybook/DocsDecorator/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
DocsContextProps,
55
Title,
66
Markdown,
7-
} from '@storybook/addon-docs';
7+
} from '@storybook/addon-docs/blocks';
88
import ThemeProvider from '../../src/app/components/ThemeProvider';
99
import HealthFactors from './HealthFactors';
1010
import { HealthFactorsProps } from './types';

.storybook/helpers/ampDecorator/__snapshots__/index.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`AmpDecorator should render correctly 1`] = `
44
<div>

.storybook/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const storybookConfig: StorybookConfig = {
1919
'../src/app/legacy/components/**/*.stories.@(t|j)sx',
2020
'../src/app/legacy/containers/**/*.stories.@(t|j)sx',
2121
'../src/app/legacy/psammead/psammead-locales/**/*.stories.@(t|j)sx',
22+
'../src/app/legacy/psammead/index.stories.tsx',
2223
'../src/app/components/**/*.stories.@(t|j)sx',
2324
'../src/app/pages/**/*.stories.@(t|j)sx',
2425
'./DocsDecorator/**/*.stories.@(t|j)sx',

.storybook/preview.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ const preview: Preview = {
349349
value: { service: 'cymrufyw', variant: 'default' },
350350
title: 'cymrufyw',
351351
},
352+
{
353+
value: { service: 'dari', variant: 'default' },
354+
title: 'dari',
355+
},
352356
{
353357
value: { service: 'gahuza', variant: 'default' },
354358
title: 'gahuza',
@@ -533,6 +537,10 @@ const preview: Preview = {
533537
value: { service: 'ukrainian', variant: 'ru-UA' },
534538
title: 'ukrainian-ru-UA',
535539
},
540+
{
541+
value: { service: 'ws', variant: 'default' },
542+
title: 'ws',
543+
},
536544
],
537545
dynamicTitle: true,
538546
},

0 commit comments

Comments
 (0)