Toolhub/Progress reports/2021-02-05

Report on activities in the Toolhub project for the week ending 2021-02-05.

Toolhub API OAuth

edit
Tracked in Phabricator:
Task T264967 resolved

Srishti's work on the frontend for the OAuth server API in gerrit:655550 has been merged! Toolhub now contains a functional system for creating and managing OAuth applications and their associated authorizations. This functionality can be used by 3rd-party tools to perform write actions via the Toolhub API as another user. The team looks forward to finding out what interesting things the Wikimedia technical community will build using this feature.

Track per-edit changes to tool information

edit
Tracked in Phabricator:
Task T271370 resolved

gerrit:660055 uses code inspired by the revision tracking functionality in Striker to add database level tracking of edit history to the toolhub.apps.toolinfo.models.Tool model. This tracking is done using the django-reversion library.

Each edit can have an optional comment which is very similar to MediaWiki's 'edit summary' feature. A provided comment will be tracked in the revision and also propagated to the audit log entry created for the action.

Adding this type of history tracking to any additional model classes in the future should be a straightforward process.

SPDX license identifier API and validation

edit
Tracked in Phabricator:
Task T273670 resolved

We have added new API endpoints:

  • GET /api/spdx/ - List all known SPDX licenses
  • GET /api/spdx/{id}/ - Info for a specific SPDX license

The backing data for these API endpoints comes from the spdx-license-list python library which in turn aggregates data from the official SPDX license data git repo.

In addition to the API endponts, we also added a custom validator and attaching it to the Tool.license field. This is deliberately not using Django's built-in choices=... functionality to avoid polluting our model migrations and OpenApi schemas with the ~450 license choices.

API error handling

edit

As a step towards improving error handling in the Toolhub UI layer we have added OpenAPI documentation of the error response format that is in use.

Direct tool registration

edit

Srishti has started work on integrating the editing API for toolinfo records in the UI layer. She has drawn up wireframes for both initial toolinfo record creation and editing of an existing record. Discussion of these wireframes is helping Bryan understand and comment on Srishti's initial plans.

API for history and diff of toolinfo records

edit

Bryan has started working on a revision history and diff API that will expose the per-edit change tracking from #Track per-edit changes to tool information to the Toolhub UI and external API users.

Continuation of the Toolhub advisory council

edit

All of the initial members of the Toolhub advisory council were told that we would review the activity of the group in December 2020/January 2021 and determine if the experiment was worth continuing. Bryan kicked off a discussion thread on the toolhub-dev mailing list on 2021-01-29 (still technically in January!) asking everyone to renew their commitment to helping through to the planned production launch in June 2021.

Wrap up

edit

We were able to complete the first of our three major goals for the January-March quarter of planned work this week with the resolution of #Toolhub API OAuth.

Bryan estimates that the backend APIs for our second major goal of #Direct tool registration are 60% complete, and only blocked by competing time commitments. Srishti is just starting work on the UI components to go with this backend.

It is still too early to know if we will complete all of our goal work in the quarter, but things are looking good at the moment. :)