Problem/Motivation

As a new system for contribution records is being built (see https://www.drupal.org/project/infrastructure/issues/3322116), we will need changes on D7 www.drupal.org to adapt and communicate with it.

The following tasks are part of the bigger plan detailed here: https://docs.google.com/spreadsheets/d/1UVM8Bs6VdoJFo2-DQGjTRo5yeecMWMvp...

✅ Migrate existing credits to the new system
✅ Provide links on issues to the new system related record
✅ Trigger webhook for comments to update contributors on new system
✅ Trigger webhook for issue status change to update the contribution record status on the new system
✅ Hide any form or reference to the old attribution system (comment form on issues)
✅ Change to user profiles to read from the new system
✅ Changes to organizations to read from the new system
✅ Changes to marketplace to read from the new system
✅ Improve UX to add individual contribution records and bulk credits

I will use this issue/branch to put all the D7 changes that are required.

Deployment

✅ First phase: Send data to new.drupal.org:
- MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/337

- Settings on D7:
-- Set drupalorg_credit_migration_token to the same value as the one set in D10
-- Set contribution_records_base_url to https://new.drupal.org
-- Set drupalorg_contribution_record_delay_microseconds if we want to throttle requests to D10
-- Setup queue drupalorg_issue_events

- Settings on D10:
-- Allow 'contribution_records' in drupalorg_allowed_content_types
-- Allow /contribution-record* paths on Fastly
-- Allow /drupalorg-api/* paths on Fastly (I think this is done)
-- Setup environment variable so this line works: $config['drupalorg.settings']['credit_migration_token'] = getenv('DRUPALORG_CREDIT_MIGRATION_TOKEN');
-- Setup queue contribution_records_import_queue_worker

✅ Send and process data from D7 to the new system

* [D7 www.drupal.org]: drush drupalorg-contribution-records-sync --raw-import=2 (when the queue runs, the record will be queued to be created in the new system, so the D7 push operation will be quick and should not timeout).
* [D7 www.drupal.org]: drush drupalorg-contribution-records-sync --node-type=sa --raw-import=2 - same but for SA.
* [D7 www.drupal.org]: drush queue-run drupalorg_issue_events
* [D10 new.drupal.org]: drush queue:run contribution_records_import_queue_worker

✅ Data integrity checks

Compare the data from the current system and the new system. See data integrity checks.

✅ Second phase: read credits from the new system

- Merge MR351 / MR364 / more to come...
- drupalorg_credit_system defaults to legacy, so everything will continue to be the same in D7 once merged.
- Test new system (reading credits):
-- drush vset drupalorg_credit_system "modern"
-- drush cc views
-- Visit user pages, org pages, owner tools pages, and re-run marketplace calculations

- Revert to old system (D7):
-- drush vset drupalorg_credit_system "legacy"
-- drush cc views
-- Visit user pages, org pages, owner tools pages, and re-run marketplace calculations

✅ Last phase: write credits to the new system

- D7 Make the new system the canonical source of credit information
-- drupalorg_credit_system needs to be set to "modern"
-- Then drush vset drupalorg_credit_system_data_source "modern" (or "legacy" to revert)
- D10
-- Enable permission "edit any contribution_record content" for "authenticated users"
-- Remove integrity checks cron job on prod. Add the following to `helm/drupalorg/prod/values.yaml` (watch indentation) in the "helm-deploy-tree" repo.

migrationJobsStatus:
    contributionRecords: false

Steps:
BEFORE
- Communicate change and 20-30 min outage.
- Set red banner top message with the information?

DEPLOY
- Merge last D7 changes: https://git.drupalcode.org/project/drupalorg/-/merge_requests/392/diffs
- Set D7 flag to "modern"
- Run integrity checks one last time
- Merge D10 changes: https://gitlab.com/drupal-infrastructure/sites/drupalorg/-/merge_request...
- Merge helm-deploy-tree MR: https://gitlab.com/drupal-infrastructure/helm-deploy-tree/-/merge_reques...

AFTER
- Clean all that work up (that can happen after)
-- D7: Remove uneeded contributors block: https://git.drupalcode.org/project/drupalorg/-/merge_requests/397/diffs
-- ✅ D10: Remove temp message: https://git.drupalcode.org/project/contribution_records/-/merge_requests/15 + site update.
-- 🚧 D10: Integrity check job in the module: https://git.drupalcode.org/project/contribution_records/-/merge_requests...
-- D7: any code using "drupalorg_credit_system_data_source" if/else

CommentFileSizeAuthor
#153 Screenshot 2025-09-04 at 10.01.54.png37.95 KBfjgarlin

Issue fork drupalorg-3327584

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fjgarlin created an issue. See original summary.

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Update: functionality-wise, everything is there. We're starting to review/improve and see if there is anything missing.

The D7 changes can be seen in the MR for this issue. The whole plan (D7 + D9 new system) is in the google doc linked in the issue description.

fjgarlin changed the visibility of the branch 7.x-3.x to hidden.

fjgarlin’s picture

Status: Active » Needs work

The new MR contains the code from the old one as it was 2 years behind and rebase didn't work straightaway.

I will need to deploy this again to a D7 site and test.

fjgarlin’s picture

Issue summary: View changes

Updated deployment instructions.

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes

Updated deployment commands.

fjgarlin’s picture

Issue summary: View changes

Updated deployment instructions.

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes

Updated deployment information, queues to set up, etc.

fjgarlin changed the visibility of the branch 3327584-contribution-records-new-system to hidden.

fjgarlin’s picture

Status: Needs work » Needs review

With such a complex MR, it was easier to redo the whole thing than rebasing. New MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/332

fjgarlin’s picture

I will try to split the MR into two:
- One for pushing data to D10
- One for reading that data from D10

fjgarlin’s picture

Issue summary: View changes

First part: Send data to new.drupal.org:
- MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/337

- Settings on D7:
-- Set drupalorg_token to the same value as the one set in D10
-- Setup queue drupalorg_issue_events

- Settings on D10:
-- Allow 'contribution_records' in drupalorg_allowed_content_types
-- Allow /contribution-record* paths on Fastly
-- Setup environment variable so this line works: $config['drupalorg.settings']['token'] = getenv('DRUPALORG_TOKEN');
-- Setup queue contribution_records_import_queue_worker

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes

Simplified deployment instructions.

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes

Added a configurable way to throttle the requests to the new system, in case we need it.

fjgarlin’s picture

The second MR https://git.drupalcode.org/project/drupalorg/-/merge_requests/336 is mostly ready, but it relies on MR337 being merged first together with the deployment steps for that part.

After that, and when this is merged, we should be able to switch back and forth between the "legacy" and "modern" credit system with the following commands:

Use modern system:

drush vset drupalorg_credit_system 'modern'
drush cc views

Switch back to legacy system:

drush vset drupalorg_credit_system 'legacy'
drush cc views

A third part, and once the new system is stable and in use, will be to clean up the code from the legacy system and remove the switch, but we will go one step at a time.

fjgarlin’s picture

Issue summary: View changes

Updated the IS as we updated some of the token and headers names on both D7 and D10.

drumm made their first commit to this issue’s fork.

  • drumm committed 8439c6b4 on 7.x-3.x authored by fjgarlin
    Issue #3327584 by fjgarlin: Send issue credit information to D10 site
    

fjgarlin’s picture

Issue summary: View changes

SA nodes can now be sent to the new site to create the corresponding Contribution Credit.

MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/350/diffs
Once deployed:
- drush drupalorg-contribution-records-sync --node-type=sa --raw-import=2
- drush queue-run drupalorg_issue_events (This might not be needed as it is the same queue as with the previous step)

  • drumm committed 3ef00887 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Allow security advisories to be sent to contrib records...

fjgarlin’s picture

After the first full import run, we've had around ~1% missing on the new site. The reason for most of these (if not all) was that the issue didn't even have a comment, not even the automated comment #1 which is always linked to the author.

We will send the author with no attribution (as none can be calculated) when there are no comments on the issue. If the author makes a comment with attribution, then this last one will be taken instead.

MR to fix this situation: https://git.drupalcode.org/project/drupalorg/-/merge_requests/353/diffs

After that, we will need to re-run some of the above commands with selected NIDs.

  • drumm committed 3513a3e5 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Check issue status and always add author as credit
    

fjgarlin’s picture

  • drumm committed 5f4d224c on 7.x-3.x authored by fjgarlin
    Issue #3327584: Set an entry in the credit array if no credits could be...

fjgarlin’s picture

More edge cases:
- Issues with no title
- Issues with no comments and the users who created them no longer have an account

MR for that: https://git.drupalcode.org/project/drupalorg/-/merge_requests/355/diffs

  • drumm committed 6a19a3c6 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Fix issue credit migration edge case for issues with no...

fjgarlin changed the visibility of the branch 3327584-empty-credits-count-fix to hidden.

fjgarlin changed the visibility of the branch 3327584-send-contrib-records-to-d10 to hidden.

fjgarlin changed the visibility of the branch 3327584-send-sa-to-d10 to hidden.

fjgarlin changed the visibility of the branch 3327584-send-deleted-accounts-records to hidden.

fjgarlin changed the visibility of the branch 3327584-always-send-author-as-credit to hidden.

  • drumm committed f62fca67 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Read contrib records from new system with flag
    

fjgarlin changed the visibility of the branch 3327584-always-include-orgs-in-api-request to hidden.

fjgarlin’s picture

Issue summary: View changes

The first phase is almost complete.

We have been running data integrity checks between the D7 system and the new system to make sure that all records and all attributions are set correctly.

The next phase means merging https://git.drupalcode.org/project/drupalorg/-/merge_requests/351/diffs. That will leave things as they are now but we will be able to switch between the current D7 system or the new system just by setting a flag. I've updated the issue description with the steps needed for this.

  • drumm committed 476c40f6 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Include user id as part of the response
    

fjgarlin changed the visibility of the branch 3327584-expose-author-uid-even-if-blocked to hidden.

  • drumm committed 851c5329 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Add feature flag for new contribution records system,...
fjgarlin’s picture

The above merge is huge help for me going forwards. There will be more smaller MRs but won't need to do huge rebases and we won't need to re-review thousands of lines of code.

fjgarlin changed the visibility of the branch 3327584-read-credits-new-system-part-2 to hidden.

fjgarlin changed the visibility of the branch 3327584-read-credits-new-system-part-2 to active.

fjgarlin changed the visibility of the branch 3327584-read-contrib-records-from-new-system to hidden.

  • drumm committed ef34172f on 7.x-3.x authored by fjgarlin
    Issue #3327584: Read credits from new system part 2
    

fjgarlin changed the visibility of the branch 3327584-read-credits-new-system-part-2 to hidden.

fjgarlin’s picture

Issue summary: View changes

fjgarlin changed the visibility of the branch 3327584-comment-update-queue-event to hidden.

  • fjgarlin committed 1af7fbe0 on 1.0.x authored by drumm
    Issue #3327584 by fjgarlin, drumm: New contribution records system
    
fjgarlin’s picture

MR367 merged.

fjgarlin’s picture

Issue summary: View changes

The data integrity phase is now done. We have https://git.drupalcode.org/project/contribution_records/-/blob/1.0.x/scr... to compare D7 credits vs new system credits.

This is a HUGE achievement as there were more than 5 million records to migrate here. Over the last two weeks we were fixing edge cases in the code and data quality/consistency on D7.

We are now focusing on query performance so we can start querying the new system for reading credits.

  • drumm committed 32e7566d on 7.x-3.x
    Issue #3327584 by fjgarlin, drumm: New contribution records system
    

fjgarlin changed the visibility of the branch add-project-breadcrumb to hidden.

fjgarlin changed the visibility of the branch 3327584-debug-org-rank to hidden.

fjgarlin’s picture

We missed something really small in an if condition in the last MR. This one fixes it: https://git.drupalcode.org/project/drupalorg/-/merge_requests/370/diffs

It also adds some warning messages if the data could not be retrieved and it won't cache information in those cases.

  • drumm committed b78242bd on 7.x-3.x authored by fjgarlin
    Issue #3327584 by fjgarlin, drumm: Error handling when data cannot be...

fjgarlin changed the visibility of the branch 3327584-small-fixes to hidden.

  • drumm committed 89e7f4b1 on 7.x-3.x authored by fjgarlin
    Issue #3327584 by fjgarlin, drumm: Improve speed & SA filtering
    

  • drumm committed f23fc183 on 7.x-3.x
    Issue #3327584: Fix time calculation, remove caching of requests made...

fjgarlin changed the visibility of the branch 3327584-include-sa-param to hidden.

  • drumm committed 36d8ea8a on 7.x-3.x authored by fjgarlin
    Issue #3327584: Sort organizations in rank calculations and dedupe...

fjgarlin changed the visibility of the branch 3327584-dedupe-credits to hidden.

  • drumm committed 27e40717 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Fix counts by organization when using data from modern...

fjgarlin changed the visibility of the branch 3327584-marketplace-counts-modern to hidden.

fjgarlin changed the visibility of the branch 3327584-counts-fix to hidden.

  • drumm committed 39a8c69d on 7.x-3.x authored by fjgarlin
    Issue #3327584: Fix counts variable and use default for months
    

  • drumm committed 9857886f on 7.x-3.x
    Issue #3327584: Avoid breaking Features UI
    

fjgarlin changed the visibility of the branch 3327584-count-display-fix-and-default-value to hidden.

  • drumm committed c70422b7 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Remove wording since page counting is not easy
    

fjgarlin changed the visibility of the branch 3327584-remove-inaccurate-wording to hidden.

  • drumm committed cd073ba6 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Read all time user credits in one call
    

fjgarlin changed the visibility of the branch 3327584-read-all-time-user-credits to hidden.

  • drumm committed c6109c31 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Display normal message instead of messenger
    

fjgarlin changed the visibility of the branch 3327584-display-normal-message-instead-of-messenger to hidden.

  • drumm committed b5e5ff52 on 7.x-3.x authored by fjgarlin
    Issue #3327584: Various QA fixes & improvements
    
fjgarlin’s picture

Issue summary: View changes

We are now reading credits from the new system.

fjgarlin changed the visibility of the branch 3327584-months-displayed-on-org-page to hidden.

fjgarlin changed the visibility of the branch 3327584-feedback-round-1 to hidden.

  • drumm committed 17c897ad on 7.x-3.x authored by fjgarlin
    [#3327584] fix: Owner tools credit view, search by customer, too
    

  • drumm committed 39908823 on 7.x-3.x
    [#3327584] feat: Remove issue_credit View
    

  • drumm committed eb179420 on 7.x-3.x
    [#3327584] fix: Add a note about new contribution records
    

  • drumm committed d5011323 on 7.x-3.x
    [#3327584] fix: Ensure the are GitLab accounts for everyone who has...

fjgarlin changed the visibility of the branch 3327584-wording-around-owner-tools to hidden.

fjgarlin changed the visibility of the branch 3327584-automatic-message-status-update to hidden.

fjgarlin’s picture

Issue summary: View changes

D10 deployment steps added. I need to link the actual MRs.

fjgarlin’s picture

Issue summary: View changes

Added the missing MRs.

  • drumm committed 9895c075 on 7.x-3.x authored by fjgarlin
    [#3327584] feat: Add comment on issue close, remove “Credit” button next...

fjgarlin changed the visibility of the branch 3295357-migrate-drupal.org-issues to hidden.

  • drumm committed 4df799bf on 7.x-3.x
    [#3327584] fix: Fix typo, simplify some of the text, make the rest more-...
fjgarlin’s picture

Issue summary: View changes

Added a quick cleanup MR to the steps.

fjgarlin’s picture

Issue summary: View changes
fjgarlin’s picture

Issue summary: View changes

Added more details to deployment steps.

dieterholvoet’s picture

Changes to this contribution record don't seem to be saving for me, once I refresh the page everything is unchecked again. I am noticing a lot of console errors in the likes of Uncaught TypeError: $(...).once is not a function

fjgarlin’s picture

Replied to the above via slack. Needed to be logged in and click on "Save". Can't reproduce the JS error on chrome/firefox logged in/out.

  • drumm committed bfd3d7ae on 7.x-3.x authored by fjgarlin
    [#3327584] fix: Explicitly pass node instead of relying on menu system
    

  • drumm committed ee06a6b3 on 7.x-3.x
    [#3327584] fix: Remove attribution interface on editing a comment
    
nicxvan’s picture

Is there a way to see number comments and commits by each person like the old form?

fjgarlin’s picture

Issue summary: View changes
StatusFileSize
new37.95 KB

Number of comments yes. Number of commits no. We can also see if files were uploaded and reactions in MRs (eg: thumbs up)
table

fjgarlin’s picture

All the planned steps for "before" and "deploy" were done. The "after" clean up tasks will take place in the following days.

fjgarlin changed the visibility of the branch 3327584-automatic-message to hidden.

fjgarlin’s picture

itamair’s picture

@fjgarlin I also don’t see / find anymore the very below section (and select) that was allowing to merge a MR directly from the specific issue drupal.org page.
Is this intentiona? and are we now supposed to use a “more raw & traditional Git merge operation forcing the intended commit message with the new crediting format instead?
Where could we find some context on the removal of that MR merging operational option? (in any … )
thx ...

  • drumm committed 491b2d5f on 7.x-3.x authored by fjgarlin
    [#3327584] fix: Remove extra contributor information
    
fjgarlin’s picture

@itamair - more and more actions related to code are being moved to GitLab. Merging MRs has been available for years on the GitLab UI and it is now the only place where MRs can be merged.

As the MR widget was heavily linked with the table of credits, it was removed so the merging workflow goes to GitLab. Issues for projects will be migrated soon.

drumm’s picture

Status: Needs review » Fixed

This has been deployed for awhile and the immediate followups & cleanups have been triaged & fixed. 🎉

Any future followups should be their own issues.

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.