Loading .githooks/pre-commit +7 −1 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,12 @@ if git commit -v --dry-run | grep '!testcode' >/dev/null 2>&1 then then echo "Trying to commit test code." echo "Trying to commit test code." exit 1 exit 1 else if git diff --cached locales/en.json | grep '\\n' >/dev/null 2>&1 then echo "New line characters are forbiden in en.json, please split the lines in different translation terms." exit 1 else else exit 0 exit 0 fi fi fi No newline at end of file .gitlab-ci.yml +42 −11 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,7 @@ stages: - build - build - e2e - e2e - deploy - deploy - i18n test:jest: test:jest: image: node:10.16.3 image: node:10.16.3 Loading @@ -17,6 +18,36 @@ test:jest: - yarn install - yarn install - yarn test - yarn test i18n:upload: image: node:10.16.3 stage: i18n cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - yarn locale upload --poeditor-key=${CI_POEDITOR_KEY} --overwrite=1 only: refs: - /^release-*/ i18n:uploadsync: image: node:10.16.3 stage: i18n cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - yarn locale upload --poeditor-key=${CI_POEDITOR_KEY} --overwrite=1 --sync_terms=1 only: refs: - /^stable-*/ build:android: build:android: image: circleci/android:api-28-node image: circleci/android:api-28-node stage: build stage: build Loading Loading @@ -46,7 +77,7 @@ deploy:s3: - build:android - build:android only: only: refs: refs: - /^release-*/ - /^stable-*/ - /^test-*/ - /^test-*/ deploy:google_play: deploy:google_play: Loading App.js +2 −1 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ import commentStorageService from './src/comments/CommentStorageService'; import * as Sentry from '@sentry/react-native'; import * as Sentry from '@sentry/react-native'; import apiService from './src/common/services/api.service'; import apiService from './src/common/services/api.service'; import boostedContentService from './src/common/services/boosted-content.service'; import boostedContentService from './src/common/services/boosted-content.service'; import translationService from './src/common/services/translation.service'; let deepLinkUrl = ''; let deepLinkUrl = ''; Loading Loading @@ -143,7 +144,6 @@ sessionService.onLogin(async () => { //on app logout //on app logout sessionService.onLogout(() => { sessionService.onLogout(() => { // clear app badge // clear app badge badgeService.setUnreadConversations(0); badgeService.setUnreadConversations(0); badgeService.setUnreadNotifications(0); badgeService.setUnreadNotifications(0); Loading @@ -152,6 +152,7 @@ sessionService.onLogout(() => { feedsStorage.removeAll(); feedsStorage.removeAll(); stores.notifications.clearLocal(); stores.notifications.clearLocal(); stores.groupsBar.clearLocal(); stores.groupsBar.clearLocal(); translationService.purgeLanguagesCache(); }); }); // disable yellow boxes // disable yellow boxes Loading AppErrors.js +6 −28 Original line number Original line Diff line number Diff line import { import {Alert} from 'react-native'; Alert, } from 'react-native'; import { import { setNativeExceptionHandler, setNativeExceptionHandler, setJSExceptionHandler setJSExceptionHandler, } from 'react-native-exception-handler'; } from 'react-native-exception-handler'; import { onError } from "mobx-react"; import {onError} from 'mobx-react'; import logService from './src/common/services/log.service'; import logService from './src/common/services/log.service'; import * as Sentry from '@sentry/react-native'; import * as Sentry from '@sentry/react-native'; import { isAbort, isNetworkFail } from './src/common/helpers/abortableFetch'; import shouldReportToSentry from './src/common/helpers/errors'; import { isApiError } from './src/common/services/api.service'; import { isUserError } from './src/common/UserError'; // Init Sentry (if not running test) // Init Sentry (if not running test) if (process.env.JEST_WORKER_ID === undefined) { if (process.env.JEST_WORKER_ID === undefined) { Loading @@ -23,25 +18,8 @@ if (process.env.JEST_WORKER_ID === undefined) { 'Non-Error exception captured with keys: code, domain, localizedDescription', // ignore initial error of sdk 'Non-Error exception captured with keys: code, domain, localizedDescription', // ignore initial error of sdk ], ], beforeSend(event, hint) { beforeSend(event, hint) { if (hint.originalException) { if (hint.originalException) { if (!shouldReportToSentry(hint.originalException)) { // ignore network request failed if (isNetworkFail(hint.originalException)) { return null; } // ignore aborts if (isAbort(hint.originalException)) { return null; } // ignore user errors if (isUserError(hint.originalException)) { return null; } // only log api 500 errors if (isApiError(hint.originalException) && (isNaN(hint.originalException.status) || hint.originalException.status < 500) ) { return null; return null; } } } } Loading @@ -53,7 +31,7 @@ if (process.env.JEST_WORKER_ID === undefined) { } } return event; return event; } }, }); }); } } Loading __tests__/activity/components/__snapshots__/Activity.js.snap +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ exports[`Activity component renders correctly 1`] = ` exports[`Activity component renders correctly 1`] = ` <View <View onLayout={[Function]} style={ style={ Array [ Array [ Object { Object { Loading Loading
.githooks/pre-commit +7 −1 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,12 @@ if git commit -v --dry-run | grep '!testcode' >/dev/null 2>&1 then then echo "Trying to commit test code." echo "Trying to commit test code." exit 1 exit 1 else if git diff --cached locales/en.json | grep '\\n' >/dev/null 2>&1 then echo "New line characters are forbiden in en.json, please split the lines in different translation terms." exit 1 else else exit 0 exit 0 fi fi fi No newline at end of file
.gitlab-ci.yml +42 −11 Original line number Original line Diff line number Diff line Loading @@ -4,6 +4,7 @@ stages: - build - build - e2e - e2e - deploy - deploy - i18n test:jest: test:jest: image: node:10.16.3 image: node:10.16.3 Loading @@ -17,6 +18,36 @@ test:jest: - yarn install - yarn install - yarn test - yarn test i18n:upload: image: node:10.16.3 stage: i18n cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - yarn locale upload --poeditor-key=${CI_POEDITOR_KEY} --overwrite=1 only: refs: - /^release-*/ i18n:uploadsync: image: node:10.16.3 stage: i18n cache: key: ${CI_COMMIT_REF_SLUG} paths: - node_modules/ - .jest/cache/ script: - yarn install - yarn locale upload --poeditor-key=${CI_POEDITOR_KEY} --overwrite=1 --sync_terms=1 only: refs: - /^stable-*/ build:android: build:android: image: circleci/android:api-28-node image: circleci/android:api-28-node stage: build stage: build Loading Loading @@ -46,7 +77,7 @@ deploy:s3: - build:android - build:android only: only: refs: refs: - /^release-*/ - /^stable-*/ - /^test-*/ - /^test-*/ deploy:google_play: deploy:google_play: Loading
App.js +2 −1 Original line number Original line Diff line number Diff line Loading @@ -62,6 +62,7 @@ import commentStorageService from './src/comments/CommentStorageService'; import * as Sentry from '@sentry/react-native'; import * as Sentry from '@sentry/react-native'; import apiService from './src/common/services/api.service'; import apiService from './src/common/services/api.service'; import boostedContentService from './src/common/services/boosted-content.service'; import boostedContentService from './src/common/services/boosted-content.service'; import translationService from './src/common/services/translation.service'; let deepLinkUrl = ''; let deepLinkUrl = ''; Loading Loading @@ -143,7 +144,6 @@ sessionService.onLogin(async () => { //on app logout //on app logout sessionService.onLogout(() => { sessionService.onLogout(() => { // clear app badge // clear app badge badgeService.setUnreadConversations(0); badgeService.setUnreadConversations(0); badgeService.setUnreadNotifications(0); badgeService.setUnreadNotifications(0); Loading @@ -152,6 +152,7 @@ sessionService.onLogout(() => { feedsStorage.removeAll(); feedsStorage.removeAll(); stores.notifications.clearLocal(); stores.notifications.clearLocal(); stores.groupsBar.clearLocal(); stores.groupsBar.clearLocal(); translationService.purgeLanguagesCache(); }); }); // disable yellow boxes // disable yellow boxes Loading
AppErrors.js +6 −28 Original line number Original line Diff line number Diff line import { import {Alert} from 'react-native'; Alert, } from 'react-native'; import { import { setNativeExceptionHandler, setNativeExceptionHandler, setJSExceptionHandler setJSExceptionHandler, } from 'react-native-exception-handler'; } from 'react-native-exception-handler'; import { onError } from "mobx-react"; import {onError} from 'mobx-react'; import logService from './src/common/services/log.service'; import logService from './src/common/services/log.service'; import * as Sentry from '@sentry/react-native'; import * as Sentry from '@sentry/react-native'; import { isAbort, isNetworkFail } from './src/common/helpers/abortableFetch'; import shouldReportToSentry from './src/common/helpers/errors'; import { isApiError } from './src/common/services/api.service'; import { isUserError } from './src/common/UserError'; // Init Sentry (if not running test) // Init Sentry (if not running test) if (process.env.JEST_WORKER_ID === undefined) { if (process.env.JEST_WORKER_ID === undefined) { Loading @@ -23,25 +18,8 @@ if (process.env.JEST_WORKER_ID === undefined) { 'Non-Error exception captured with keys: code, domain, localizedDescription', // ignore initial error of sdk 'Non-Error exception captured with keys: code, domain, localizedDescription', // ignore initial error of sdk ], ], beforeSend(event, hint) { beforeSend(event, hint) { if (hint.originalException) { if (hint.originalException) { if (!shouldReportToSentry(hint.originalException)) { // ignore network request failed if (isNetworkFail(hint.originalException)) { return null; } // ignore aborts if (isAbort(hint.originalException)) { return null; } // ignore user errors if (isUserError(hint.originalException)) { return null; } // only log api 500 errors if (isApiError(hint.originalException) && (isNaN(hint.originalException.status) || hint.originalException.status < 500) ) { return null; return null; } } } } Loading @@ -53,7 +31,7 @@ if (process.env.JEST_WORKER_ID === undefined) { } } return event; return event; } }, }); }); } } Loading
__tests__/activity/components/__snapshots__/Activity.js.snap +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ exports[`Activity component renders correctly 1`] = ` exports[`Activity component renders correctly 1`] = ` <View <View onLayout={[Function]} style={ style={ Array [ Array [ Object { Object { Loading