Skip to content

Conversation

@james-bruten-mo
Copy link
Collaborator

@james-bruten-mo james-bruten-mo commented Jan 27, 2026

PR Summary

Sci/Tech Reviewer: @t00sa
Code Reviewer: @ericaneininger

Initial attempt at a script to merge different git branches for use in suites. The changes have been tested with the LFRic suites and with the lfric_apps rose-stem at vn3.0. If we think this is a good idea I'll also modify the UM suites to use this extraction method to maintain consistency.

These changes allow the dependencies.yaml file to specify multiple branches to merge together. This can be done by:

lfric_apps:
    - source: git@github.com:MetOffice/lfric_apps.git
      ref: 2025.12.1
    - source: git@github.com:james-bruten-mo/lfric_apps.git
      ref: test_merge_branch
    - source: git@github.com:james-bruten-mo/lfric_apps.git
      ref: test_branch2
    - source: git@github.com:james-bruten-mo/lfric_apps.git
      ref: conflic_apps

which will clone the first source and then merge each subsequent source into this. It's currently setup to ignore merge conflicts in rose-stem and dependencies.yaml as these files aren't important for running scientific suites.

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)

LFRic standalone suites and lfric_apps rose-stem at vn3.0

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

@james-bruten-mo james-bruten-mo marked this pull request as ready for review January 28, 2026 08:54
@github-actions github-actions bot requested a review from t00sa January 28, 2026 08:54
Copy link
Contributor

@t00sa t00sa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A handful of suggestions

james-bruten-mo and others added 8 commits January 28, 2026 11:47
Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
@james-bruten-mo james-bruten-mo requested a review from t00sa January 28, 2026 15:05
Copy link
Contributor

@t00sa t00sa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one suggestion about where to put the basicConfig() call

@t00sa
Copy link
Contributor

t00sa commented Jan 29, 2026

I've ticked the boxes I didn't tick yesterday and the update looks good too

james-bruten-mo and others added 3 commits January 29, 2026 11:59
Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com>
Copy link
Collaborator Author

@james-bruten-mo james-bruten-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Erica, those changes are all done. For the opts == None comments, I've not modified by those comments, but have added a function that checks the structure of the dependencies dictionary looks roughly right. An example of it failing is at https://cylchub/services/cylc-review/view/james.bruten?&suite=u-dn674%2Frun3&no_fuzzy_time=0&path=log/job/1/extract/01/job.err

if not isinstance(opts, list):
opts = [opts]

for i, values in enumerate(opts):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

Copy link
Contributor

@ericaneininger ericaneininger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to address all comments. Happy to approve.

@ericaneininger ericaneininger merged commit 9297ded into MetOffice:main Jan 30, 2026
26 checks passed
@jennyhickson jennyhickson added this to the Spring 2026 milestone Jan 30, 2026
r-sharp pushed a commit to r-sharp/SimSys_Scripts that referenced this pull request Jan 30, 2026
* copy changes from apps

* revert accidental changes

* fix

* allow multiple sources

* add merge_sources script

* make path

* bug

* bug

* fix merge

* mirror fix

* setup merging of branches

* ruff

* remove remote

* working merge script

* add another error

* modify argument order

* Update github_scripts/get_git_sources.py

Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>

* Update github_scripts/merge_sources.py

Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>

* Update github_scripts/merge_sources.py

Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>

* Update github_scripts/rose_stem_extract_source.py

Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>

* update to use logger

* loggin gchanges

* loggin gchanges

* logging changes

* logging changes

* logging changes

* logging changes

* logging changes

* move basicconfig

* Apply suggestion from @ericaneininger

Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com>

* cr changes

---------

Co-authored-by: Sam Clarke-Green <74185251+t00sa@users.noreply.github.com>
Co-authored-by: Erica Neininger <107684099+ericaneininger@users.noreply.github.com>
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.

4 participants