Clean up the OBS updater and make sure the commit messages are labeled
To distinguish this from regular humans.
This commit is contained in:
parent
432a5614dd
commit
5e95b7409f
1 changed files with 4 additions and 5 deletions
|
@ -10,7 +10,6 @@ from urllib.parse import quote
|
|||
|
||||
import git
|
||||
import requests
|
||||
import sarge
|
||||
|
||||
API_URL = "https://invent.kde.org/api/v4/projects/"
|
||||
OBS_URL = "https://api.opensuse.org/trigger/runservice"
|
||||
|
@ -86,8 +85,9 @@ def trigger_update(repository, package_name, token):
|
|||
result = requests.post(OBS_URL, params=parameters, headers=header)
|
||||
|
||||
if not result:
|
||||
logging.error("Error during service run, package %s, error code %s, url %s",
|
||||
package_name, result.status_code, result.url)
|
||||
logging.error(
|
||||
"Error during service run, package %s, error code %s, url %s",
|
||||
package_name, result.status_code, result.url)
|
||||
return False
|
||||
|
||||
logging.debug("Package %s complete", package_name)
|
||||
|
@ -105,7 +105,6 @@ def update_package(hash_data, package_name,
|
|||
return
|
||||
|
||||
remote_hash = get_remote_hash(repo_name, branch)
|
||||
repo_hashes = hash_data.get(obs_repository)
|
||||
|
||||
if hash_data.get(obs_repository) is None:
|
||||
logging.debug("No prior data - initializing empty")
|
||||
|
@ -155,7 +154,7 @@ def commit_changes(cache_file, repo_home):
|
|||
|
||||
repo = git.Repo(repo_home)
|
||||
repo.index.add([cache_file])
|
||||
repo.index.commit("Update caches")
|
||||
repo.index.commit("[OBS unstable update bot] Update caches")
|
||||
origin = repo.remotes["origin"]
|
||||
origin.pull(rebase=True)
|
||||
origin.push()
|
||||
|
|
Loading…
Add table
Reference in a new issue