From 8603aaba2dd6a003c95b23f0d590055e2c325591 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 24 May 2018 16:36:07 +0200 Subject: [PATCH 1/5] Use HEAD for all official apps --- official.json | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/official.json b/official.json index c3f2fd34..089fe5e9 100644 --- a/official.json +++ b/official.json @@ -2,35 +2,35 @@ "agendav": { "branch": "master", "level": 0, - "revision": "0259831957d005c64772080c85e81b03604d760f", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/agendav_ynh" }, "ampache": { "branch": "master", "level": 7, - "revision": "56750ddb817a323139974a59ab11cdb449f7ea5a", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/ampache_ynh" }, "baikal": { "branch": "master", "level": 7, - "revision": "c7eefc2013e2e7b17b9fa664b375439bb96fb288", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/baikal_ynh" }, "dokuwiki": { "branch": "master", "level": 4, - "revision": "9e34a8fce00967c8896e26017f26294022f7cbee", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/dokuwiki_ynh" }, "etherpad_mypads": { "branch": "master", "level": 7, - "revision": "9dad23805999e230420ac6b81a27a8536013edfe", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/etherpad_mypads_ynh" }, @@ -44,126 +44,126 @@ "jirafeau": { "branch": "master", "level": 3, - "revision": "1a3defd4d7c5d05f3cd2f5b70bc496674b7cba72", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/jirafeau_ynh" }, "kanboard": { "branch": "master", "level": 7, - "revision": "1941a47d8b916295c1ff6e0e019f8fdf66ba4d3d", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/kanboard_ynh" }, "my_webapp": { "branch": "master", "level": 7, - "revision": "6c3615e5b5224cc1bc12196cf0b440df9fd4ff85", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/my_webapp_ynh" }, "nextcloud": { "branch": "master", "level": 7, - "revision": "1e35eb7e6a6d327d57c872efe65205a18d2bea3a", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/nextcloud_ynh" }, "opensondage": { "branch": "master", "level": 7, - "revision": "edfd98ec2f8d7714496dfe585634b3455884ab3e", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/opensondage_ynh" }, "phpmyadmin": { "branch": "master", "level": 7, - "revision": "b7d01edb9612b3791eeb97de2bf141910597a76d", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/phpmyadmin_ynh" }, "piwigo": { "branch": "master", "level": 7, - "revision": "fe5ab39372ddbb2bb3da6a3cd1b250ae3e98b750", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/piwigo_ynh" }, "rainloop": { "branch": "master", "level": 7, - "revision": "6f996f7d1d986462ef90227a5be51750bcccefa3", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/rainloop_ynh" }, "roundcube": { "branch": "master", "level": 7, - "revision": "a1e12bcf7181447e3e0cefa9ac2a172ada21c3f9", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/roundcube_ynh" }, "searx": { "branch": "master", "level": 2, - "revision": "d522d8dd496c92fc06b8945b73ccf2e371c15d84", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/searx_ynh" }, "shellinabox": { "branch": "master", "level": 7, - "revision": "5e0c058e5f312d0d2cb8a2938195890cc59bca32", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/shellinabox_ynh" }, "strut": { "branch": "master", "level": 0, - "revision": "03c3ea18cf117127749a860afe538bc6070a8e0b", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/strut_ynh" }, "synapse": { "branch": "master", "level": 7, - "revision": "3e91f1c31620d68d5d1f5007ef690c7404aa3f7c", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/synapse_ynh" }, "transmission": { "branch": "master", "level": 7, - "revision": "2687c4b3c405eb98171a938f8c08c23351fb2715", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/transmission_ynh" }, "ttrss": { "branch": "master", "level": 7, - "revision": "7e22b292244af2d14d31d27562e9b6362c023454", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/ttrss_ynh" }, "wallabag2": { "branch": "master", "level": 7, - "revision": "689e47f4c59a4e408edb5e753f6f9ec67a1426ab", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/wallabag2_ynh" }, "wordpress": { "branch": "master", "level": 7, - "revision": "e697540452ef428ffc60de4bab7f0d6df41e9b44", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-Apps/wordpress_ynh" }, "zerobin": { "branch": "master", "level": 7, - "revision": "64be493f069f428800b7a6bae7ae549ec7792b82", + "revision": "HEAD", "state": "validated", "url": "https://github.com/YunoHost-apps/zerobin_ynh" } From 3f30b3b901274de5960f70e1facf83414dc06821 Mon Sep 17 00:00:00 2001 From: Josue-T Date: Thu, 24 May 2018 22:07:09 +0200 Subject: [PATCH 2/5] Set HEAD for all my apps --- community.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/community.json b/community.json index ca126bb9..edfb4ba5 100644 --- a/community.json +++ b/community.json @@ -446,7 +446,7 @@ "gogs": { "branch": "master", "level": 7, - "revision": "36a8e2b30e776a7d29028b7a60fb2bc3cc581931", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/gogs_ynh" }, @@ -480,7 +480,7 @@ "horde": { "branch": "master", "level": 7, - "revision": "444838a1efad9fc59ec9099770f3a6a52ce81a2b", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/horde_ynh" }, @@ -748,7 +748,7 @@ "monitorix": { "branch": "master", "level": 3, - "revision": "0dd44b1c157020dcc2f9c635af7cca9bdd818838", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/monitorix_ynh" }, @@ -898,7 +898,7 @@ "pgadmin": { "branch": "master", "level": 3, - "revision": "716a898ed650a409cdcd7f6c896c5500cc227c3a", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/pgadmin_ynh" }, @@ -997,7 +997,7 @@ "riot": { "branch": "master", "level": 7, - "revision": "f807de03fc3d3f174e96f7700b091ab369e9a499", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/riot_ynh" }, @@ -1044,7 +1044,7 @@ "seafile": { "branch": "master", "level": 1, - "revision": "ce7f4a1910a696234e89ec865b83d9744461caed", + "revision": "HEAD", "state": "working", "url": "https://github.com/YunoHost-Apps/seafile_ynh" }, From 44cb8abd8af7af9efd1c8051e71f6d636446e10f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 May 2018 22:30:55 +0000 Subject: [PATCH 3/5] [mod] update en.json with new translations --- locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en.json b/locales/en.json index 63c15e0e..e2ed7281 100644 --- a/locales/en.json +++ b/locales/en.json @@ -392,7 +392,7 @@ "hextris_manifest_arguments_install_path": "Choose a path for Hextris", "hextris_manifest_description": "A fast paced puzzle game.", "horde_manifest_arguments_install_admin": "Choose an admin user", - "horde_manifest_arguments_install_ansel_install": "Install a full featured phpto management (Ansel) ?", + "horde_manifest_arguments_install_ansel_install": "Install a full featured photo management (Ansel) ?", "horde_manifest_arguments_install_domain": "Choose a domain name for Horde", "horde_manifest_arguments_install_is_public": "Is it a public server ?", "horde_manifest_arguments_install_language": "Choose the application language", From 6aef349012e5bea29b40f43dfb64e81b40a6d18c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 26 May 2018 17:45:31 +0200 Subject: [PATCH 4/5] When using 'HEAD' commit in list, check the diff with with commit from previous build, only update if relevant --- list_builder.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/list_builder.py b/list_builder.py index c6bbd3a6..28719068 100755 --- a/list_builder.py +++ b/list_builder.py @@ -151,16 +151,6 @@ for app, info in apps_list.items(): app_level = info.get("level") github_repo = re_github_repo.match(app_url) - if github_repo and app_rev == "HEAD": - owner = github_repo.group('owner') - repo = github_repo.group('repo') - url = "https://api.github.com/repos/%s/%s/git/refs/heads/%s" % (owner, repo, app_branch) - ref_stuff = get_json(url) - if ref_stuff is None or not "object" in ref_stuff or not "sha" in ref_stuff["object"]: - print("-> Error, couldn't get the commit corresponding to HEAD ..") - continue - app_rev = ref_stuff["object"]["sha"] - previous_state = already_built_file.get(app, {}).get("state", {}) manifest = {} @@ -170,6 +160,28 @@ for app, info in apps_list.items(): previous_url = already_built_file.get(app, {}).get("git", {}).get("url") previous_level = already_built_file.get(app, {}).get("level") + if github_repo and app_rev == "HEAD": + owner = github_repo.group('owner') + repo = github_repo.group('repo') + url = "https://api.github.com/repos/{}/{}/compare/{}...{}".format(owner, repo, previous_rev, app_branch) + diff = get_json(url) + + if not diff["commits"]: + app_rev = previous_rev + else: + + diff_files = diff["commits"][-1] + + # If only those files got updated, we won't want to update the + # commit because that would trigger an unecessary upgrade + ignore_files = [ "README.md", "LICENSE", ".gitignore", "check_process", ".travis.yml" ] + diff_files = [ d for d in diff_files if f["files"]["sha"] not in ignore_files ] + + if diff_files: + app_rev = diff["commits"][-1]["sha"] + else: + app_rev = previous_rev + print("Previous commit : %s" % previous_rev) print("Current commit : %s" % app_rev) From e89375d97cff0546e822c9e1b523d40e02a8f026 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 26 May 2018 16:13:26 +0000 Subject: [PATCH 5/5] Fix / improve previous drunk commit --- list_builder.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/list_builder.py b/list_builder.py index 28719068..360530b6 100755 --- a/list_builder.py +++ b/list_builder.py @@ -169,17 +169,16 @@ for app, info in apps_list.items(): if not diff["commits"]: app_rev = previous_rev else: - - diff_files = diff["commits"][-1] - # If only those files got updated, we won't want to update the # commit because that would trigger an unecessary upgrade ignore_files = [ "README.md", "LICENSE", ".gitignore", "check_process", ".travis.yml" ] - diff_files = [ d for d in diff_files if f["files"]["sha"] not in ignore_files ] + diff_files = [ f for f in diff["files"] if f["filename"] not in ignore_files ] if diff_files: + print("This app points to HEAD and significant changes where found between HEAD and previous commit") app_rev = diff["commits"][-1]["sha"] else: + print("This app points to HEAD but no significant changes where found compared to HEAD, so keeping the previous commit") app_rev = previous_rev print("Previous commit : %s" % previous_rev)