mozilla-releng / firefox-infra-changelog

Automated tool which builds a changelog of commits happening on git and hg that could affect Firefox CI Infra.
2 stars 8 forks source link

[Core] Use repositories.json parent keys when searching/filtering for repo data #403

Closed bccrisan closed 5 years ago

bccrisan commented 5 years ago

In the current version of the script we have functions where we need to specify the type of the repository we are working on. Either it's github or mercurial and there are cases where this can be automated by checking the parent JSON type and avoid things like:

    changelog_data.update({"Github": git_data})
    changelog_data.update({"Hg": hg_data})

or

 for element in list:
        if (which_repo == "complete" or which_repo == "Git") and element[2] == "git":
            extract_json_from_git(element[1], days_to_generate)
            LOGGER.info("GIT %s Repository: %s", successfully_generated, element[1])

        if (which_repo == "complete" or which_repo == "Hg") and element[2] == "hg":
            extract_json_from_hg(element[1], days_to_generate)
            LOGGER.info("HG %s Repository: %s", successfully_generated, element[1])

        if which_repo != "complete" and which_repo != "Git" and which_repo != "Hg":
            LOGGER.error("No {} table was generated!".format(element[2]))
zsoltfay commented 5 years ago

I've started work on this. Created branch issue-403. Tested all the additions thus far and it all works.