Commit graph

411 commits

Author SHA1 Message Date
Alberto Fernández Capel
868e32c1bc Send edit sessions heartbeat to the analytics service 2018-01-22 15:10:52 +00:00
James Allen
662122bb1c CI and local dev environment improvements
The need for this became very noticeable due to the slowness of filesystem access in docker-in-mac, with a full compile taking over a minute for me in docker. Using make to introduce incremental compile makes this near instantaneous outside of docker (if only a few files have changed), and quick enough inside docker.

With incremental compile via make, it compiles quickly enough that re-compiling and restarting the web service automatically when backend files change is quick enough now. This is how the service is run via docker-compose in https://github.com/sharelatex/sharelatex-dev-environment, so it shouldn't be necessary to manually restart the container each time a coffee file changes.

At the moment Jenkins pull web modules in via the GitSCM plugin, but I believe this is creating a dependency in Jenkins, where any commits to any of the modules causes all of the web branches to rebuild. By doing it via our own scripts we can hopefully avoid this. It also creates a build process which is reproducible locally.

**Note that at the moment in this PR all modules pull from `ja-dockerize-dev` branches, but these should be merged first, and this PR updated to point to the master branches before merging**. This is necessary for other changes to build process/docker-compose workflow.

As well as a Makefile for web, there is now a `Makefile.module`. This is copied into each module directory by the top-level Makefile, and is written in a way to be flexible and support unit tests, acceptance tests, front-end js for the ide and main, and the modules `app/coffee` directory, while allowing modules to have some of these missing (not all modules have e.g. acceptance tests, or front-end JS). This will allows us to refine the build process in future, without needing to update the Makefile in each module repo separately (I found this to be a painful part of this development).

This makes web compatible with the docker-compose workflow at https://github.com/sharelatex/sharelatex-dev-environment, where each service is running in its own docker container, with networking managed by docker.

Previously the Makefile was set up to run unit tests in docker with `make unit_tests`. This now just runs them natively. In the CI, they are run in docker anyway (all steps in Jenkins are), and locally, they run fine natively with `npm run test:unit`, or can be run in docker via https://github.com/sharelatex/sharelatex-dev-environment with `bin/run web_sl npm run test:unit`.

Previously we did a lot of juggling with only mounting source files (coffee, less, etc) into the docker container for acceptance tests. This was to avoid creating root owned files if the whole directory was mounted. Now instead the whole web directory is mounted read-only, with the compilation step done outside of the container before running the tests.

This allows the host and container to share the `node_modules` folder as well, which avoids needing to `npm install` twice on the CI box, and should speed up the build by a few minutes.

On macOS, this would cause a problem with compiled modules if you tried to use the same `node_modules` to run the app natively. However, if running via docker-compose in https://github.com/sharelatex/sharelatex-dev-environment, this is no longer a problem.
2018-01-15 09:36:41 +00:00
Nate Stemen
c43aa54bee Merge branch 'ns-fix-package-command-meta' 2018-01-08 08:53:42 -05:00
Nate Stemen
cf4d6c1165 Merge branch 'master' into ns-no-duplicate-packages 2018-01-05 11:46:44 -05:00
Nate Stemen
d2ee03d9b9 make commandNames object for fast lookups 2017-12-21 15:51:50 -05:00
Nate Stemen
685595ed0a remove comment 2017-12-19 08:44:19 -05:00
Nate Stemen
7d5c661b4e make command names local array 2017-12-15 11:10:44 -05:00
Henry Oswald
cbf656518f remove versioned files from fingerprinting 2017-12-14 11:24:47 +00:00
Nate Stemen
618f04ea7a allow package manager to have access to metadata 2017-12-12 15:14:24 -05:00
Nate Stemen
68b57f8d95 check current commands against package commands 2017-12-12 14:33:11 -05:00
Nate Stemen
9bf5d1e14c removing labels service 2017-12-05 13:57:36 -05:00
Nate Stemen
c2bb8b9f89 removing calls 2017-11-29 13:30:53 -05:00
Nate Stemen
74ba7402de Merge branch 'ns-file-completer' 2017-11-29 09:20:09 -05:00
Nate Stemen
26df9bca05 Merge pull request #136 from sharelatex/ns-autocomplete-bugs
fixing popup and code folding issues
2017-11-28 10:28:54 -05:00
Nate Stemen
2a50a18d23 Merge branch 'ns-package-aware-autocomplete' 2017-11-28 10:24:37 -05:00
Nate Stemen
8ef48925c1 Merge pull request #71 from sharelatex/ns-package-completer
fixing package completer
2017-11-28 08:56:49 -05:00
Brian Gough
69cb93fe64 Merge pull request #139 from sharelatex/bg-fix-spelling-cancel-request
fix the cancellation of spelling requests
2017-11-22 09:45:36 +00:00
Brian Gough
dc71a6a0a1 Merge pull request #113 from sharelatex/bg-prevent-editing-in-broken-ace-session
put ace in readonly mode when changing session
2017-11-22 09:45:19 +00:00
Nate Stemen
2f03bb6015 adding file completer 2017-11-21 11:26:44 -05:00
Alasdair Smith
1a8a915116 Merge pull request #77 from sharelatex/ns-autocomplete-insertion-bug
fix autocomplete insertion on single backslash; Fixes #55
2017-11-20 15:20:45 +00:00
Alasdair Smith
3c0c670b5f Merge pull request #78 from sharelatex/ns-capital-letter-autocomplete-bug
allow for capital letters in commands; Fixes #56
2017-11-20 15:20:18 +00:00
Brian Gough
029e3b1557 fix the cancellation of spelling requests 2017-11-20 12:25:09 +00:00
Nate Stemen
f00dbf3d56 fixing popup and code folding issues 2017-11-17 16:25:45 -05:00
Nate Stemen
00e3e8da9f adding last labels configuration 2017-11-16 14:59:04 -05:00
Nate Stemen
c78a0ae209 removing comment 2017-11-16 14:49:29 -05:00
Nate Stemen
c051316aac adding deleted file 2017-11-16 14:45:20 -05:00
Brian Gough
bd09ef81f2 added comments 2017-11-16 15:41:16 +00:00
Brian Gough
dc6110db8d put ace in readonly mode when changing session
if the session fails to attach successfully (e.g due to an exception in
the changeSession event handler) the editor will be left in a state
where the user will not be able to enter any text.  This should at least
cause them to reload the editor.
2017-11-16 11:32:08 +00:00
Brian Gough
125a5ec606 temporarily avoid exception in ace event handler
full fix will be to use the angular $http cancellation mechanism
2017-11-15 16:28:31 +00:00
Nate Stemen
a78330877b fixing services call 2017-11-15 10:14:31 -05:00
Nate Stemen
428ae3aa53 adding labels service back 2017-11-15 09:27:46 -05:00
Brian Gough
fe12a341e1 Merge pull request #89 from sharelatex/bg-slow-connection-fix
increase allowed op backlog and flush tolerance
2017-11-13 09:22:18 +00:00
Shane Kilkelly
1cedfed1e4 Merge branch 'master' into sk-unlisted-projects 2017-11-02 10:10:09 +00:00
Brian Gough
15997ea782 increase allowed op backlog and flush tolerance 2017-11-01 14:20:07 +00:00
Shane Kilkelly
f9d83c24ef clean-up commented out code 2017-10-26 11:04:59 +01:00
Shane Kilkelly
74c231826d WIP: track changes with token-access 2017-10-25 10:34:18 +01:00
Nate Stemen
e8731bc276 allow for capital letters in command name 2017-10-24 16:55:25 +01:00
Nate Stemen
829595777c change regex to match single backslash and command fragment 2017-10-24 16:35:28 +01:00
Nate Stemen
98909026f5 moving data to backend and fixing tests 2017-10-24 10:59:41 +01:00
Nate Stemen
0ebda89efe fixing package manager issues 2017-10-20 12:04:10 +01:00
Henry Oswald
aff5823a2d Revert "Complete 'usepackage' with packages" 2017-10-17 13:30:47 +01:00
Nate Stemen
2efb6b69e5 removing comment 2017-10-13 17:42:10 +01:00
Nate Stemen
da07a91229 reformated data files with argument data 2017-10-13 17:24:48 +01:00
Nate Stemen
f113ba6342 basic package aware autocomplete 2017-10-12 15:33:14 +01:00
Nate Stemen
cfca4b5d6c modified labels service to include packages aware autocompletion 2017-10-06 17:15:50 +01:00
Nate Stemen
507bb568a3 labels -> metadata 2017-10-05 14:19:30 +01:00
Nate Stemen
8b4843cf8b cleaning up usepackage completion 2017-10-03 17:32:34 +01:00
Nate Stemen
7d5785b98f adding top 100 packages and package tracking 2017-10-02 18:10:53 +01:00
Shane Kilkelly
a66cb15f48 Use angular $http service for spellcheck 2017-09-29 14:55:06 +01:00
Alasdair Smith
96d13215e3 Be more defensive when checking encoded text 2017-09-22 09:36:50 +01:00