Problem/Motivation
Per the core idea issue: #2940739: Project messaging channel in core initiative
The vast majority of Drupal users do not have accounts on Drupal.org, and likely do not regularly follow Drupal project news, or engage with communications channels that promote important updates, news and events, or support for the community and association.
The goal of this initiative is to provide a channel for messaging about the Drupal project within the administrative interface of core. This channel could provide information about upcoming releases, new feature highlights, events like DrupalCon, and promote support of the project via Association membership or other programs.
Proposed resolution
Guidelines
We agreed to develop the feature using the following guidelines:
- Follow existing core patterns where possible
- Reuse existing visual display/layout from the settings tray
- Provide a notification icon in the primary toolbar
- Consume a feed from Drupal.org
For initial inclusion, the following potential features were not in scope:
- Configurable endpoints for multiple feeds.
- An API for extensibility by other contributed modules.
Prototype
Initial design concepts were provided here: https://www.figma.com/proto/Ws4Gk0ImaripDb4NAlTvCBtZ/Community-Alerts---...
This announcement feature has been developed as part of contrib: https://www.drupal.org/project/announce
Demo
This early demo shows an example of the announcement feed during the Contrib phase. It is not up to date with the latest changes from feedback in comments in this thread.
- Drupalpod instance with test feed enabled: see testing instructions below.
- Screenshots (slides)
Original demo (outdated)
Remaining tasks
Steps to get this module into core
- Merge into core and market it as an experimental module, according to typical process for new core features.
- After a successful release as experimental, if no major changes are required, mark stable in following release.
- Add it to the standard profile (and maybe others)
- Figure out if and how to enable it on existing sites.
Finalize the feed from Drupal.org (need to handle version constraints for messaging)- #3249625: Document difference between featured and standard announcements
- #3249644: Clarify behavior of announcements, new, viewed, hiding, etc.
- #3249532: Display only the top 10 announcements by version (featured then recent) with a see more link
- #3071994: Document approval process for what appears in the official Drupal project messaging feed
Complete tests: #3198730: Automated tests for AnnounceStandardize language to 'announcements' rather than 'alerts'Usability reviewRe-roll patch for 9.5.x (currently doesn't apply)Roll patch for 10.0.xAccessibility reviewRelease note snippet drafted- Product manager review
- Framework manager review
- Release manager review
- Make module experimental
- Change record
- Reach out to release manager to figure out what needs to be done (and what core committer we can work with).
Follow-up
- Get core review and post the firstofficial post to the feed: https://docs.google.com/document/d/1d5Uq1ORQDy5bW_3WAyyorEVuHCtZBBB_aKMt...
- Follow-up: #3071997: Backport to D7
- Follow-up: Decide whether or not to backport to earlier D9 releases just to provide more exposure, get more adoption, since the point of this feature is communication with our ecosystem.
User interface changes
- Adds a notification icon to the admin toolbar
- Adds an announcement tray with a list of the announcements pulled from the feed
API changes
- This feature does not add any public APIs
Data model changes
- This feature uses cache tags in the user scope to handle read/unread status of announcements.
Security considerations
- The feed itself must be securely controlled from Drupal.org with a policy for who has access and editorial approval: #3071994: Document approval process for what appears in the official Drupal project messaging feed.
Release notes snippet
Drupal core now includes an announcements feed of project news from Drupal.org. This feed of announcements is displayed in the Drupal administrative toolbar to site owners/editors, tracking read/unread status with cache tags. Announcements may include: news about upcoming Drupal features, important information for site owners on older Drupal versions, and information about supporting the Drupal project through Drupal Association programs.
D7 Backport
This is an exceptional case where a backport to Drupal 7, even this late in Drupal 7's lifecycle, is likely worth our time. The large number of legacy sites on Drupal 7 are an audience we need to be able to reach, and this may be our only way to do so.
Contributors to D9 release
tedbow, Lal_, drumm, vimaljoseph, mohit_aghera, mitthukumawat, hestnet, Abhinand Gokhala K, AkshayAdhav
Testing
Drupalpod instance: https://gitpod.io/#snapshot/c0486cf8-1b06-4920-8633-c502d5493c10 and then navigate to /admin/announcements_feed on the browser window.
See below as the feed might not work.
You will need to select which feed you want to test. You need to override the feed_url:
- Copy sites/example.settings.local.php to
sites/default/settings.local.php
- Uncomment the last three lines of
sites/default/settings.php
to include the above file - IMPORTANT: On drupalpod, go to the Ports tab (besides Terminal tab), then go to port 8080 and make it public. Copy the URL of your pod instance for the next step.
- Edit the
sites/development.services.yml
(on drupalpodrepos/drupal/sites/development.services.yml
!) and addannouncements_feed.feed_url: https://DRUPAL-URL/core/modules/announcements_feed/tests/announce_feed/community-feeds.json
to the parameters section (replace DRUPAL-URL with the URL of your testing instance). Alternatively, remove the above line, so it defaults tohttps://www.drupal.org/announcements.json
ddev drush php:eval "\Drupal::service('user.data')->delete('announcements_feed');\Drupal::service('keyvalue.expirable')->get('announcements_feed')->deleteAll();drupal_flush_all_caches();"
To trigger the notifications as new run: ddev drush php:eval "\Drupal::service('user.data')->delete('announcements_feed');drupal_flush_all_caches();"