diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d337fabb..895955f0b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,10 +8,11 @@ install_dependency: &install_dependency command: | sed -i '/jessie-updates/d' /etc/apt/sources.list apt update - apt install -y openssl ant git zip jq + apt install -y --force-yes openssl ant git zip jq mkdir ~/awscli cd ~/awscli - curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + #curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" + curl https://s3.amazonaws.com/aws-cli/awscli-bundle-1.16.188.zip -o awscli-bundle.zip unzip awscli-bundle.zip ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws cd /usr/share/ant/lib @@ -24,7 +25,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.3 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . diff --git a/components/project_management/src/java/main/com/topcoder/management/project/ProjectGroup.java b/components/project_management/src/java/main/com/topcoder/management/project/ProjectGroup.java index 6f6566e7a..286bec052 100644 --- a/components/project_management/src/java/main/com/topcoder/management/project/ProjectGroup.java +++ b/components/project_management/src/java/main/com/topcoder/management/project/ProjectGroup.java @@ -22,12 +22,20 @@ *
* Changes related to v5-groups-api *
- * - * @author dushyantb - * @version 1.1 + * Version 1.2 (Fixing serilization error for ProjectGroup): + *@@ -532,7 +532,7 @@ public abstract class AbstractInformixProjectPersistence implements ProjectPersi * * @since 1.1.2 */ - public static final long STANDARD_CCA_TERMS_ID = 21343; //21153; //21113; //20713; + public static final long STANDARD_CCA_TERMS_ID = 21374; //21343; //21153; //21113; //20713; diff --git a/conf/ApplicationServer.properties b/conf/ApplicationServer.properties index 76c7d20a5..3ea626d8b 100644 --- a/conf/ApplicationServer.properties +++ b/conf/ApplicationServer.properties @@ -47,4 +47,5 @@ SSO_DOMAIN = @ApplicationServer.SSO_DOMAIN@ JWT_V3_COOKIE_KEY = @ApplicationServer.JWT_V3_COOKIE_KEY@ JWT_COOKIE_KEY = @ApplicationServer.JWT_COOKIE_KEY@ -TOPCODER_CONNECT_URL=@TopcoderConnectUrl@ \ No newline at end of file +TOPCODER_CONNECT_URL=@TopcoderConnectUrl@ +TOPCODER_NEW_AUTH_URL=@TopcoderNewAuthUrl@ diff --git a/services/contest_service_facade/build.version b/services/contest_service_facade/build.version index c10ca44fe..e08a51751 100644 --- a/services/contest_service_facade/build.version +++ b/services/contest_service_facade/build.version @@ -4,6 +4,6 @@ component.distfilename=contest_service_facade component.package=com.topcoder.service.facade.contest component.packagedir=com/topcoder/service/facade/contest component.version.major=1 -component.version.minor=1 +component.version.minor=2 component.version.micro=0 component.version.build=1 diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java index 70d9ce871..6002cbbf4 100644 --- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java +++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ContestServiceFacade.java @@ -595,7 +595,33 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject,SoftwareCom */ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException; - + + /** + *
+ * Creates a new SoftwareCompetition
in the persistence.
+ *
+ * Update in v1.5.1: add parameter TCSubject which contains the security info for current user. + *
+ * @param tcSubject TCSubject instance contains the login security info for the current user + * @param contest theSoftwareCompetition
to create as a contest
+ * @param tcDirectProjectId the TC direct project id. a long
providing the ID of a client the new
+ * competition belongs to.
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
+ * @param endDate the end date for submission phase. Can be null if to use default.
+ * @param skipForum true if skip forum creation
+ * @return the created SoftwareCompetition
as a contest
+ * @throws IllegalArgumentException if the input argument is invalid.
+ * @throws ContestServiceException if an error occurs when interacting with the service layer.
+ * @since 1.6.4
+ */
+ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
+ long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException;
+
/**
*
* Creates a new SoftwareCompetition
in the persistence.
@@ -614,7 +640,28 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
*/
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException;
-
+
+ /**
+ *
+ * Creates a new SoftwareCompetition
in the persistence.
+ *
SoftwareCompetition
to create as a contest
+ * @param tcDirectProjectId the TC direct project id. a long
providing the ID of a client the new
+ * competition belongs to.
+ * @param regEndDate the registration end date
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround if it's null.
+ * @param endDate the end date for submission phase. Can be null if to use default.
+ * @param skipForum true if no need to create the forum
+ * @return the created SoftwareCompetition
as a contest
+ * @throws IllegalArgumentException if the input argument is invalid.
+ * @throws ContestServiceException if an error occurs when interacting with the service layer.
+ */
+ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
+ long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate, boolean skipForum) throws ContestServiceException, PermissionServiceException;
+
+
/**
* * BURG-1716: We need to add a method to get software contest by project id, @@ -685,7 +732,7 @@ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, */ public SoftwareCompetition updateSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest, long tcDirectProjectId, Date multiRoundEndDate, Date endDate) throws ContestServiceException, PermissionServiceException; - + /** *
* Updates a SoftwareCompetition
in the persistence.
diff --git a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java
index 494e17fca..49928ae8d 100644
--- a/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java
+++ b/services/contest_service_facade/src/java/main/com/topcoder/service/facade/contest/ejb/ContestServiceFacadeBean.java
@@ -3635,7 +3635,56 @@ private void checkContestBillingAccount(long billingAccountId, long directProjec
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
long tcDirectProjectId, Date multiRoundEndDate, Date endDate)
throws ContestServiceException, PermissionServiceException {
- return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null);
+ return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, false);
+ }
+
+ /**
+ *
+ * Creates a new SoftwareCompetition
in the persistence.
+ *
+ * Update in v1.5.1: add parameter TCSubject which contains the security info + * for current user. + *
+ * + *+ * Update in v1.8.3: Add handling of auto creation of bug hunt for assembly + * competition. If the assembly contest has bugHuntProjectHeader set and the + * properties not empty in bugHuntProjectHeader. A bug hunt contest is + * automatically created. The bug hunt contest will - have copilot inserted as + * reviewer (if exists) - use the start date of approval date as the start date + * and producation date of bug hunt contest. - add a "Bug Race For" link between + * the bug race contest and assembly contest + *
+ * + * @param tcSubject TCSubject instance contains the login security info + * for the current user + * @param contest theSoftwareCompetition
to create as a
+ * contest
+ * @param tcDirectProjectId the TC direct project id. a long
+ * providing the ID of a client the new competition
+ * belongs to.
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround
+ * if it's null.
+ * @param endDate the end date for submission phase. Can be null if to
+ * use default.
+ * @param skipForum true if no need to create the forum
+ * @return the created SoftwareCompetition
as a contest
+ * @throws IllegalArgumentException if the input argument is invalid.
+ * @throws ContestServiceException if an error occurs when interacting with the
+ * service layer.
+ * @since 1.6.6
+ */
+ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
+ long tcDirectProjectId, Date multiRoundEndDate, Date endDate, boolean skipForum)
+ throws ContestServiceException, PermissionServiceException {
+ return createSoftwareContest(tcSubject, contest, tcDirectProjectId, null, null, null, skipForum);
}
/**
@@ -3663,8 +3712,41 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate)
throws ContestServiceException, PermissionServiceException {
- logger.debug("createSoftwareContest with information : [tcSubject = " + tcSubject.getUserId()
- + ", tcDirectProjectId =" + tcDirectProjectId + ", multiRoundEndDate = " + multiRoundEndDate + "]");
+ return createSoftwareContest(
+ tcSubject, contest, tcDirectProjectId, regEndDate, multiRoundEndDate, endDate, false);
+ }
+
+ /**
+ *
+ * Creates a new SoftwareCompetition
in the persistence.
+ *
SoftwareCompetition
to create as a
+ * contest
+ * @param tcDirectProjectId the TC direct project id. a long
+ * providing the ID of a client the new competition
+ * belongs to.
+ * @param regEndDate the registration end date
+ * @param multiRoundEndDate the end date for the multiround phase. No multiround
+ * if it's null.
+ * @param endDate the end date for submission phase. Can be null if to
+ * use default.
+ * @param skipForum true if no need to create the forum
+ *
+ * @return the created SoftwareCompetition
as a contest
+ * @throws IllegalArgumentException if the input argument is invalid.
+ * @throws ContestServiceException if an error occurs when interacting with the
+ * service layer.
+ */
+ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCompetition contest,
+ long tcDirectProjectId, Date regEndDate, Date multiRoundEndDate, Date endDate, boolean skipForum)
+ throws ContestServiceException, PermissionServiceException {
+ logger.info("createSoftwareContest with information : [tcSubject = " + tcSubject.getUserId()
+ + ", tcDirectProjectId =" + tcDirectProjectId
+ + ", multiRoundEndDate = " + multiRoundEndDate
+ + ", skipForum = " + String.valueOf(skipForum) + "]");
try {
ExceptionUtils.checkNull(contest, null, null, "The contest to create is null.");
@@ -3715,7 +3797,7 @@ public SoftwareCompetition createSoftwareContest(TCSubject tcSubject, SoftwareCo
checkBillingProjectCCA(contest);
// update the AssetDTO and update corresponding properties
- createUpdateAssetDTO(tcSubject, contest);
+ createUpdateAssetDTO(tcSubject, contest, skipForum);
com.topcoder.management.resource.Resource[] contestResources = createContestResources(tcSubject, contest,
billingProjectId, requireApproval);
@@ -4015,10 +4097,11 @@ private boolean shouldAutoCreateBugHuntContest(SoftwareCompetition contest) {
* @param tcSubject TCSubject instance contains the login security info for the
* current user
* @param contest the contest
+ * @param skipForum true if no need to create forum
* @throws EntityNotFoundException if any error occurs
* @throws com.topcoder.catalog.service.PersistenceException if any error occurs
*/
- private void createUpdateAssetDTO(TCSubject tcSubject, SoftwareCompetition contest) throws EntityNotFoundException,
+ private void createUpdateAssetDTO(TCSubject tcSubject, SoftwareCompetition contest, boolean skipForum) throws EntityNotFoundException,
com.topcoder.catalog.service.PersistenceException, DAOException, ConfigManagerException {
// check if it is going to create development contest
boolean isDevContest = isDevContest(contest);
@@ -4055,7 +4138,7 @@ else if (isDevContest) {
}
long forumId = 0;
// create forum
- if (createForum) {
+ if (createForum && !skipForum) {
if (useExistingAsset && assetDTO.getForum() != null) {
forumId = assetDTO.getForum().getJiveCategoryId();
} else {
@@ -4072,6 +4155,8 @@ else if (isDevContest) {
}
}
}
+ } else {
+ logger.info("Skip forum creation");
}
// if forum created
diff --git a/src/java/main/com/topcoder/direct/services/configs/ServerConfiguration.java b/src/java/main/com/topcoder/direct/services/configs/ServerConfiguration.java
index 4fef7be92..79e146711 100644
--- a/src/java/main/com/topcoder/direct/services/configs/ServerConfiguration.java
+++ b/src/java/main/com/topcoder/direct/services/configs/ServerConfiguration.java
@@ -63,4 +63,9 @@ public class ServerConfiguration extends ApplicationServer {
* The Topcoder Connect URL
*/
public static String TOPCODER_CONNECT_URL = bundle.getProperty("TOPCODER_CONNECT_URL", "https://connect.topcoder.com");
+
+ /**
+ * Topcoder - New Auth URL to refresh token
+ */
+ public static String TOPCODER_NEW_AUTH_URL = bundle.getProperty("TOPCODER_NEW_AUTH_URL", "");
}
diff --git a/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java b/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java
index 2cf7da282..35fbadda6 100644
--- a/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java
+++ b/src/java/main/com/topcoder/direct/services/view/ajax/CustomFormatAJAXResult.java
@@ -8,6 +8,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.net.SocketException;
import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.util.zip.GZIPOutputStream;
@@ -24,6 +25,7 @@
import com.topcoder.direct.services.view.action.contest.launch.AggregateDataModel;
import com.topcoder.direct.services.view.ajax.processors.DefaultAJAXResultPreProcessor;
import com.topcoder.direct.services.view.ajax.serializers.JSONDataSerializer;
+import org.apache.log4j.Logger;
/**
* @@ -81,6 +83,13 @@ *
* *+ * Version 1.2 + *
* Thread safety: Technically this class is NOT thread safe since it has mutable states, but the intended * usage of the mutators is for IoC injection and thus we expect for these values not to be changed after * initialization. Thus this class can be considered as thread-safe conditional in an IoC injection usage of @@ -88,7 +97,7 @@ *
* * @author AleaActaEst, TCSDEVELOPER, duxiaoyang - * @version 1.1 + * @version 1.2 */ @SuppressWarnings("serial") public class CustomFormatAJAXResult implements Result { @@ -177,6 +186,8 @@ public class CustomFormatAJAXResult implements Result { */ private boolean enabledGzip = false; + private Logger logger = Logger.getLogger(CustomFormatAJAXResult.class); + /** ** Default constructor. @@ -290,7 +301,7 @@ public void execute(ActionInvocation invocation) throws AJAXDataPreProcessingExc * @throws IOException * if any io error happens */ - private static void writeDataAndClose(InputStream in, OutputStream out) throws IOException { + private void writeDataAndClose(InputStream in, OutputStream out) throws IOException { try { // Write input stream to output stream byte[] buf = new byte[BUFFER_SIZE]; @@ -300,11 +311,14 @@ private static void writeDataAndClose(InputStream in, OutputStream out) throws I } // flush output stream out.flush(); + } catch (IOException e) { + // The client side has aborted or closed connection + logger.error("The client side has aborted or closed connection", e); } finally { // close the input stream closeStream(in); // close the output stream - out.close(); + closeStream(out); } } diff --git a/src/java/main/com/topcoder/direct/services/view/util/DirectUtils.java b/src/java/main/com/topcoder/direct/services/view/util/DirectUtils.java index 7d7a46ecb..85c3aaba7 100644 --- a/src/java/main/com/topcoder/direct/services/view/util/DirectUtils.java +++ b/src/java/main/com/topcoder/direct/services/view/util/DirectUtils.java @@ -1041,7 +1041,7 @@ public final class DirectUtils { /** * Default value url parameter perPage */ - private static final String PER_PAGE_VALUE = "1000"; + private static final String PER_PAGE_VALUE = "2000"; /** * The jackson object mapping which is used to deserialize json return from API to domain model. @@ -3876,6 +3876,7 @@ public static Set