Skip to content

[$400] Challenge Forum Processor - Archive flow #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmgasper opened this issue Mar 23, 2021 · 17 comments
Closed

[$400] Challenge Forum Processor - Archive flow #474

jmgasper opened this issue Mar 23, 2021 · 17 comments

Comments

@jmgasper
Copy link
Collaborator

@atelomycterus - With the challenge forum processor, we are going to only have groups "unarchived" when the corresponding challenge is active.

These are the changes we're thinking:

  1. When a challenge is initially created (status=New), we'll have the group as archived=true)
  2. When a challenge transitions to status=Active, we'll have the group as archived=false)
  3. When the challenge completes, is cancelled, or is deleted, we'll have the group as archived=true

This way only active challenges should have an unarchived group

@jmgasper
Copy link
Collaborator Author

Challenge https://www.topcoder.com/challenges/7819a5cf-5ee8-460f-ac45-7d05f44b6829 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

Challenge https://www.topcoder.com/challenges/7819a5cf-5ee8-460f-ac45-7d05f44b6829 has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

@jmgasper Implemented. More notes about challenge statuses below. Please apply PRs:

Thanks!

  1. When a challenge is initially created (status=New), we'll have the group as archived=true)

I've looked at Topocder challenge-api. It posts events to the 'challenge.notification.create' topic for any status other than Active:
(https://github.com/topcoder-platform/challenge-api/blob/1d77b4869ce4a5745d105ea4a217c0230f6ab1b8/src/services/ChallengeService.js#L836)

I've checked challenge forum processor logs. Most challenges are created with 'Draft' status initially, not 'New' (the 'challenge.notification.create' topic).

In any case, a group is always created as archived = true.

  1. When the challenge completes, is cancelled, or is deleted, we'll have the group as archived=true

All cancelled statuses are supported (The list of statuses
https://github.com/topcoder-platform/challenge-api/blob/develop/app-constants.js):

const challengeStatuses = {
  New: 'New',
  Draft: 'Draft',
  Cancelled: 'Cancelled',
  Active: 'Active',
  Completed: 'Completed',
  Deleted: 'Deleted',
  CancelledFailedReview: 'Cancelled - Failed Review',
  CancelledFailedScreening: 'Cancelled - Failed Screening',
  CancelledZeroSubmissions: 'Cancelled - Zero Submissions',
  CancelledWinnerUnresponsive: 'Cancelled - Winner Unresponsive',
  CancelledClientRequest: 'Cancelled - Client Request',
  CancelledRequirementsInfeasible: 'Cancelled - Requirements Infeasible',
  CancelledZeroRegistrations: 'Cancelled - Zero Registrations'
}

@jmgasper
Copy link
Collaborator Author

@sdgun - For testing this one:

  1. Create a new challenge in WM. You should be able to open the challenge forum page and see: Archived: true
  2. Launch the challenge --> You should be able to open the challenge forum page and see: Archived: false
  3. Close the challenge (delete it, cancel it, complete it) --> You should be able to open the challenge forum page and see: Archived: true

I'll walk through this as well, once WM is back up and running properly in dev. Currently it doesn't seem to be working.

@jmgasper jmgasper added this to the 1.x milestone Mar 23, 2021
@sdgun
Copy link
Collaborator

sdgun commented Mar 24, 2021

@jmgasper WM is still throwing errors, I will check this in some time.

@jmgasper
Copy link
Collaborator Author

@sdgun / @atelomycterus - In dev, something's broken, but I'm not sure what. Seems like the token we've been using no longer works with adding users to groups, even though the token is for TonyJ, who has Vanilla Admin access. I've logged a new ticket here for investigation: #502

@jmgasper
Copy link
Collaborator Author

@sdgun - This appears to be working, with the fix from #502. Please let me know if you run into any issues - this is the biggest change we're going to push to prod in a couple days.

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://www.topcoder.com/challenges/7819a5cf-5ee8-460f-ac45-7d05f44b6829
Payments Complete
Winner: obog
Copilot: ghostar
Challenge 7819a5cf-5ee8-460f-ac45-7d05f44b6829 has been paid and closed.

This is an automated message for ghostar via Topcoder X

@sdgun
Copy link
Collaborator

sdgun commented Mar 30, 2021

@jmgasper #502 (comment)

@sdgun
Copy link
Collaborator

sdgun commented Mar 30, 2021

3. Close the challenge (delete it, cancel it, complete it) --> You should be able to open the challenge forum page and see: Archived: true

@jmgasper
Here I should close/cancel/delete from OR?

@jmgasper
Copy link
Collaborator Author

@sdgun - I think you can do that either from OR or from WM

@atelomycterus
Copy link
Collaborator

@jmgasper I've checked challenge forum processor logs. There were no messages to archive these challenges:

  • groupID=877, challengeID=956abdfc-6b28-48ac-843a-7bc93b124b2b
  • groupID=874 , challengeID=67199ee8-7232-4da0-9ddd-70e6e36297a9
  • groupID=876, challngeID=8b112947-7615-4aa9-ad72-3c3d1f256b09.

It is necessary to check if messages are sent by other services (OR / WM). Unfortunately, I don’t know all the details.

At least 'Completed' is sent to challenge.notification.update. I saw only one event with 'Completed' status for another challenge(challengeID=92550f95-e2fc-4d76-8e13-239acc0824bd) in challenge processor logs but Vanilla entities weren't created for this challenge because the message didn't contain 'discussions' elements.

�[33m2021-03-30T08:53:58.999Z�[39m [�[34mdebug�[39m]: Message from challenge.notification.update: [{"projectId":17234,"terms":[{"id":"317cd8f9-d66c-4f2a-8774-63c612d99cd4","roleId":"732339e7-8e30-49d7-9198-cccf9451e221"}],"task":{"isTask":true,"isAssigned":true,"memberId":"40029484"},"typeId":"ecd58c69-238f-43a4-a4bb-d172719b9f31","endDate":"2021-03-30T20:38:54.122Z","overview":{"totalPrizes":1},"status":"Completed","trackId":"9b6fc876-f4d9-4ccb-9dfd-419247628825","created":"2021-03-30T08:43:03.207Z","updatedBy":"pshah_manager","createdBy":"pshah_manager","name":"taas payment test 01","billing":{"billingAccountId":80000068,"markup":0.5},"timelineTemplateId":"53a307ce-b4b3-4d6f-b9a1-3741a58f77e6","groups":[],"descriptionFormat":"markdown","updated":"2021-03-30T08:53:58.065Z","phases":[{"phaseId":"6950164f-3c5e-4bdc-abc8-22aaf5a1bd49","duration":86400,"id":"f8d710ca-a994-45d6-90de-f2209a2f3d85","name":"Submission","isOpen":false,"scheduledStartDate":"2021-03-29T20:38:54.122Z","scheduledEndDate":"2021-03-30T20:38:54.122Z","actualStartDate":"2021-03-29T20:38:54.122Z","actualEndDate":"2021-03-30T20:38:54.122Z"},{"phaseId":"003a4b14-de5d-43fc-9e35-835dbeb6af1f","duration":86400,"id":"ebf9156e-9e70-4fcb-bc45-1c0b4c2b7242","name":"Iterative Review","isOpen":false,"predecessor":"6950164f-3c5e-4bdc-abc8-22aaf5a1bd49","scheduledStartDate":"2021-03-30T20:38:54.122Z","scheduledEndDate":"2021-03-31T20:38:54.122Z","actualStartDate":"2021-03-30T20:38:54.122Z","actualEndDate":"2021-03-31T20:38:54.122Z"},{"phaseId":"ad985cff-ad3e-44de-b54e-3992505ba0ae","duration":86400,"id":"4cea32db-490e-459c-82e2-8c7c45bad73e","name":"Approval","isOpen":false,"predecessor":"003a4b14-de5d-43fc-9e35-835dbeb6af1f","scheduledStartDate":"2021-03-31T20:38:54.122Z","scheduledEndDate":"2021-04-01T20:38:54.122Z","actualStartDate":"2021-03-31T20:38:54.122Z","actualEndDate":"2021-04-01T20:38:54.122Z"}],"prizeSets":[{"prizes":[{"type":"USD","value":1}],"description":"Challenge Prizes","type":"placement"},{"prizes":[{"type":"USD","value":1}],"description":"Copilot Payment","type":"copilot"}],"startDate":"2021-03-29T20:38:54.122Z","legacy":{"pureV5Task":true,"directProjectId":25212},"description":"** taas payment test 011","id":"92550f95-e2fc-4d76-8e13-239acc0824bd","track":"Development","type":"Task"}]
�[33m2021-03-30T08:53:58.999Z�[39m [�[32minfo�[39m]: The challenge with challengeID=92550f95-e2fc-4d76-8e13-239acc0824bd:
�[33m2021-03-30T08:53:59.152Z�[39m [�[31merror�[39m]: Error: The group wasn't found for this challenge
    at updateVanillaGroup (/challenge-forum-processor/src/services/vanilla.js:285:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

I didn't see any messages with Deleted/Cancelled status in challenge forum processor log. I've looked at challenge-api code. After deleting challenges the service posts to challenge.notification.delete (https://github.com/topcoder-platform/challenge-api/blob/develop/src/services/ChallengeService.js#L1995).
The challenge forum processor handles only messages from challenge.notification.create and challenge.notification.update.
It looks like we need to process messages from this topic as well.

@jmgasper
Copy link
Collaborator Author

@sdgun / @atelomycterus - The problem with this is that OR does NOT send challenge.notification-update messages. @sdgun - You should use only WM when setting the status. Sorry for not being more clear on that.

@sdgun
Copy link
Collaborator

sdgun commented Mar 31, 2021

@jmgasper I checked on this yesterday, but looks like we cannot change status from WM. (checked with @drasticdpk , the QA of WM)

@jmgasper
Copy link
Collaborator Author

@sdgun - Yeah, I'll investigate more fully. I think we can use the API here, but I may have to do that manually.

@sdgun
Copy link
Collaborator

sdgun commented Apr 1, 2021

Verified in Production, Archived=true when the challenge is in draft status and once activated, archived is set to false.

@sdgun sdgun removed the Ready for QA label Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants