gitlab_release_notes/generate.py: also take merged_at into consideration #19
Open
peat-psuwit wants to merge 2 commits intovuillaut:mainfrom
Open
gitlab_release_notes/generate.py: also take merged_at into consideration #19peat-psuwit wants to merge 2 commits intovuillaut:mainfrom
peat-psuwit wants to merge 2 commits intovuillaut:mainfrom
Conversation
`updated_at` could be after `merged_at`, e.g. for MRs that has additional comments after it's merged. So, after filtering by `updated_after` parameter, also do client-side filtering on `merged_at` field. Now, an interesting thing is that while GitLab offers order_by='merged_at' (since GitLab 17.2 [1]), there's no `merged_after` parameter that we can use. So we can't tell server to filter this for us. Also, Python cannot parse GitLab's spec-complient ISO8601 datetime until 3.11 [2]. Thus a library called `dateutil` is added as an external dependency. [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147052 [2]: https://docs.python.org/3/whatsnew/3.11.html#datetime
It was not possible to order by `merged_at` field until GitLab 17.2, released ~6 months ago (and is already EoL).
46ce785 to
9b70360
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updated_atcould be aftermerged_at, e.g. for MRs that hasadditional comments after it's merged. So, after filtering by
updated_afterparameter, also do client-side filtering onmerged_atfield.
Now, an interesting thing is that while GitLab offers
order_by='merged_at' (since GitLab 17.2 [1]), there's no
merged_afterparameter that we can use. So we can't tell server to filter this for
us.
Also, Python cannot parse GitLab's spec-complient ISO8601 datetime until
3.11 [2]. Thus a library called
dateutilis added as an externaldependency.
[1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147052
[2]: https://docs.python.org/3/whatsnew/3.11.html#datetime