DEV: Fix release_note task warnings (PR #13794)

There was a bunch of warnings repeated over and over during spec runs:

/var/www/discourse/lib/tasks/release_note.rake:3: warning: already initialized constant DATE_REGEX
/var/www/discourse/lib/tasks/release_note.rake:3: warning: previous definition of DATE_REGEX was here
/var/www/discourse/lib/tasks/release_note.rake:5: warning: already initialized constant CHANGE_TYPES
/var/www/discourse/lib/tasks/release_note.rake:5: warning: previous definition of CHANGE_TYPES was here

GitHub

In the past @tgxworld has been against fixing errors this way and preferred us to not include the same file twice. Did you investigate a solution that prevented it from being double loaded first?

Rake tasks are loaded every time we call Discourse::Application.load_tasks which we do in 7 before blocks in specs. Two of those are unnecessary but the other 5 (combined with Rake::Task.clear) are required to test those tasks.

I see. This is a problem with the way rake works and there isn’t really anything we can do about it. Thanks for the explanation! I will approve now.