diff --git a/.circleci/config.yml b/.circleci/config.yml index 743e95a8..dc84e383 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2 defaults: &defaults docker: - - image: cimg/python:3.12.1-browsers + - image: cimg/python:3.12.1-browsers install_dependency: &install_dependency name: Installation of build and deployment dependencies. command: | @@ -20,32 +20,32 @@ restore_cache_settings_for_build: &restore_cache_settings_for_build save_cache_settings: &save_cache_settings key: docker-node-modules-{{ checksum "yarn.lock" }} paths: - - node_modules + - node_modules builddeploy_steps: &builddeploy_steps -- checkout -- setup_remote_docker -- run: *install_dependency -- run: *install_deploysuite -- restore_cache: *restore_cache_settings_for_build -- run: - name: "Authenticate with CodeArtifact and build Docker image" - command: | - ./awsconfiguration.sh ${CODEARTIFACT_ENV} - source awsenvconf - aws codeartifact login --tool npm --repository topcoder-framework --domain topcoder --domain-owner $AWS_ACCOUNT_ID --region $AWS_REGION --namespace @topcoder-framework - cp ~/.npmrc . - rm -f awsenvconf - ./build.sh ${APPNAME} -- save_cache: *save_cache_settings -- deploy: - name: Running MasterScript. - command: | - ./awsconfiguration.sh $DEPLOY_ENV - source awsenvconf - ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar - source buildenvvar - ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME} + - checkout + - setup_remote_docker + - run: *install_dependency + - run: *install_deploysuite + - restore_cache: *restore_cache_settings_for_build + - run: + name: "Authenticate with CodeArtifact and build Docker image" + command: | + ./awsconfiguration.sh ${CODEARTIFACT_ENV} + source awsenvconf + aws codeartifact login --tool npm --repository topcoder-framework --domain topcoder --domain-owner $AWS_ACCOUNT_ID --region $AWS_REGION --namespace @topcoder-framework + cp ~/.npmrc . + rm -f awsenvconf + ./build.sh ${APPNAME} + - save_cache: *save_cache_settings + - deploy: + name: Running MasterScript. + command: | + ./awsconfiguration.sh $DEPLOY_ENV + source awsenvconf + ./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar + source buildenvvar + ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME} jobs: # Build & Deploy against development backend "build-dev": @@ -79,27 +79,26 @@ workflows: version: 2 build: jobs: - # Development builds are executed on "develop" branch only. - - "build-dev": - context: org-global - filters: - branches: - only: - - dev - - feature/top-262-projectid-non-mandatory - - TOP-2364 + # Development builds are executed on "develop" branch only. + - "build-dev": + context: org-global + filters: + branches: + only: + - dev + - TOP-2433-challenge-not-found - - "build-qa": - context: org-global - filters: - branches: - only: - - qa + - "build-qa": + context: org-global + filters: + branches: + only: + - qa - # Production builds are exectuted only on tagged commits to the - # master branch. - - "build-prod": - context: org-global - filters: - branches: - only: master + # Production builds are exectuted only on tagged commits to the + # master branch. + - "build-prod": + context: org-global + filters: + branches: + only: master diff --git a/src/services/ChallengeService.js b/src/services/ChallengeService.js index d11390a3..4db9d558 100644 --- a/src/services/ChallengeService.js +++ b/src/services/ChallengeService.js @@ -458,6 +458,19 @@ async function searchChallenges(currentUser, criteria) { let sortByProp = criteria.sortBy ? criteria.sortBy : "created"; + // Reverting change to test TOP-2433 fix + // Add '.keyword' to the end of the sort by prop for certain fields + // (TOP-2364) + if ( + sortByProp == "updatedBy" || + sortByProp == "createdBy" || + sortByProp == "name" || + sortByProp == "type" || + sortByProp == "status" + ) { + sortByProp = sortByProp + ".keyword"; + } + const sortOrderProp = criteria.sortOrder ? criteria.sortOrder : "desc"; const mustQuery = []; @@ -706,7 +719,7 @@ async function searchChallenges(currentUser, criteria) { }, }; - logger.info(`ES Query: ${JSON.stringify(esQuery)}`) + logger.info(`ES Query: ${JSON.stringify(esQuery)}`); // Search with constructed query let docs; try { @@ -2086,7 +2099,7 @@ updateChallenge.schema = { .unknown(true) ) .optional(), - overview: Joi.any().forbidden() + overview: Joi.any().forbidden(), }) .unknown(true) .required(), @@ -2525,14 +2538,13 @@ async function updateLegacyPayout(currentUser, challengeId, data) { updateLegacyPayout.schema = { currentUser: Joi.any(), challengeId: Joi.id(), - data: Joi.object() - .keys({ - userId: Joi.number().integer().positive().required(), - amount: Joi.number().allow(null), - status: Joi.string().allow(null), - datePaid: Joi.string().allow(null), - releaseDate: Joi.string().allow(null), - }) + data: Joi.object().keys({ + userId: Joi.number().integer().positive().required(), + amount: Joi.number().allow(null), + status: Joi.string().allow(null), + datePaid: Joi.string().allow(null), + releaseDate: Joi.string().allow(null), + }), }; /**