Skip to content

[$50] Change Privacy field on groups #521

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 Apr 2, 2021 · 13 comments
Closed

[$50] Change Privacy field on groups #521

jmgasper opened this issue Apr 2, 2021 · 13 comments

Comments

@jmgasper
Copy link
Collaborator

jmgasper commented Apr 2, 2021

@atelomycterus - One request on the group metadata display was to change the Privacy field to be the NDA status of the associated challenge - either Public or NDA Required. We should get this flag value with the Kafka message in the challenge forum processor.

Screen_Shot_2021-04-02_at_12_21_20_pm

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 2, 2021

Challenge https://www.topcoder.com/challenges/c8338d98-f9d3-4228-9f3c-49c06f20ce42 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 2, 2021

Challenge https://www.topcoder.com/challenges/c8338d98-f9d3-4228-9f3c-49c06f20ce42 has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

@jmgasper Need your help with this ticket.

We should get this flag value with the Kafka message in the challenge forum processor.

I've checked messages in challenge forum processor logs and challenge API response but
I don't see NDA status flag. Could you check if this flag is being published?

Json responses for
https://vanilla.topcoder-dev.com/group/885 ,
http://www.topcoder-dev.com/challenges/c9904ce5-afd9-4074-958e-9ab000ed34e8

Challenge processor logs

challenge.notification.create:

{
  "id": "c9904ce5-afd9-4074-958e-9ab000ed34e8",
  "created": "2021-03-31T11:10:12.040Z",
  "createdBy": "TCConnCopilot",
  "updated": "2021-03-31T11:10:12.040Z",
  "updatedBy": "TCConnCopilot",
  "status": "New",
  "projectId": 16804,
  "name": "test1.1",
  "typeId": "927abff4-7af9-4145-8ba1-577c16e64e2e",
  "trackId": "9b6fc876-f4d9-4ccb-9dfd-419247628825",
  "startDate": "2021-04-01T11:11:32.000Z",
  "legacy": {
    "reviewType": "COMMUNITY"
  },
  "descriptionFormat": "markdown",
  "timelineTemplateId": "7ebf1c69-f62f-4d3a-bdfb-fe9ddb56861c",
  "terms": [
    {
      "id": "317cd8f9-d66c-4f2a-8774-63c612d99cd4",
      "roleId": "732339e7-8e30-49d7-9198-cccf9451e221"
    }
  ],
  "groups": [],
  "discussions": [
    {
      "name": "test1.1 Discussion",
      "type": "challenge",
      "provider": "vanilla",
      "id": "03a24c26-ed64-4c8f-abb2-f4894ef7f89c"
    }
  ],
  "description": "",
  "billing": {
    "billingAccountId": 80000247
  },
  "phases": [
    {
      "phaseId": "a93544bc-c165-4af4-b55e-18f3593b457a",
      "duration": 432000,
      "id": "484bd027-37cc-4fdc-938d-f3bc6d520256",
      "name": "Registration",
      "isOpen": false,
      "scheduledStartDate": "2021-04-01T16:41:32+05:30",
      "scheduledEndDate": "2021-04-06T11:11:32.000Z",
      "actualStartDate": "2021-04-01T16:41:32+05:30",
      "actualEndDate": "2021-04-06T11:11:32.000Z"
    },
    {
      "phaseId": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
      "duration": 432000,
      "id": "6cca8dde-2f1f-4e62-ad7b-ecbe0747bec0",
      "name": "Submission",
      "isOpen": false,
      "scheduledStartDate": "2021-04-01T16:41:32+05:30",
      "scheduledEndDate": "2021-04-06T11:11:32.000Z",
      "actualStartDate": "2021-04-01T16:41:32+05:30",
      "actualEndDate": "2021-04-06T11:11:32.000Z"
    },
    {
      "phaseId": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
      "duration": 172800,
      "id": "8fc80648-5366-4cf7-9263-c3303050e232",
      "name": "Review",
      "isOpen": false,
      "predecessor": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
      "scheduledStartDate": "2021-04-06T11:11:32.000Z",
      "scheduledEndDate": "2021-04-08T11:11:32.000Z",
      "actualStartDate": "2021-04-06T11:11:32.000Z",
      "actualEndDate": "2021-04-08T11:11:32.000Z"
    },
    {
      "phaseId": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
      "duration": 86400,
      "id": "33a47723-3068-4579-850c-cf675591cf31",
      "name": "Appeals",
      "isOpen": false,
      "predecessor": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
      "scheduledStartDate": "2021-04-08T11:11:32.000Z",
      "scheduledEndDate": "2021-04-09T11:11:32.000Z",
      "actualStartDate": "2021-04-08T11:11:32.000Z",
      "actualEndDate": "2021-04-09T11:11:32.000Z"
    },
    {
      "phaseId": "797a6af7-cd3f-4436-9fca-9679f773bee9",
      "duration": 43200,
      "id": "c2cabd71-0e15-45ef-8712-354ac1d391bd",
      "name": "Appeals Response",
      "isOpen": false,
      "predecessor": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
      "scheduledStartDate": "2021-04-09T11:11:32.000Z",
      "scheduledEndDate": "2021-04-09T23:11:32.000Z",
      "actualStartDate": "2021-04-09T11:11:32.000Z",
      "actualEndDate": "2021-04-09T23:11:32.000Z"
    }
  ],
  "endDate": "2021-04-01T23:11:32.000Z",
  "numOfSubmissions": 0,
  "numOfRegistrants": 0,
  "currentPhaseNames": [],
  "registrationStartDate": "2021-04-01T16:41:32+05:30",
  "registrationEndDate": "2021-04-06T11:11:32.000Z",
  "submissionStartDate": "2021-04-01T16:41:32+05:30",
  "submissionEndDate": "2021-04-06T11:11:32.000Z",
  "track": "Development",
  "type": "Challenge"
}

challenge.notification.update:

{
  "projectId": 16804,
  "terms": [
    {
      "id": "317cd8f9-d66c-4f2a-8774-63c612d99cd4",
      "roleId": "732339e7-8e30-49d7-9198-cccf9451e221"
    }
  ],
  "typeId": "927abff4-7af9-4145-8ba1-577c16e64e2e",
  "legacyId": 30058792,
  "endDate": "2021-04-01T23:11:32.000Z",
  "status": "Active",
  "trackId": "9b6fc876-f4d9-4ccb-9dfd-419247628825",
  "created": "2021-03-31T11:10:12.040Z",
  "updatedBy": "TCConnCopilot",
  "createdBy": "TCConnCopilot",
  "name": "test1.1",
  "billing": {
    "billingAccountId": 80000247
  },
  "timelineTemplateId": "7ebf1c69-f62f-4d3a-bdfb-fe9ddb56861c",
  "groups": [],
  "descriptionFormat": "markdown",
  "updated": "2021-03-31T11:11:19.847Z",
  "phases": [
    {
      "phaseId": "a93544bc-c165-4af4-b55e-18f3593b457a",
      "duration": 432000,
      "id": "1ce0c331-25ee-4798-86aa-721d122747c7",
      "name": "Registration",
      "isOpen": false,
      "scheduledStartDate": "2021-04-01T11:11:32.000Z",
      "scheduledEndDate": "2021-04-06T11:11:32.000Z",
      "actualStartDate": "2021-04-01T11:11:32.000Z",
      "actualEndDate": "2021-04-06T11:11:32.000Z"
    },
    {
      "phaseId": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
      "duration": 432000,
      "id": "47fb1c6a-a7f8-4cb9-94d8-906626f53555",
      "name": "Submission",
      "isOpen": false,
      "scheduledStartDate": "2021-04-01T11:11:32.000Z",
      "scheduledEndDate": "2021-04-06T11:11:32.000Z",
      "actualStartDate": "2021-04-01T11:11:32.000Z",
      "actualEndDate": "2021-04-06T11:11:32.000Z"
    },
    {
      "phaseId": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
      "duration": 172800,
      "id": "6b9bd89b-d255-41a7-ad04-b599da934e20",
      "name": "Review",
      "isOpen": false,
      "predecessor": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
      "scheduledStartDate": "2021-04-06T11:11:32.000Z",
      "scheduledEndDate": "2021-04-08T11:11:32.000Z",
      "actualStartDate": "2021-04-06T11:11:32.000Z",
      "actualEndDate": "2021-04-08T11:11:32.000Z"
    },
    {
      "phaseId": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
      "duration": 86400,
      "id": "221e1371-c400-4c71-9dc6-e7699f1cf9ae",
      "name": "Appeals",
      "isOpen": false,
      "predecessor": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
      "scheduledStartDate": "2021-04-08T11:11:32.000Z",
      "scheduledEndDate": "2021-04-09T11:11:32.000Z",
      "actualStartDate": "2021-04-08T11:11:32.000Z",
      "actualEndDate": "2021-04-09T11:11:32.000Z"
    },
    {
      "phaseId": "797a6af7-cd3f-4436-9fca-9679f773bee9",
      "duration": 43200,
      "id": "82f9a32f-c27f-4e81-80a6-9915c0ee03b5",
      "name": "Appeals Response",
      "isOpen": false,
      "predecessor": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
      "scheduledStartDate": "2021-04-09T11:11:32.000Z",
      "scheduledEndDate": "2021-04-09T23:11:32.000Z",
      "actualStartDate": "2021-04-09T11:11:32.000Z",
      "actualEndDate": "2021-04-09T23:11:32.000Z"
    }
  ],
  "prizeSets": [
    {
      "type": "placement",
      "prizes": [
        {
          "type": "USD",
          "value": 1
        }
      ]
    }
  ],
  "startDate": "2021-04-01T11:11:32.000Z",
  "legacy": {
    "subTrack": "CODE",
    "reviewType": "COMMUNITY",
    "forumId": 0,
    "directProjectId": 24283,
    "isTask": false
  },
  "description": "test",
  "id": "c9904ce5-afd9-4074-958e-9ab000ed34e8",
  "tags": [
    "Google"
  ],
  "discussions": [
    {
      "id": "03a24c26-ed64-4c8f-abb2-f4894ef7f89c",
      "provider": "vanilla",
      "name": "test1.1 Discussion",
      "type": "challenge",
      "url": "https://vanilla.topcoder-dev.com/categories/c9904ce5-afd9-4074-958e-9ab000ed34e8"
    }
  ],
  "track": "Development",
  "type": "Challenge"
}

Challenge API

M2M token was used, https://api.topcoder-dev.com/v5/challenges/c9904ce5-afd9-4074-958e-9ab000ed34e8:

{
    "id": "c9904ce5-afd9-4074-958e-9ab000ed34e8",
    "created": "2021-03-31T11:10:12.040Z",
    "createdBy": "TCConnCopilot",
    "updated": "2021-03-31T11:11:27Z",
    "updatedBy": "tcwebservice",
    "status": "Active",
    "projectId": 16804,
    "name": "test1.1",
    "typeId": "927abff4-7af9-4145-8ba1-577c16e64e2e",
    "trackId": "9b6fc876-f4d9-4ccb-9dfd-419247628825",
    "startDate": "2021-04-01T16:05:52Z",
    "legacy": {
        "reviewType": "COMMUNITY",
        "isTask": false,
        "subTrack": "CODE",
        "directProjectId": 24283,
        "forumId": 0,
        "reviewScorecardId": 30001610,
        "track": "DEVELOP"
    },
    "descriptionFormat": "markdown",
    "timelineTemplateId": "7ebf1c69-f62f-4d3a-bdfb-fe9ddb56861c",
    "terms": [
        {
            "roleId": "3eedd4a4-3c68-4f68-8de4-a1ca5c2055e5",
            "id": "82a35602-57c2-4b48-a9b9-b4e133b22035"
        },
        {
            "roleId": "318b9c07-079a-42d9-a81f-b96be1dc1099",
            "id": "82a35602-57c2-4b48-a9b9-b4e133b22035"
        },
        {
            "roleId": "732339e7-8e30-49d7-9198-cccf9451e221",
            "id": "317cd8f9-d66c-4f2a-8774-63c612d99cd4"
        },
        {
            "roleId": "ff556573-5da6-4392-b38c-08c1d7599c4a",
            "id": "82a35602-57c2-4b48-a9b9-b4e133b22035"
        },
        {
            "roleId": "d663fc84-5c37-43d1-a537-793feffb7667",
            "id": "82a35602-57c2-4b48-a9b9-b4e133b22035"
        },
        {
            "roleId": "e0544b94-6420-4afc-8f63-238eddc751b9",
            "id": "82a35602-57c2-4b48-a9b9-b4e133b22035"
        },
        {
            "roleId": "0e9c6879-39e4-4eb6-b8df-92407890faf1",
            "id": "75d2f6bb-aadc-475e-9728-32c1dbd13655"
        },
        {
            "roleId": "cfe12b3f-2a24-4639-9d8b-ec86726f76bd",
            "id": "e0993b1a-abf7-45e6-8ed9-8cd0546be90b"
        }
    ],
    "groups": [],
    "discussions": [
        {
            "provider": "vanilla",
            "name": "test1.1 Discussion",
            "id": "03a24c26-ed64-4c8f-abb2-f4894ef7f89c",
            "type": "challenge",
            "url": "https://vanilla.topcoder-dev.com/categories/c9904ce5-afd9-4074-958e-9ab000ed34e8"
        }
    ],
    "description": "test",
    "billing": {
        "billingAccountId": 80000247
    },
    "phases": [
        {
            "duration": 432000,
            "scheduledEndDate": "2021-04-06T16:05:00Z",
            "actualEndDate": "2021-04-01T16:15:00Z",
            "isOpen": true,
            "name": "Registration",
            "phaseId": "a93544bc-c165-4af4-b55e-18f3593b457a",
            "actualStartDate": "2021-04-01T16:05:52Z",
            "id": "0abbcc3d-bc6c-4e7f-ac29-fe240f1e96a3",
            "scheduledStartDate": "2021-04-01T16:05:52Z"
        },
        {
            "duration": 432000,
            "scheduledEndDate": "2021-04-06T16:12:00Z",
            "actualEndDate": "2021-04-01T16:15:00Z",
            "isOpen": true,
            "name": "Submission",
            "phaseId": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
            "actualStartDate": "2021-04-01T16:12:47Z",
            "id": "a7788630-047a-4367-a61a-f7f7a214d068",
            "scheduledStartDate": "2021-04-01T16:12:47Z"
        },
        {
            "duration": 172800,
            "scheduledEndDate": "2021-04-08T16:12:00Z",
            "actualEndDate": "2021-04-01T16:15:00Z",
            "isOpen": false,
            "name": "Review",
            "phaseId": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
            "actualStartDate": "2021-04-01T16:15:00Z",
            "id": "595b774b-a989-4f50-af90-a15f226b23e3",
            "scheduledStartDate": "2021-04-06T16:12:00Z"
        },
        {
            "duration": 86400,
            "scheduledEndDate": "2021-04-09T16:12:00Z",
            "actualEndDate": "2021-04-01T16:15:00Z",
            "isOpen": false,
            "name": "Appeals",
            "phaseId": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
            "actualStartDate": "2021-04-01T16:15:00Z",
            "id": "b8c3bee6-0577-4163-b336-61134be9cb18",
            "scheduledStartDate": "2021-04-08T16:12:00Z"
        },
        {
            "duration": 43200,
            "scheduledEndDate": "2021-04-10T04:12:00Z",
            "actualEndDate": "2021-04-01T16:15:00Z",
            "isOpen": false,
            "name": "Appeals Response",
            "phaseId": "797a6af7-cd3f-4436-9fca-9679f773bee9",
            "actualStartDate": "2021-04-01T16:15:00Z",
            "id": "9679e760-fabf-40f2-82ac-c97545653175",
            "scheduledStartDate": "2021-04-09T16:12:00Z"
        }
    ],
    "endDate": "2021-04-10T04:12:00Z",
    "numOfSubmissions": 0,
    "numOfRegistrants": 0,
    "currentPhaseNames": [
        "Registration",
        "Submission"
    ],
    "registrationStartDate": "2021-04-01T16:05:52Z",
    "registrationEndDate": "2021-04-01T16:15:00Z",
    "submissionStartDate": "2021-04-01T16:12:47Z",
    "submissionEndDate": "2021-04-01T16:15:00Z",
    "track": "Development",
    "type": "Challenge",
    "prizeSets": [
        {
            "prizes": [
                {
                    "type": "USD",
                    "value": 1
                }
            ],
            "description": "Challenge Prizes",
            "type": "placement"
        }
    ],
    "overview": {
        "totalPrizes": 1
    },
    "tags": [
        "Google"
    ],
    "legacyId": 30058792,
    "events": [],
    "task": {
        "isAssigned": false,
        "isTask": false,
        "memberId": null
    }
}

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 3, 2021

@atelomycterus - Thanks - I'm asking Topcoder if we can add that.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 3, 2021

@atelomycterus - Apparently we have to do this either by specific group IDs or term IDs. I'm still getting more details on what those ID values should be in dev and prod.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Apr 5, 2021

@atelomycterus - Here are the term IDs for NDA required in both dev and prod:

  • Prod NDA UUID: c41e90e5-4d0e-4811-bd09-38ff72674490
  • Dev NDA UUID: e5811a7b-43d1-407a-a064-69e5015b4900

@atelomycterus
Copy link
Collaborator

@jmgasper are you ok if the term IDs are hard-coded in Vanilla config are initialized depending on env ?
We can use define (named constants are like variables except that once they are defined they cannot be changed or undefined):

define("NDA_UUID", [
  "XXX",
  "YYY",
  "ZZZ"
]);

@jmgasper
Copy link
Collaborator Author

@atelomycterus - Yeah, that's fine. That just means that if we ever want to change it, we'll have to redeploy, correct? I don't anticipate those IDs changing much, if ever.

@atelomycterus
Copy link
Collaborator

@jmgasper Yes, correct.

@atelomycterus
Copy link
Collaborator

@jmgasper Please apply PRS:
#588
topcoder-platform/forums-plugins#94
topcoder-platform/forums-groups-plugin@a588bad - I've pushed in develop. Sorry about that.

Thanks!

Configs

$Configuration['Plugins']['Topcoder']['NDA_UUID']=getenv('VANILLA_ENV') == 'prod'?'c41e90e5-4d0e-4811-bd09-38ff72674490':'e5811a7b-43d1-407a-a064-69e5015b4900';

Testing

image

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://www.topcoder.com/challenges/c8338d98-f9d3-4228-9f3c-49c06f20ce42
Payments Complete
Winner: obog
Copilot: ghostar
Challenge c8338d98-f9d3-4228-9f3c-49c06f20ce42 has been paid and closed.

This is an automated message for ghostar via Topcoder X

@sdgun
Copy link
Collaborator

sdgun commented Apr 22, 2021

Verified in Dev:

NDA Required:
image

Public:
image

@sdgun
Copy link
Collaborator

sdgun commented Apr 30, 2021

Verified in production.

image

image

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