Skip to content

Commit

Permalink
Update (#1)
Browse files Browse the repository at this point in the history
* update background-jobs documentation

* Fix chatInput focussing

* Fix sending plaintext messages

* Remove unnecessary double-read of attached media

* Resolve React warnings

* Fix creating new DM thread

* Revert "Fix creating new DM thread"

This reverts commit d8e9cc8.

* Fix flow

* Update background-jobs.md

* Don't include the req path in the datadog key

This is an anti-pattern, as it'll blow up our DataDog storage costs.
Instead, we should be using a logging service like Splunk to dig into
specific slow requests after noticing abnormalities in the
metrics. Will tackle that next most likely, but this should be a good start!

Thanks to the folks in #observability for pointing that out!

* Dont track connection pool size in DataDog, track query response times and sizes

* Properly flow-type statsd

* Add statsd logging in dev

* Log instance hostname

* Upgrade apollo-cache-inmemory

* Better network disabled styling on input

* Fix styling if quote-replying and uploading media at same time

* Dont use alpha version of new apollo inmemory

* Add codesandbox to explore

* Add codesandbox url regex for better embeds

* Add packages for deploys

* Add the rest

* Update react-modal to version 3.8.1

* Update electron-builder to version 20.38.4

* Focus chatinput on quote message click

* Fix media messages arriving after text messages

* Handle websocket connection states

* Track job queue metrics

* Update react-transition-group to version 2.5.2

* Eliminate warning in console due to incorrect html element nesting

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update debug to version 4.1.1

* Update validator to version 10.10.0

* Update serialize-javascript to version 1.6.1

* Remove use of Google+ APIs

* Downrank watercooler threads in digests

* Nicer reputation string in digest emails

* Add function to check if localStorage is allowed

* Trigger login modal in the joinChannel upsell if no currentUser

* Remove localStorage check

* Make logged out users sign in before seeing chat input

* Remove unused timeInUTC variable

* Fix e2e tests

* Better string, fix test snapshots

* Update rimraf to version 2.6.3

* Update aws-sdk to version 2.383.0

* Update aws-sdk to version 2.383.0

* Update aws-sdk to version 2.383.0

* Update aws-sdk to version 2.383.0

* Update aws-sdk to version 2.383.0

* Add missing username property in onValidationResult object

`onValidationResult` function takes an object with prop error, success
and username.

* Make username optional

* Fix flow

* Remove unused variables from chatInput

* Explicitly target chat input from e2e tests

* Move data-cy="chat-input" to actual input

* Use .clear() instead of .type() in e2e tests

* Remove .only in thread_spec, fix /new/thread tests

* Upgrade to draft-js-import-markdown@latest to fix code blocks

* Make plaintext message editing work

* edit in plaintext on the frontend

* Fix flow

* Fix editing e2e test

* Match input font weight to rendered message font weight

* Remove invalid dataCy dom node property

* Change editor to allow multiline messages

* Remove empty line while editing

* Fix incorrect focussing on chat input while editing message

* Make single line breaks work!

* Upgrade to apollo-server-express@2.4.0-alpha.0

This implements query parsing and validation caching, reference
apollographql/apollo-server#2111, and should
thusly provide a nice speedup for our frontend's queries!

* add delete cover feature to edit community form

* add coverphoto flow type

* Add extra checks at send time for valid user recipient

* Async await

* Remove unnecessary code

The code block for the `SET_SEARCH_VALUE` type and the `SET_SEARCH_VALUE_FOR_SERVER
` type are indentical. And, the `SET_SEARCH_VALUE` type isnt used in any action in the codebase.

* Better keycode management

* Enable flow in keycodes file

* Fix flow

* Focus the edit message input when edit message button is clicked

* Move keycodes.js to src/helpers

* Update source-map-support to version 0.5.10

* Update view error message

* Fenced code blocks while editing

* WIP: Implement GraphQL Rate Limiting

* Make graphql-rate-limit work!

* Show rate limit errors to end users

* Adjust createChannel/createCommunity rate limits

* Make flow happy

* Use the job queue redis instance for rate limit data

* Log rate limit errors to sentry in prod

* Update to new version of gql-rate-limit, use string syntax

* Make flow happy

* Add flow stub for request-ip

* Update react-transition-group to version 2.5.3

* Remove draftjs block type validation in messages

This is confusing now that we have the plaintext input, and doesn't add
anything as invalid blocks are treated as text blocks anyway on the
frontend.

* Disable rate limiting unless in prod

* Gender-neutral rate limit error message, better addMessage rate limit

* Update electron-builder to version 20.38.5

* Support hyperlinks in messages

* Make flow happy

* Update validator to version 10.11.0

* WIP: Add mention suggestions to chat input

* add delete cover feature to createCommunityForm

* Update validate-draft-js-input.js

* Stop submitting message during IME is composing

* Fix oopsie

* Search users on type

* It works!

* Fix flow

* Cleanup unnecessary code changes

* Fix mentionsuggestions props

* Fix dm chatinput onfocus and onblur handlers

* Fix typo

* Upgrade graphql-rate-limit

This fixes a critical bug that is preventing some folks from posting
messages

* Update bull to version 3.5.3

* Update bull to version 3.5.3

* Update bull to version 3.5.3

* Update bull to version 3.5.3

* Update bull to version 3.6.0

* Update bull to version 3.6.0

* Update bull to version 3.6.0

* Update bull to version 3.6.0

* Hotfix Android thread creation

* Fix hyperion memory leak

Closes #4573

* Polish styles and prepopulate suggestions box

* Update moment to version 2.24.0

* Update immutability-helper to version 2.9.1

* Show participants and search results in mention suggestions

1. Enter `@`
2. Participants are shown
3. Enter `@b`
4. Participants filtered and sorted by whether they have a `b` in them are shown
5. In the background, we do an API req
6. If there are users that come back from the API, we append them to the list of suggestions

This is a much nicer experience than hiding the participants if you just want to filter them

* Fix bug with null participant

* Update graphql-tools to version 4.0.4

* Fix login redirects

* Only show 10 suggestions, make sure suggestions have usernames

* Pass participants to chatinput for SSR views

* Darker shadow for contrast

* Return original participants if user removes search query

* If switched thread has no messages, remove participant suggestions

* Ensure author is a suggested participant

* Better styling, fewer suggestion results

* Improves suggestion sort to factor in name

* Fix capitalization for rendering and filtering

* Fix flow

* Ensure that local results will appear even if no remote results exist

* Fix the default sort if search query isn't at the 0 index

* Properly transform author username suggestion

* Refactor to only perform suggestion transformations in one place

* Provide transformation function in DM sorting

* Fix flow

* Workaround react-mentions bug with markup option

Ideally, we would fix mentions by setting `markup="@__display__"` for
the `MentionInput`. Unfortunately due to a bug in react-mentions, this
doesn't work: signavio/react-mentions#299

This works around the issue by inserting `@[username]` into the value,
and then removing the brackets before sending to the server!

Closes #4587

* Add <MentionsInput /> component

* Fix dataCy passthrough to mentionsinput

* Update graphql-cost-analysis to version 1.0.3

* Update draft-js-export-markdown to fix escaped code chars

* Update draft-js-import-markdown to fix link swallowing

* Update draft-js-import-markdown to version 1.3.0

* Update highlight.js to version 9.14.1

* Update graphql-rate-limit to version 1.2.3

* Update aws-sdk to version 2.395.0

* Update aws-sdk to version 2.395.0

* Update aws-sdk to version 2.395.0

* Update slate to version 0.44.10
  • Loading branch information
akpx authored Feb 4, 2019
1 parent 62e4430 commit 0b9aa74
Show file tree
Hide file tree
Showing 1,583 changed files with 84,220 additions and 59,945 deletions.
113 changes: 52 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ aliases:
- &save-yarn-cache
paths:
- node_modules
- mobile/node_modules
- ~/.cache/yarn
key: v1-yarn-{{ arch }}-{{ checksum "package.json" }}

- &yarn
|
yarn
cd ./mobile && yarn && yarn setup
cd ./desktop && yarn && cd ..

- &install-rethinkdb
name: Install RethinkDB 2.3.5
Expand All @@ -36,16 +35,19 @@ aliases:
background: true

- &setup-and-build-web
name: Setup and build
name: Setup and build web
command:
|
node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
cp now-secrets.example.json now-secrets.json
yarn run build:web
yarn run build:api

- &build-api
name: Build API
command: yarn run build:api

- &start-api
name: Start the API in the background
command: TEST_DB=true yarn run dev:api
command: yarn run start:api:test
background: true

- &start-web
Expand All @@ -61,11 +63,6 @@ js_defaults: &js_defaults
docker:
- image: circleci/node:8

macos_defaults: &macos_defaults
<<: *defaults
macos:
xcode: "9.2.0"

version: 2
jobs:

Expand All @@ -90,28 +87,53 @@ jobs:
- image: circleci/node:8-browsers
- image: redis:3.2.7
- image: cypress/base:6
- image: rethinkdb:2.3.5
environment:
TERM: xterm
steps:
- attach_workspace:
at: ~/spectrum
- run: *install-rethinkdb
- run: *start-rethinkdb
- run: sleep 10
- run: yarn run db:migrate
- run: yarn run db:seed
- run:
name: Run Unit Tests
command: yarn run test:ci
- run: *setup-and-build-web
- run: *build-api
- run: *start-api
- run: *start-web
- run: sleep 60
# Wait for the API and webserver to start
- run: ./node_modules/.bin/wait-on http://localhost:3000 http://localhost:3001
- run:
name: Run Unit Tests
command: yarn run test:ci
- run:
name: Install Cypress
command: yarn run cypress:install
- run:
name: Run E2E Tests
command: yarn run test:e2e
command: test $CYPRESS_RECORD_KEY && yarn run test:e2e -- --record || yarn run test:e2e
- run:
name: Danger
when: always
command: yarn run danger ci
name: Test desktop apps
command: yarn run test:desktop

# deploy_alpha:
# <<: *js_defaults
# docker:
# - image: circleci/node:8-browsers
# steps:
# - attach_workspace:
# at: ~/spectrum
# - run: *build-api
# - run:
# name: Deploy and alias API
# command: |
# cd build-api
# npx now-cd --alias "alpha=api.alpha.spectrum.chat" --team space-program
# cd ..
# - run:
# name: Deploy and alias Hyperion
# command: npx now-cd --alias "alpha=hyperion.alpha.spectrum.chat" --team space-program

# Run eslint, flow etc.
test_static_js:
Expand All @@ -126,57 +148,26 @@ jobs:
name: Run ESLint
command: yarn run lint

# Tests js of the mobile app
test_mobile_js:
<<: *js_defaults
steps:
- attach_workspace:
at: ~/spectrum
- run: cd ./mobile && yarn test:unit

# Tests native code of the mobile app
test_mobile_native:
<<: *macos_defaults
steps:
- attach_workspace:
at: ~/spectrum
- run:
name: Install Expo CLI
command: npm install -g exp
- run:
name: Install Detox dependencies
command: |
brew tap wix/brew
brew install applesimutils --HEAD
npm install -g detox-cli
- run:
name: Rebuild Detox frameworks
command: |
cd ./mobile
detox clean-framework-cache
detox build-framework-cache
- run:
name: Start Packager in the background
command: cd ./mobile && exp start
background: true
- run: cd ./mobile && yarn test:e2e

workflows:
version: 2

test:
jobs:
- checkout_environment
- test_mobile_js:
requires:
- checkout_environment
# Disabled as Expo is fixing their critical issue with Detox
# - test_mobile_native:
# requires:
# - checkout_environment

# Testing
- test_web:
requires:
- checkout_environment
- test_static_js:
requires:
- checkout_environment

# Deployment
# - deploy_alpha:
# requires:
# - test_static_js
# - test_web
# filters:
# branches:
# only: alpha
13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ npm-debug.log
build
.DS_Store
src/config/FirebaseConfig.js
npm-debug.log
rethinkdb_data
debug
now-secrets.json
Expand All @@ -19,7 +18,6 @@ build-chronos
build-mercury
build-vulcan
build-hyperion
build-pluto
package-lock.json
.vscode
dump.rdb
Expand All @@ -30,6 +28,4 @@ test-extend.js
stats.json
iris/.env
api/.env
.expo
mobile/.expo
test-results.json
23 changes: 18 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
module.exports = {
extends: 'react-app',
extends: 'eslint:recommended',
parser: 'babel-eslint',
env: {
node: false,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['eslint-plugin-flowtype'],
rules: {
'no-unused-vars': 0,
'no-undef': 0,
radix: 0,
'import/first': 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-unused-vars': 0,
'no-empty': 0,
'no-useless-escape': 1,
'no-fallthrough': 1,
'no-extra-boolean-cast': 1,
},
};
33 changes: 0 additions & 33 deletions .eslintrc.json

This file was deleted.

22 changes: 11 additions & 11 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[ignore]
.*/node_modules/.*
.*/build.*
.*/*.test.js
.*/.expo

[include]

[libs]
.*/node_modules/cypress
.*/node_modules/draft-js
.*/node_modules/graphql
.*/node_modules/protobufjs-no-cli
.*/node_modules/reqwest
.*/node_modules/react-apollo
.*/node_modules/dataloader
<PROJECT_ROOT>/node_modules/*
<PROJECT_ROOT>/email-template-scripts/*

[options]
suppress_comment=.*\\$FlowFixMe
suppress_comment=.*\\$FlowIssue
esproposal.class_instance_fields=enable
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=spectrum
module.file_ext=.ios.js
module.file_ext=.android.js
module.file_ext=.native.js
module.system.node.resolve_dirname=.
module.file_ext=.web.js
module.file_ext=.js
module.file_ext=.jsx
Expand All @@ -29,4 +29,4 @@ unclear-type=warn
unsafe-getters-setters=error

[version]
0.66.0
0.66.0
8 changes: 7 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
**Deploy after merge (delete what needn't be deployed)**
- api
- hyperion (frontend)
- desktop
- athena
- vulcan
- mercury
- hermes
- chronos
- mobile
- analytics

**Run database migrations (delete if no migration was added)**
YES

**Release notes for users (delete if codebase-only change)**
-

**Related issues (delete if you don't know of any)**
Closes #

<!-- If there are UI changes please share mobile-responsive and desktop screenshots or recordings. -->

11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build
.DS_Store
src/config/FirebaseConfig.js
npm-debug.log
yarn-error.log
rethinkdb_data
debug
now-secrets.json
Expand All @@ -16,7 +17,8 @@ build-chronos
build-mercury
build-vulcan
build-hyperion
build-pluto
build-electron
build-analytics
package-lock.json
.vscode
dump.rdb
Expand All @@ -27,6 +29,9 @@ test-extend.js
stats.json
iris/.env
api/.env
.expo
mobile/.expo
test-results.json
desktop/release
public/uploads
cypress/screenshots/
cypress/videos/
cacert
Loading

0 comments on commit 0b9aa74

Please sign in to comment.