Skip to content

Conversation

@sebingel
Copy link

@sebingel sebingel commented Feb 5, 2026

The flag previously only handled the case where a start commit had no parents (orphaned commits), but did not handle cases where commits referenced in merge request metadata no longer exist in the repository (typically due to force-pushes after the merge request was closed).

Changes:

  • Add skip-logic for missing start commits (project.go:436-443) When a start commit cannot be loaded from the repository, check the skipInvalidMergeRequests flag and log as INFO instead of ERROR

  • Add validation and skip-logic for missing end commits (project.go:486-492) Validate that the end commit exists before attempting to checkout the temporary source branch. Apply same skip-logic as start commits.

  • Improve error messages to include the commit hash for better debugging

This ensures that when -skip-invalid-merge-requests is specified, ALL merge requests with missing commits are gracefully skipped with INFO logging instead of failing with ERROR, resulting in a clean exit code.

Fixes issue where migrations would report errors even with the skip flag enabled, when merge requests referenced commits that were removed from Git history via force-push operations.

The flag previously only handled the case where a start commit had no
parents (orphaned commits), but did not handle cases where commits
referenced in merge request metadata no longer exist in the repository
(typically due to force-pushes after the merge request was created).

Changes:
- Add skip-logic for missing start commits (project.go:436-443)
  When a start commit cannot be loaded from the repository, check the
  skipInvalidMergeRequests flag and log as INFO instead of ERROR

- Add validation and skip-logic for missing end commits (project.go:486-492)
  Validate that the end commit exists before attempting to checkout
  the temporary source branch. Apply same skip-logic as start commits.

- Improve error messages to include the commit hash for better debugging

This ensures that when -skip-invalid-merge-requests is specified, ALL
merge requests with missing commits are gracefully skipped with INFO
logging instead of failing with ERROR, resulting in a clean exit code.

Fixes issue where migrations would report errors even with the skip
flag enabled, when merge requests referenced commits that were removed
from Git history via force-push operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant