prepare_release_notes: fix MR filtering and speedup
- Fix label caching (
@cache
does not work in nested functions) - Use
git log --grep
to already filter on MR log messages so we don't have to deal with non-matching ones when parsing.
This replaces MR !72743 (closed) from @tadej who found these bugs initially.
In addition, this MR hugely (> factor 20) speeds up the release notes generation by batching the MR retrieval from GitLab instead of doing individual REST API requests.
cc @atlas-release-coordinators