Skip to content

Conversation

gherceg
Copy link
Contributor

@gherceg gherceg commented Sep 8, 2023

https://dimagi-dev.atlassian.net/browse/CDTW-29

Since moving staging config files to the staging-branches repository, this has been on the list of things to do.

The jist of this PR is converting this logic in the rebuildstaging script:

    REPO_ROOT='artifacts/staging-branches'
    if [[ ! -d "$REPO_ROOT/.git" ]]
    then
        git clone https://github.com/dimagi/staging-branches.git "$REPO_ROOT"
    else
        git -C "$REPO_ROOT" pull origin main
    fi

    git -C "$REPO_ROOT" show -n 1 -- commcare-hq-staging.yml

to python in git-build-branch, and allowing the caller to pass in the necessary info for this. Having this logic in git-build-branch instead of the rebuildstaging bash script that calls git-build-branch lays the groundwork for automating branch removal in git-build-branch as well.

I left the config_path untouched for now to avoid any breaking change to git-build-branch, but I do think it makes sense to make that an optional keyword argument that can be used instead of the remote repo arguments. It could even make sense to do so in this PR, but wanted to get thoughts from others.

@gherceg gherceg force-pushed the gh/support-fetching-file branch from a76d59d to 6c84786 Compare September 8, 2023 19:03
Copy link
Contributor

@millerdev millerdev left a comment

Choose a reason for hiding this comment

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

I left the config_path untouched for now ... , but I do think it makes sense to make that an optional keyword argument that can be used instead of the remote repo arguments.

It does sound like a good idea to move those arguments to a config file. Can you elaborate on what you have in mind, or maybe just implement it as a separate draft PR to be merged into this one?

@gherceg
Copy link
Contributor Author

gherceg commented Sep 11, 2023

@millerdev oh interesting. That is actually not what I was referring to (I was referring to the staging.yml config file), but I do like the idea of only having to pass the path to a local config file that provides the necessary information for git-build-branch to clone/update the repo and identify the correct staging config file to use.

Dropping this for now to work on more important things but can create that PR off of this one in the future (or anyone should feel free to do so as well).

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.

3 participants