Skip to content

Post review follow-up for preload_latest_diff_commit tests

What does this MR do and why?

This MR addresses post-review follow-up items from !203465 (comment 2759674617)

Follow-up items addressed:

  1. Remove safe navigation operator (!203465 (comment 2759674617)):

    • Removed &. operator from commit.merge_request_commits_metadata&.commit_author and commit.merge_request_commits_metadata&.committer
    • Since we're creating metadata during setup for with_metadata tests, the safe navigation is unnecessary
    • This gives us confidence that the whole method chain is called without exceeding query limits
  2. Split query limit specs for better isolation (!203465 (comment 2759674591)):

    • Separated the query limit expectations for with_metadata and without_metadata cases
    • with_metadata case expects max 7 queries
    • without_metadata case expects max 4 queries
    • This provides better clarity and isolation between the two scenarios
  3. Improve test expectations (!203465 (comment 2759674564) and !203465 (comment 2759674572)):

    • Changed from expect { ... }.not_to raise_error to expect(...).to eq([expected_result])
    • Testing the end result automatically validates that no error was raised while being more explicit about expectations

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Gary Holtz

Merge request reports

Loading