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

Improve challenge visibility control #501

Merged
merged 4 commits into from
Jun 19, 2017
Merged

Conversation

TheOsch
Copy link
Contributor

@TheOsch TheOsch commented Jun 15, 2017

No description provided.

}, function (res, cb) {
if (res.exists.length === 0 || Boolean(res.exists[0].is_studio) !== isStudio) {
// If the record with this callengeId doesn't exist in contest_eligibility table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheOsch it is possible that there is no records, which mean the challenge is pubic group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@skyhit
Copy link
Contributor

skyhit commented Jun 16, 2017

@skyhit skyhit closed this Jun 16, 2017
@skyhit skyhit reopened this Jun 16, 2017
@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 16, 2017

We discussed it with Tony Jefts yesterday. In fact, the validateChallenge function (where the link in the challenge spec points to) is used only in actions that get checkpoints.
So there are many more fragments in the code besides the registration that need to be changed too.
We agreed that i'll make the PR with only verifyChallenge updated just to check the approach itself, but it will not be the end of the job, and next we will find all places in the code that need to be changed and fix them. Including registration.

@skyhit
Copy link
Contributor

skyhit commented Jun 16, 2017

@TheOsch I see

@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 16, 2017

@skyhit I looked at the list of actions at routes.js and wrote done all that look like in scope. When you'll have time would you please briefly look at this list and prompt me if there are some actions in the list that have nothing in common with our task, or maybe I missed some? I think you know the API much better than I, and it will save us a lot of time.

get: [
{ path: "/:apiVersion/challenges/registrants/:challengeId", action: "getRegistrants" },
{ path: "/:apiVersion/challenges/submissions/:challengeId/mySubmissions", action: "getUserSubmissions" },
{ path: "/:apiVersion/challenges/submissions/:challengeId", action: "getSubmissions" },
{ path: "/:apiVersion/challenges/phases/:challengeId", action: "getPhases" },
{ path: "/:apiVersion/challenges/active", action: "getActiveChallenges" },
{ path: "/:apiVersion/challenges/open", action: "getOpenChallenges" },
{ path: "/:apiVersion/challenges/upcoming", action: "getUpcomingChallenges" },
{ path: "/:apiVersion/challenges/past", action: "getPastChallenges" },
YES { path: "/:apiVersion/challenges/:challengeId", action: "getChallenge" },
{ path: "/:apiVersion/challenges", action: "searchSoftwareAndStudioChallenges" },
{ path: "/:apiVersion/develop/challenges/result/:challengeId", action: "getSoftwareChallengeResults" },
YES { path: "/:apiVersion/develop/challenges/:challengeId", action: "getSoftwareChallenge" },
{ path: "/:apiVersion/develop/challenges", action: "searchSoftwareChallenges" },
{ path: "/:apiVersion/develop/reviewOpportunities/:challengeId", action: "getSoftwareReviewOpportunity" },
{ path: "/:apiVersion/develop/reviewOpportunities", action: "searchReviewOpportunities" },
{ path: "/:apiVersion/design/challenges/result/:challengeId", action: "getStudioChallengeResults" },
{ path: "/:apiVersion/design/reviewOpportunities/:id", action: "getStudioReviewOpportunity" },
YES { path: "/:apiVersion/design/challenges/:challengeId", action: "getStudioChallenge" },
{ path: "/:apiVersion/design/challenges", action: "searchStudioChallenges" },
{ path: "/:apiVersion/design/reviewOpportunities", action: "getStudioReviewOpportunities" },
{ path: "/:apiVersion/design/download/:submissionId", action: "downloadDesignSubmission" },
{ path: "/:apiVersion/software/reviewers/:contestType", action: "getChallengeReviewers" },
],
post: [
{ path: "/:apiVersion/develop/reviewOpportunities/:challengeId/apply", action: "applyDevelopReviewOpportunity" },
{ path: "/:apiVersion/develop/challenges/:challengeId/submit", action: "submitForDevelopChallenge" },
{ path: "/:apiVersion/develop/challenges/:challengeId/upload", action: "uploadForDevelopChallenge" },
{ path: "/:apiVersion/design/challenges/:challengeId/submit", action: "submitForDesignChallenge" },
{ path: "/:apiVersion/design/reviewOpportunities/:challengeId/apply", action: "applyDesignReviewOpportunity" },
]

@skyhit
Copy link
Contributor

skyhit commented Jun 16, 2017

@ajefts since we are using v3 apis, I think some of the apis above are not used anymore.

@ajefts
Copy link
Contributor

ajefts commented Jun 16, 2017

@TheOsch Where does TC_API_V3_URL get read from?

@ajefts
Copy link
Contributor

ajefts commented Jun 16, 2017

@skyhit Yes, let's review the list when you have time. We won't need to update all of those.

@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 16, 2017

@ajefts

Where does TC_API_V3_URL get read from?

From the environment. For example, one can run the command like
set TC_API_V3_URL=https://real.api.topcoder.com/v3/ (in Windows) or export TC_API_V3_URL=https://real.api.topcoder.com/v3/ (in Unix) before npm start.

let's review the list

Meanwhile i'll work on challengeRegistration.js . Already began working on it, will commit tomorrow.

The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.
@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 18, 2017

Committed. Sorry for a delay. What's next?

@skyhit skyhit merged commit 0ab234a into topcoder-archive:dev Jun 19, 2017
@skyhit
Copy link
Contributor

skyhit commented Jun 19, 2017

@TheOsch we will test the current logic in dev, then we can decide the next step

@skyhit
Copy link
Contributor

skyhit commented Jun 19, 2017

@TheOsch can you future make the changes to getSoftwareChallenge related logic?

@skyhit
Copy link
Contributor

skyhit commented Jun 19, 2017

@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 19, 2017

@skyhit Easily. Changing both actions (getSoftwareChallenge and getRegistrants) will take one day, I can make it by tomorrow.

@TheOsch
Copy link
Contributor Author

TheOsch commented Jun 20, 2017

@skyhit Merged changes you made into my own fork, updated and made another PR.
#504

ajefts added a commit that referenced this pull request Jun 20, 2017
* Improve challenge visibility control (#501)

* IMPROVE CHALLENGE VISIBILITY CONTROL
(https://www.topcoder.com/challenge-details/30057891/?type=develop)

Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc

* Restoring an accidentially modified file

* Fixed the case with a challenge that doesn't have eligibility

* Shared the eligibility verification with challengeRegistration.
The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.

* improve the query

* update query for groups (#502)

* Update queries (#503)

improve logging for v3 api call

* should use externalToken field name
skyhit pushed a commit that referenced this pull request Jun 20, 2017
* Improve challenge visibility control (#501)

* IMPROVE CHALLENGE VISIBILITY CONTROL
(https://www.topcoder.com/challenge-details/30057891/?type=develop)

Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc

* Restoring an accidentially modified file

* Fixed the case with a challenge that doesn't have eligibility

* Shared the eligibility verification with challengeRegistration.
The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.

* improve the query

* update query for groups (#502)

* Update queries (#503)

improve logging for v3 api call

* should use externalToken field name

* update queries for group checking

* Improve challenge visibility control: getChallenge and getRegistrants (#504)

* IMPROVE CHALLENGE VISIBILITY CONTROL
(https://www.topcoder.com/challenge-details/30057891/?type=develop)

Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc

* Restoring an accidentially modified file

* Fixed the case with a challenge that doesn't have eligibility

* Shared the eligibility verification with challengeRegistration.
The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.

* Improve challenge visibility control: getChallenge and getRegistrants

* revert commit
@skyhit skyhit mentioned this pull request Jun 21, 2017
skyhit added a commit that referenced this pull request Jun 21, 2017
* Improve challenge visibility control (#501)

* IMPROVE CHALLENGE VISIBILITY CONTROL
(https://www.topcoder.com/challenge-details/30057891/?type=develop)

Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc

* Restoring an accidentially modified file

* Fixed the case with a challenge that doesn't have eligibility

* Shared the eligibility verification with challengeRegistration.
The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.

* improve the query

* update query for groups (#502)

* Update queries (#503)

improve logging for v3 api call

* should use externalToken field name

* update queries for group checking

* Improve challenge visibility control: getChallenge and getRegistrants (#504)

* IMPROVE CHALLENGE VISIBILITY CONTROL
(https://www.topcoder.com/challenge-details/30057891/?type=develop)

Verification guide: docs/Verification_Guide-Improve Challenge Visibility Control.doc

* Restoring an accidentially modified file

* Fixed the case with a challenge that doesn't have eligibility

* Shared the eligibility verification with challengeRegistration.
The eligibility check routine is now in challengeHelper and can be added anywhere by a couple of simple lines of code.

* Improve challenge visibility control: getChallenge and getRegistrants

* revert commit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants