Skip to content

Conversation

@james-bruten-mo
Copy link
Collaborator

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

PR Summary

Sci/Tech Reviewer:
Code Reviewer: @t00sa

This merges changes from MetOffice/lfric_apps#162 into this repo as they may be of use here in the future.

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)

Tested by running with the Apps rose-stem suite

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 requested a review from t00sa January 26, 2026 17:49
@james-bruten-mo james-bruten-mo marked this pull request as ready for review January 26, 2026 18:52
dest: Path,
repo: str,
use_mirrors: bool = False,
mirror_loc: Path = "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this (assigning Path to an empty string) not raise a type mismatch? Perhaps you meant mirror_loc: Path = Path("")?

command = f"git -C {loc} fetch origin main:main"
result = run_command(command, check=False)
if result and result.returncode:
if result.returncode:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you are reverting this back to original. But please note that run_command() will not always have a value so I added if result and result.returncode (sorry if I messed up your original logic.

Alternatively, you should probably use try/except:

try:
    result = runc_command(...)
    if result.returncode:
        ...
except Exception:
    result = None  # or you chose how to handle it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not intended - didn't merge the file correctly

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.

2 participants