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

[ OOP ] rewrite the logic that manage the commits from github repositories #438

Closed raduiman-zz closed 5 years ago

raduiman-zz commented 5 years ago

Rewrite the logic to get and manage the commits from git repositories using OOP classes and methods.

Where to start:

Using the logic from the modular version ->/fic_modules/git.py, implement the functionality in OOP.

Requirements

raduiman-zz commented 5 years ago

I've started to work on this. -> branch ' issue-438 '

zsoltfay commented 5 years ago

Updated this branch. Added 3 new methods.

Extract commit data from an iterator

    def extract_commit_data(self):
        for commit in self.repo_data.commits():
            self.commit_message = commit.message
            self.commit_date = commit.commit.author.get("date")
            self.commit_sha = commit.sha
            self.commit_author = commit.commit.author.get("name")
            self.commit_author_email = commit.commit.author.get("email")
            self.commit_url = commit.url

Extract last_checked from a local json file

    def last_checked(self, repo_name):
        return json.load(self.load(CHANGELOG_REPO_PATH, repo_name.lower() + ".json")).get("0").get("last_checked")

Extract local_version from a local json file

    def local_version(self, repo_name):
        return json.load(self.load(CHANGELOG_REPO_PATH, repo_name.lower() + ".json")).get("0").get("last_release").get("version")

========================================================

Please note that we are receiving a shortcommit object and that one does not return files_changed

raduiman-zz commented 5 years ago

Continued to implement the GIT part. All to work in progress is on branch issue-438

Added the methods to get the commit information from Github repositories.

Added two main methods to iterate through the repositories and through commits:

Added commit_files_changed, last_check, release_date and list_of_commits to FIC_DataVault

raduiman-zz commented 5 years ago

Updates:

Add the logic to save only the commits that affect the infrastructure according to: 'folders-to-check', 'keyword == deploy' and 'release version tag'

Branch: Issue-438 commit: https://github.com/mozilla-releng/firefox-infra-changelog/commit/4d2c1c3561d06eb37cb1a822f27341b972e920b0

zsoltfay commented 5 years ago

Recent updates:

bccrisan commented 5 years ago

Recent updates:

raduiman-zz commented 5 years ago

Fixed in PR #448