-
Notifications
You must be signed in to change notification settings - Fork 11
Copy overwrite changes #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Copy overwrite changes #168
Conversation
github_scripts/get_git_sources.py
Outdated
| dest: Path, | ||
| repo: str, | ||
| use_mirrors: bool = False, | ||
| mirror_loc: Path = "", |
There was a problem hiding this comment.
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("")?
github_scripts/get_git_sources.py
Outdated
| command = f"git -C {loc} fetch origin main:main" | ||
| result = run_command(command, check=False) | ||
| if result and result.returncode: | ||
| if result.returncode: |
There was a problem hiding this comment.
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 itThere was a problem hiding this comment.
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
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
Testing
Tested by running with the Apps rose-stem suite
Security Considerations
AI Assistance and Attribution
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review