Repository navigation
Conversation
|
@justaugustus @spencerschrock Could you please review this PR when convenient? I have synchronized the branch with the latest
Validation after synchronization:
A fresh hosted CI run has been requested and is awaiting maintainer workflow approval. Thank you! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5339 +/- ##
===========================================
+ Coverage 66.80% 77.33% +10.52%
===========================================
Files 230 255 +25
Lines 16602 14470 -2132
===========================================
+ Hits 11091 11190 +99
+ Misses 4808 3279 -1529
+ Partials 703 1 -702 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The result-building path can still panic when returned commits have missing dates; this handling must be fixed before approval.
1 open issue
What changed in this PR
This pull request updates GitLab merge-request lookup to use the latest non-nil commit date as the mergedBefore query bound without changing commit order.
Changes:
- Computes the newest available committed date from unordered API results.
- Preserves existing commit ordering and nil-bound behavior.
- Adds regression coverage for unordered commits and missing dates.
| File | Description |
|---|---|
clients/gitlabrepo/client.go |
Uses the latest committed date for GraphQL merge-request queries. |
clients/gitlabrepo/client_test.go |
Tests latest-date selection and missing-date handling. |
Review effort: Lite
Signed-off-by: XY-code1 <1611761391@qq.com>
Signed-off-by: XY-code1 <1611761391@qq.com>
3ba8e1f to
09fad54
Compare
Signed-off-by: XY-code1 <1611761391@qq.com>
|
@justaugustus @spencerschrock The reported nil-date panic and lint failure are now fixed. Changes:
Local validation passed:
Could one of you please approve the pending workflows and review the PR when convenient? Thanks! |

What kind of change does this PR introduce?Bug fix.- [x] PR title follows the guidelines defined in our pull request documentation#### What is the current behavior?The GitLab client uses the first commit returned by the REST API as the
mergedBeforebound for the merge-request GraphQL query. The API response is not guaranteed to be ordered, so an older first entry can exclude merge requests associated with newer commits and lower Code-Review results.#### What is the new behavior?The client finds the latest non-nil committed date in the returned commit set and uses it as the GraphQL bound. It does not reorder the commits, so the existing result order and zip behavior remain unchanged. Missing commit dates are ignored, with the existing nil-bound behavior retained when no date is available.- [x] Tests for the changes have been added (for bug fixes/features)The regression test covers an unordered response, missing dates, and an all-missing-date response.#### Which issue(s) this PR fixesFixes #3193#### Special notes for your reviewerThe earlier #4969 sorted the commit slice and was closed by its author after an unrelated verifier infrastructure failure. This version computes only the query bound, avoiding an observable commit-order change.Local validation:-gofmtcompleted for both changed files.-git diff --checkpassed before commit.-go test ./clients/gitlabrepo -run '^TestLatestCommittedDate$' -count=1could not complete locally because this Windows host repeatedly failed IPv6 downloads fromproxy.golang.org/goproxy.cnwhile fetching existing transitive modules. No dependency or lock-file changes were made. Hosted CI must execute the Go tests.#### Does this PR introduce a user-facing change?release-noteFix GitLab Code-Review analysis to use the newest returned commit date when selecting merge requests.