OpenTechFund / bypass-otf_proxy

1 stars 1 forks source link

When there is no match for an alternative, don't do a commit. #47

Closed maxpearl closed 3 years ago

maxpearl commented 3 years ago

When removing an alternative, a commit happens even if there isn't a match for the alternative.

Example:

$ python automation.py --domain=benarnews.org --remove=http://3.221.146.5/english
New listing: {'main_domain': 'benarnews.org', 'available_mirrors': ['3.221.146.5/english/'], 'available_alternatives': [{'created_at': '2020-12-21 13:29:17.748750', 'updated_at': '2020-12-21 13:29:17.748750', 'type': 'mirror', 'proto': 'http', 'url': 'http://3.221.146.5/english/'}]}
Repo Result: {'commit': Commit(sha="b1de2c72477c6f0072173c80eec0ffbd377dbd49"), 'content': ContentFile(path="mirrorSites.json")}
maxpearl commented 3 years ago

Basically, whenever the 'changed' mirror list matches exactly the old one, don't commit.