Skip to content

Add check_merge_conflicts.py to simulate dependencies.yaml merges bef… - #270

Draft
Zubair Maalick (zmaalick) wants to merge 3 commits into
MetOffice:mainfrom
zmaalick:merge_conflict_check
Draft

Zubair Maalick (zmaalick) wants to merge 3 commits into
MetOffice:mainfrom
zmaalick:merge_conflict_check

Conversation

@zmaalick

@zmaalick Zubair Maalick (zmaalick) commented Dec 2, 2026 •

Copy link
Copy Markdown

Add check_merge_conflicts.py to simulate dependencies.yaml merges before extracting

PR Summary

Sci/Tech Reviewer:
Code Reviewer:

Adds github_scripts/check_merge_conflicts.py, a pre-flight check that simulates the dependencies.yaml merges done by merge_sources.py/get_git_sources.py using git merge-tree, without a working copy or compile, so conflicts are found in seconds before a suite is submitted.
For each repository it reports which branches have drifted onto newer releases than the base, the merge step where the extract would fail, the conflicting files by type (code/housekeeping/other) and which branch they clash with, and a suggested merge order.
By default it models the per-file CONFLICT_RULES resolution from #269 (--resolver legacy models the current CONFLICT_IGNORES behaviour). Exit status is 0 if the extract would succeed, 1 if it would fail or a branch has drifted, and 2 on errors.
Tested with 4 new unit tests on local repos, and against u-ed285 and o-ab147, where it reproduced the real extract failures (same failing step and files).
`

Once merged, we can add this script in rose-suite.conf as:

[file:bin/check_merge_conflicts.py]
source=git:localmirrors:MetOffice/SimSys_Scripts.git::github_scripts/check_merge_conflicts.py::main
`

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • This change has been tested appropriately (please describe)

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Security considerations have been addressed
  • Performance impact is acceptable

@zmaalick
Zubair Maalick (zmaalick) marked this pull request as draft December 2, 2026 09:21
@github-actions github-actions Bot added the cla-required The CLA has not yet been signed by the author of this PR - added by GA label Dec 2, 2026
@github-actions github-actions Bot added cla-signed The CLA has been signed as part of this PR - added by GA and removed cla-required The CLA has not yet been signed by the author of this PR - added by GA labels Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed as part of this PR - added by GA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant