Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

skill & skillsProvider removal #126

Open
wants to merge 5 commits into
base: feature/removing_skill_model
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ Configuration for the application is at config/default.js and config/production.
- ES_HOST: Elasticsearch host
- ES.DOCUMENTS: Elasticsearch index, type and id mapping for resources.
- ATTRIBUTE_GROUP_PIPELINE_ID: The pipeline id for enrichment with attribute group. Default is `attributegroup-pipeline`
- SKILL_PROVIDER_PIPELINE_ID: The pipeline id for enrichment with skill provider. Default is `skillprovider-pipeline`
- USER_PIPELINE_ID: The pipeline id for enrichment of user details. Default is `user-pipeline`
- ATTRIBUTE_GROUP_ENRICH_POLICYNAME: The enrich policy for attribute group. Default is `attributegroup-policy`
- SKILL_PROVIDER_ENRICH_POLICYNAME: The enrich policy for skill provider. Default is `skillprovider-policy`
- ROLE_ENRICH_POLICYNAME: The enrich policy for role. Default is `role-policy`
- ACHIEVEMENT_PROVIDER_ENRICH_POLICYNAME: The enrich policy for achievement provider. Default is `achievementprovider-policy`
- SKILL_ENRICH_POLICYNAME: The enrich policy for skill. Default is `skill-policy`
- ATTRIBUTE_ENRICH_POLICYNAME: The enrich policy for skill. Default is `attribute-policy`
- ELASTICCLOUD_ID: The elastic cloud id, if your elasticsearch instance is hosted on elastic cloud. DO NOT provide a value for ES_HOST if you are using this
- ELASTICCLOUD_USERNAME: The elastic cloud username for basic authentication. Provide this only if your elasticsearch instance is hosted on elastic cloud
Expand Down Expand Up @@ -105,3 +102,8 @@ Make sure all config values are right, and you can run on local successfully, th
5. When you are running the application for the first time, It will take some time initially to download the image and install the dependencies

You can also head into `docker-pgsql-es` folder and run `docker-compose up -d` to have docker instances of pgsql and elasticsearch to use with the api

## Testing

- Run `npm run test` to execute unit tests
- Run `npm run test:cov` to execute unit tests and generate coverage report.
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ app.use('*', (req, res) => {
logger.info(`Express server listening on port ${app.get('port')}`)
})
})()

if (process.env.NODE_ENV === 'test') {
module.exports = app
}
12 changes: 1 addition & 11 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
BUSAPI_URL: process.env.BUSAPI_URL || 'https://api.topcoder-dev.com/v5',

TOPCODER_GROUP_API: process.env.TOPCODER_GROUP_API || 'https://api.topcoder-dev.com/v5/groups',
TOPCODER_SKILL_API: process.env.TOPCODER_SKILL_API || 'https://api.topcoder-dev.com/v5/skills',

KAFKA_ERROR_TOPIC: process.env.KAFKA_ERROR_TOPIC || 'common.error.reporting',
KAFKA_MESSAGE_ORIGINATOR: process.env.KAFKA_MESSAGE_ORIGINATOR || 'u-bahn-api',
Expand Down Expand Up @@ -101,17 +102,6 @@ module.exports = {
type: '_doc',
enrichPolicyName: process.env.ROLE_ENRICH_POLICYNAME || 'role-policy'
},
skill: {
index: process.env.SKILL_INDEX || 'skill',
type: '_doc',
enrichPolicyName: process.env.SKILL_ENRICH_POLICYNAME || 'skill-policy'
},
skillprovider: {
index: process.env.SKILL_PROVIDER_INDEX || 'skill_provider',
type: '_doc',
pipelineId: process.env.SKILL_PROVIDER_PIPELINE_ID || 'skillprovider-pipeline',
enrichPolicyName: process.env.SKILL_PROVIDER_ENRICH_POLICYNAME || 'skillprovider-policy'
},
user: {
index: process.env.USER_INDEX || 'user',
type: '_doc',
Expand Down
8 changes: 8 additions & 0 deletions config/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
AUTH0_URL: 'https://topcoder-dev.auth0.com/oauth/token',
AUTH0_AUDIENCE: 'https://m2m.topcoder-dev.com/',
TOKEN_CACHE_TIME: 6000,
AUTH0_CLIENT_ID: 'client_id',
AUTH0_CLIENT_SECRET: 'secret',
AUTH0_PROXY_SERVER_URL: 'proxy_url'
}
Loading