Limit allowed commit range for Changelog generation
What does this MR do and why?
- Contributes to #340941
- Feature flag: #364101 (closed)
We want to verify the commit range before fetching the commits to keep a good endpoint performance.
Screenshots or screen recordings
How to set up and validate locally
- Enable feature flag
Feature.enable(:changelog_commits_limitation)
- Find a project id that has more than 15000 commits (or lower
COMMITS_LIMIT
constant locally) - Visit URL:
http://127.0.0.1:3000/api/v4/projects/<project_id>/repository/changelog?version=v1.0&from=<from_sha>&to=<to_sha>
- You should see an error that the commit range is over the limit
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin