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

For #469: Create private fork when users register #108

Merged
merged 2 commits into from
Aug 25, 2023
Merged
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: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"node": true,
"mocha": true
},
"plugins": [
"jsdoc"
],
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
Expand Down Expand Up @@ -43,6 +46,7 @@
}
],
"max-lines": 0,
"max-statements": 0
"max-statements": 0,
"valid-jsdoc": 0
}
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
*.cer
*.key
.idea

.env
.envrc
3 changes: 2 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ module.exports = {
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
PARTITION: process.env.PARTITION || 0,
TOPIC: process.env.TOPIC || 'tc-x-events',
TOPIC_CHALLENGE_ACTION_RESOURCE_CREATE: process.env.TOPIC_CHALLENGE_ACTION_RESOURCE_CREATE || 'challenge.action.resource.create',
TOPIC_NOTIFICATION: process.env.TOPIC_NOTIFICATION || 'notifications.action.create',
KAFKA_OPTIONS: {
connectionString: process.env.KAFKA_URL || 'localhost:9092',
groupId: process.env.KAFKA_GROUP_ID || 'topcoder-x-processor',
ssl: {
ssl: process.env.KAFKA_DISABLE_SSL ? false : {
cert: process.env.KAFKA_CLIENT_CERT || fs.readFileSync('./kafka_client.cer'), // eslint-disable-line no-sync
key: process.env.KAFKA_CLIENT_CERT_KEY || fs.readFileSync('./kafka_client.key'), // eslint-disable-line no-sync
passphrase: 'secret', // NOTE:* This configuration specifies the private key passphrase used while creating it.
Expand Down
12 changes: 11 additions & 1 deletion constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,20 @@ const ISSUE_STATUS = {
CHALLENGE_PAYMENT_FAILED: 'challenge_payment_failed'
};

const GITLAB_ACCESS_LEVELS = {
NO_ACCESS: 0,
GUEST: 10,
REPORTER: 20,
DEVELOPER: 30,
MAINTAINER: 40,
OWNER: 50
};

module.exports = {
USER_ROLES,
USER_TYPES,
SERVICE_ERROR_STATUS,
CHALLENGE_STATUS,
ISSUE_STATUS
ISSUE_STATUS,
GITLAB_ACCESS_LEVELS
};
16 changes: 5 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Use the base image with Node.js
FROM node:8.12
FROM node:20

# Copy the current directory into the Docker image
COPY . /topcoder-x-processor

# Set working directory for future use
WORKDIR /topcoder-x-processor
COPY package.json package-lock.json ./
RUN npm ci --silent --legacy-peer-deps
COPY . .

# Install the dependencies from package.json
RUN npm install
#RUN npm run build
#RUN npm run test

CMD npm start
CMD npm start
34 changes: 34 additions & 0 deletions models/ProjectChallengeMapping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2017 TopCoder, Inc. All rights reserved.
*/
'use strict';

/**
* This defines TCX project to TC challenge mapping model.
*/
const dynamoose = require('dynamoose');

const Schema = dynamoose.Schema;

const schema = new Schema({
id: {
type: String,
required: true,
hashKey: true
},
projectId: {
type: String,
required: true,
index: {
global: true,
project: true,
name: 'ProjectIdIndex'
}
},
challengeId: {
type: String,
required: true
}
});

module.exports = schema;
1 change: 1 addition & 0 deletions models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if (process.env.CREATE_DB) {
const models = {
Issue: dynamoose.model('Topcoder_X.Issue', require('./Issue')),
Project: dynamoose.model('Topcoder_X.Project', require('./Project')),
ProjectChallengeMapping: dynamoose.model('Topcoder_X.ProjectChallengeMapping', require('./ProjectChallengeMapping')),
User: dynamoose.model('Topcoder_X.User', require('./User')),
CopilotPayment: dynamoose.model('Topcoder_X.CopilotPayment', require('./CopilotPayment')),
GithubUserMapping: dynamoose.model('Topcoder_X.GithubUserMapping', require('./GithubUserMapping')),
Expand Down
Loading