Skip to content

Commit 5c79efe

Browse files
authored
Merge pull request #482 from datacamp/fix/queue-parsing
[CT-3601] Update API to not handle some sections as custom
2 parents 36592cc + 25d0a94 commit 5c79efe

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

Diff for: README.md

+23-7
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ R documentation sifts through all CRAN, GitHub and BioConductor packages hourly,
77
The RDocs project is completely open-source. This repository contains the source code for the NodeJS web application that serves [www.rdocumentation.org](https://www.rdocumentation.org). For other codebases, you can check out [`CONTRIBUTING.md`](CONTRIBUTING.md).
88

99
## Features
10-
- Quick search through all packages and functions
11-
10+
11+
- Quick search through all packages and functions
12+
1213
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
13-
14+
1415
- Complete search through all packages and function
15-
16+
1617
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
17-
18+
1819
- Easily assess package quality
1920

2021
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
2122

22-
- Post *community examples* to help the community understand how to use a function
23+
- Post _community examples_ to help the community understand how to use a function
2324

2425
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
2526

26-
2727
## What this app does
2828

2929
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
@@ -33,19 +33,33 @@ This application is part the rdocumentation project. This app is responsible for
3333
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
3434

3535
## Issue/Feature request
36+
3637
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
3738

3839
## Development
3940

4041
### Using docker
42+
4143
You'll need docker and docker-compose to run this stack locally
4244

4345
- Copy the .env.sample to .env and change relevant variables
4446
- `docker-compose create` to create the redis and mysql container
4547
- `docker-compose start` to fire up a local redis an mysql
48+
- Use the same node version in your terminal as the Dockerfile is using: `nvm use 8.16`
49+
- `npm install`
4650
- Run the database migrations by doing `npm run migrate`
4751
- `npm run start-dev`
4852

53+
### Troubleshooting
54+
55+
If you get an error: `SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client`
56+
follow these steps:
57+
58+
1. Access your mysql container: you can do it either through the docker app by clicking on the "cli" button of the container, or in your terminal by running `docker exec -it <mysql_container_id> bash`
59+
2. `mysql -u root -p`
60+
3. Enter: `password`
61+
4. `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'`
62+
4963
## How to deploy
5064

5165
- To deploy to stating (rdocumentation.datacamp-staging.com), merge to master
@@ -56,13 +70,15 @@ The rdocumentation app is hosted on DataCamp's infrastructure, on our AWS ECS cl
5670
## What the CI does
5771

5872
This application runs on the DataCamp infrastructure. Our custom CI flow will:
73+
5974
- Build a docker image
6075
- Upload it the ECR
6176
- Deploy the new version to ECS
6277

6378
## How to contribute
6479

6580
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
81+
6682
- Report when some packages are missing/outdated/incorrect by creating an issue.
6783
- Report bugs.
6884
- Help us improves by proposing features.

Diff for: api/models/Topic.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,12 @@ module.exports = {
233233
topic.usage = topic.usage.contents;
234234
}
235235

236+
if (topic.description !== null && typeof topic.description === 'object') {
237+
topic.description = topic.description.contents;
238+
}
239+
236240
topic.examples = sanitizeHtml(topic.examples, {
237-
allowedTags: ['a' ],
241+
allowedTags: [],
238242
allowedAttributes: {}
239243
});
240244

@@ -315,11 +319,6 @@ module.exports = {
315319
'sourceJSON'])
316320
);
317321

318-
var topicArguments = _.isEmpty(rdJSON.arguments) ? [] : rdJSON.arguments.map(function(argument) {
319-
var arg = _.mapValues(argument, arrayToString);
320-
return _.merge({}, arg, {topic_id: topicInstance.id});
321-
});
322-
323322
var aliases = rdJSON.aliases && !(rdJSON.aliases instanceof Array) ? [rdJSON.aliases] : rdJSON.aliases;
324323
var aliasesRecords = _.isEmpty(aliases) ? [] : aliases.map(function(alias) {
325324
return {name: alias, topic_id: topicInstance.id};
@@ -332,10 +331,8 @@ module.exports = {
332331
});
333332

334333
return Promise.all([
335-
topicInstance.removeArguments(topicInstance.arguments),
336334
topicInstance.removeSections(topicInstance.sections),
337335
topicInstance.removeAliases(topicInstance.aliases),
338-
Argument.bulkCreate(topicArguments, {transaction: t}),
339336
Alias.bulkCreate(aliasesRecords, {transaction: t}),
340337
Section.bulkCreate(sections, {transaction: t}),
341338
topicInstance.setKeywords(keywordsInstances, {transaction: t }),

0 commit comments

Comments
 (0)