Register
Submit a solution
The challenge is finished.

Challenge Overview

Topcoder-X is a new framework we are building to allow for easy, transparent integration with Gitlab and Github for managing tasks on Topcoder through Gitlab and Github issues.  Each issue on Gitlab or Github will be automatically associated with a specific challenge on Topcoder and this challenge will be updated automatically for assignee, prize, etc... and it will be opened and closed for payment as the Gitlab or Github ticket is opened, modified, and closed.

The goal is to greatly increase the efficiency with which we manage direct, private tasks for members on those various platforms.

We have a proof of concept done for Github, but we need to expand that to include Gitlab.  This challenge will implement the Gitlab integration, and will also make some changes to the general flow of data in the apps because Github handles things different than Gitlab.

Overview

There are currently two pieces to this app:

* Topcoder-X Receiver
* Topcoder-X Processor

The receiver handles incoming messages on activity from both Gitlab and Github.  These messages are passed as part of webhook callbacks that are supported on each platform.  The receiver parses these messages from the Gitlab or Github specific format, creating new, consolidated messages that get pushed into Kafka and then "processed" by the processor.

Receiver changes:

Events

���Currently we support these events in the receiver for Github, in the GithubEventDector.js:

* Issue created
* Issue updated
* Comment created
* Comment updated
* User assigned
* User unassigned
* Label assigned
* Label unassigned
* Pull request created
* Pull request closed

This challenge will implement the same events in the GitlabEventDetector.js.  Note the change to the event structure for labels below.  I've worked through this a bit, so a sample GitlabEventDetector will be provided that should help get you started here.

Labels event consolidation

For this challenge, we want to update the code for labels to consolidate the two existing events into a single "Labels updated" event.  Github responds with labels being added or removed to an issue with a bunch of webhook callbacks, but Gitlab only responds with a single callback that includes all the labels on the ticket.

We need to update the LabelAssignedEvent.js and the LabelUnassignedEvent.js and the corresponding parsing to be just a LabelUpdatedEvent.js that includes all the labels that are currently on the issue, parsed from the webhook callback.

User ID handling

Currently, the user ID *and* username are provided to events.  This isn't a good idea in Gitlab because it doesn't always provide the user ID.  Also, users on both Github and Gitlab can change their usernames, which is a problem for the integration.  Instead, we want to update all parsing and kafka events to only include the numeric user ID, not the username.

Gitlab edited comments

Github responds with webhook events when comments are edited, but Gitlab does not appear to have a callback for this event.  We need to have suggestions from developers on what they think would be good here.  Please document a suggested approach for Gitlab in your submission.  You don't have to implement it, but we'd like to get some ideas on what we could do here to get comment editing functionality.  Polling is one option, but this could introduce a huge amount of overhead that we'd like to avoid.

Processor Changes

In the Topcoder-X processor project, this challenge will also add a new GitlabService.js to match the functionality in the GithubService.js.  Creating comments, updating issues, assigning and unassigning users should all be implemented.

You are free to use the Node Gitlab library here:  https://github.com/jdalrymple/node-gitlab-api

We'd like to target v4 of the Gitlab API, but if you'd like to use a different library or target a different API version, please let us know in the forum so we can discuss.

Validation

Validation is going to be a bit tough, so if you'd like to add any additional logging to help reviewers validate the changes, that would be appreciated.  Please ensure that your validation documentation is extremely detailed and complete.

Submission requirements:

* Patch files against these repos, targeting the develop branch in each:
   * https://gitlab.com/luettich/processor
   * https://gitlab.com/luettich/receiver
* Updated README.md files, if the deployment details have changed
* Clear validation documentation

Final Submission Guidelines

Please see above

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30063786