Skip to content

Encapsulate git functions into a Fab-compatible class #217

Description

@hiker

Long term goal is that the SimSys scripts will be replaced with Fab functionality. As a stepping stone towards that, this ticket is about refactoring the existing git functionality in SimSys_Script, creating a Fab Tool implementation, that can seamlessly integrated in Fab later. Using a Fab-like structure means that we only need to maintain one set of functions for the advanced git functions, no need to have one version here and one in Fab.

At the appropriate time, the git class from this repo can just be moved into Fab.

This ticket will not create a dependency on Fab, instead one or two required Fab base classes will be copied here. The API for the build system will also remain unchanged, i.e. the change from a set of functions to a class is internal to this repo only.

Activity

  1. hiker commented on Mar 24, 2026

    @hiker
    CollaboratorAuthor

    I can neither assign this ticket to me, nor add a label or type :) I will be working on this in my fork at https://github.com/hiker/SimSys_Scripts

  2. james-bruten-mo commented on Mar 24, 2026

    @james-bruten-mo
    Collaborator

    Hi Joerg, I've added you with write permission so should be doable now

  3. added a commit that references this issue on Mar 25, 2026
  4. hiker commented on Mar 25, 2026

    @hiker
    CollaboratorAuthor

    James Bruten (@james-bruten-mo) , I have started the work, but have some questions. My current status is
    https://github.com/hiker/SimSys_Scripts/tree/217_fab_git_class
    (esp. the new file https://github.com/hiker/SimSys_Scripts/blob/217_fab_git_class/github_scripts/advanced_git.py)

    I have copied a significant number of functions from get_git_sources.py into the new AdvancedGit class. Atm I have not removed anything. Some additional functions (ssh, rsync) were a bit if a surprise ;) I've added an rsync tool from Fab to integrate this all the same way, but I still need ssh.

    I started to look how the SimSys scripts are used, and am somewhat confused (e.g. in LFRic, building at least from the command line seems to be a set of custom scripts, not really the SimSys scripts?? Am still grep-ing my way through UM :) ).

    Questions I have so far are:

    • What is the main interface to existing scripts? Is it just the merge_source.py script? Or is it possible that any scripts 'out there in the wild' could import functions from get_git_sources (and so should I maintain these as well)? The latter could be done by just calling the corresponding methods in the AdvancedGit class, but it feels odd to have this around.
    • Any details about coding style? I see function with all parameters documented in sphinx-style (:params...:), free style (not following sphinx convention), not commented at all? Line wrappings seem inconsistent. I am happy to update this, but don't know what you want :)
    • Why is the datetime manually added to logging calls instead of setting a format that automatically adds the datetime? Again, I am happy to refactor.
    • Some function in get_git_sources do not really 'belong' in a Git class (e.g. set_https). Should I still add them all (for now), i.e. move the whole functionality of get_git_source into the advanced git class?

    I feel like having a separate dependencies.yaml class (with additional functionality like handling mirrors) would be good to have. I actually have started to write this, and it might be useful to replace this - but again, this pretty much depends on what other part of the SimSys git scripts are used in which way :(

  5. hiker commented on Mar 25, 2026

    @hiker
    CollaboratorAuthor

    My current handling of dependency.yaml is here: https://github.com/hiker/um/blob/add_fab_script/fab/dependency_info.py
    ATM, I handle mirroring by modifying the URLs in this class externally, but it might be useful to add mirroring support to this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions