Problem/Motivation

With the contribution credit migration from D7 to modern Drupal, the source of truth for credit data has changed.

In modern Drupal we are providing the data via JSON api

  • /jsonapi/node/contribution_record
  • /jsonapi/paragraph/contributor

With these endpoints:

  • '/contribution-records-by-user'
  • '/contribution-records-by-organization'
  • '/contribution-records-by-organization-by-user'

Proposed resolution

  • We should announce this in our blog about the contribution credit changes, and also remind them about the organization 'owner tools' page which may have what they need
  • Any drupal.org users who use this to do private data gathering about credit will need to update how they do that.
  • Create documentation (https://git.drupalcode.org/project/contribution_records/tree/1.0.x#endpo...)

API changes

Data model changes

Comments

hestenet created an issue. See original summary.

hestenet’s picture

Issue summary: View changes
hestenet’s picture

Issue summary: View changes
fjgarlin’s picture

Note that the endpoints come from the contribution_records module.

A really small summary of the endpoints and options available are here: https://git.drupalcode.org/project/contribution_records/tree/1.0.x#endpo...

hestenet’s picture

Issue summary: View changes
drumm’s picture

balsama’s picture

I'm trying to figure out a way to get an accurate date for when credit was given on a particular issue. In the old API, I could get the date for each of the `issue_credit_comment_info`'s corresponding comments. With the new `contribution_record` endpoint, I only see when the issue itself was created, changed, and last_status_change. None of which give an accurate idea of when the credit was given.

I'm including `paragraph--contributor`. Perhaps that include could include a date attribute?

I should note, that outside of this, the new API is great. I'm able to get everything else that I'm looking for in a single request (which took a dozen or more requests with the old API).

Thanks!

hestenet’s picture

@balsama - A couple of clarifications:

The date that a comment is made is when the attribution was made by an individual (as volunteer, on behalf of employer, or on behalf of client(s) - but the credit does not actually get *granted* until the issue maintainer has selected who should receive the credit, and the issue is closed.

So typically the most accurate date of when credit was granted is status_last_changed, whenever status = [any of the closed statuses],

But maybe in your use case it was important/helpful to know when the attributions were made?

The issue with having date-per-attribution, is that the new system is designed for when we switchover to GitLab issues, and those won't have attributions per individual comment, instead contributors will be able to edit their attribution for the whole issue on the credit record.

fjgarlin’s picture

Yes, what @hestenet said.

The date when a credit is given is last_status_change and field_draft is set to 0 (which happens when an issue is closed). That's exactly how our internal systems work to grant credit on users, organizations, marketplace.

balsama’s picture

Thanks for the clarification. I'm most interested in when a fix was actually committed. And I think in most situations, last_status_change will be ~2 weeks later than the commit date since status generally changes from Fixed --> Closed (Fixed) about two weeks after a fix has been committed.

And, of course, it can be wildly different if an issue is reopened.

That said, without getting into the nuance of what I use the API for, I'll generally be requesting commit credit for issues that have just landed based on Git logs. So the last_status_change date will likely still be the change from NR -> Fixed - which is usually the same day the commit was made. So, now that I think about it, this will work just fine.

I can still see where someone in the future might be interested in what date a particular credit was granted on older issues though.

Thanks again!

drumm’s picture

Status: Active » Fixed

The post-migration cleanups in D7 are now in place, removing access to credit-related fields. So the outdated data is no longer accessible, this is the only API. I think we can say this is fixed as there is documentation in place.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.