Closed zsoltfay closed 5 years ago
this method was never called thus self.local_version
would always be None
def _get_release(self):
self.release_version = [tag for tag in self.repo_data.tags(number=1)][0].name
self.local_version
would be None since there would be no previous file to extract it from:
return {"0": {"last_checked": return_time("%Y-%m-%dT%H:%M:%S.%f", "sub", 2), "version": self.local_version}}
start_github()
is called By using addonscript as the testing repository the results were as expected: This test code:
a = FICGithub()
a.repo_name = "addonscript"
a._repo_team()
a.read_repo()
a.repo_type = "tag"
a.release_version = a._get_release(1)
print("first element: ", a._generate_first_element_git(a.repo_type))
print("last official release: ", a.release_version)
Returned the expected versions:
first element: {'0': {'last_checked': '2019-05-09T03:02:57.750501', 'version': '0.4'}}
last official release: 1.0
Process finished with exit code 0
The HG part was implemented in PR: https://github.com/mozilla-releng/firefox-infra-changelog/pull/459 and GIT in: https://github.com/mozilla-releng/firefox-infra-changelog/pull/448
What do we have right now:
At the moment we are only saving the new commits into the json files.
What we miss:
Solution
have a dedicated dictionary that we build:
json.dump
this dictionary into the proper json file