]> cat aescling's git repositories - mastodon.git/commit
Allow forcing tags to be reported as trending
authoraescling <11325618-aescling@users.noreply.gitlab.com>
Wed, 27 Apr 2022 07:39:48 +0000 (07:39 +0000)
committerkibigo! <go@kibi.family>
Sun, 1 May 2022 03:34:42 +0000 (20:34 -0700)
commitdcbb77f9b503c63872f682e6581cbd7ffab6ac58
tree562f100d50f48d4c2ca37e724f75992d37340dce
parenta2c91c31585283f0ec2a2107a58fb5dd9dbba396
Allow forcing tags to be reported as trending

Using a comma-separated list in the evironment variable
`ALWAYS_TRENDING_TAGS`. The report bypasses the need to have marked
the tags set to always trend tags as approved. (It does not mark them
as approved.)

* Adjust code to better satisfy upstream rubocop

This edits upstream code (as modified for this commit)

* Refactor to get always-trending tags from environment

And for simpler method stubbing in testing.

The original form of the commit forced a single particular tag to
trend. @kibigo correctly suggested to handle this generically.

* [DRAFT, TODO] Add tests for new always-trending tags code

* Refactor Api::V1::Trends::TagsController for testing

* Add tests for always-trending tags

* Adopt @kibigo's suggestions

As per
https://gitlab.com/kibicat/mastodon/-/merge_requests/7#note_931604764
and
https://gitlab.com/kibicat/mastodon/-/merge_requests/7#note_931607104
app/controllers/api/v1/trends/tags_controller.rb
spec/controllers/api/v1/trends/tags_controller_spec.rb