From 3c3127ef2cb822d162f90c9d031402c649db35b0 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 29 Jan 2025 15:49:16 +0100 Subject: [PATCH 01/16] feat(softwareCenter): add release note URLs for GitHub code repositories --- core/imageroot/usr/local/agent/pypkg/cluster/modules.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py index e71f99693..4ef5a61a7 100644 --- a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py +++ b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py @@ -336,6 +336,14 @@ def _get_available_modules(rdb): continue # skip duplicated images from lower priority modules modules[rmod["source"]] = rmod rmod['versions'].sort(key=lambda v: _parse_version_object(v["tag"]), reverse=True) + # Set the general release note URL if the code URL is a GitHub repository + if rmod.get('docs') and rmod['docs'].get('code_url').startswith("https://github.com/") and not rmod['docs'].get('relnotes_url'): + rmod['docs']['relnotes_url']= f"{rmod['docs']['code_url']}/releases" + else: + if not rmod.get('docs'): + rmod['docs'] = {} + rmod['docs']['relnotes_url']= "" + # Integrate the available set with instances that do not belong to any # repository. They can be found in the "installed" dict: for module_source, module_instances in list_installed(rdb).items(): From ce47432f7f94a29d02e01f46bb3a93207f81b3cb Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 29 Jan 2025 16:46:25 +0100 Subject: [PATCH 02/16] fix: ensure release note URL is set correctly for GitHub code repositories --- core/imageroot/usr/local/agent/pypkg/cluster/modules.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py index 4ef5a61a7..12d3ec5c9 100644 --- a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py +++ b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py @@ -337,12 +337,10 @@ def _get_available_modules(rdb): modules[rmod["source"]] = rmod rmod['versions'].sort(key=lambda v: _parse_version_object(v["tag"]), reverse=True) # Set the general release note URL if the code URL is a GitHub repository - if rmod.get('docs') and rmod['docs'].get('code_url').startswith("https://github.com/") and not rmod['docs'].get('relnotes_url'): + if rmod['docs']['code_url'].startswith("https://github.com/") and not rmod['docs'].get('relnotes_url', ''): rmod['docs']['relnotes_url']= f"{rmod['docs']['code_url']}/releases" else: - if not rmod.get('docs'): - rmod['docs'] = {} - rmod['docs']['relnotes_url']= "" + rmod['docs']['relnotes_url'] = "" # Integrate the available set with instances that do not belong to any # repository. They can be found in the "installed" dict: From 639c47fd78f0a6fa1f4562cd1d1908e78e1010d3 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 29 Jan 2025 16:52:56 +0100 Subject: [PATCH 03/16] Apply suggestions from code review Co-authored-by: Davide Principi --- core/imageroot/usr/local/agent/pypkg/cluster/modules.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py index 12d3ec5c9..1eb05deb0 100644 --- a/core/imageroot/usr/local/agent/pypkg/cluster/modules.py +++ b/core/imageroot/usr/local/agent/pypkg/cluster/modules.py @@ -337,10 +337,8 @@ def _get_available_modules(rdb): modules[rmod["source"]] = rmod rmod['versions'].sort(key=lambda v: _parse_version_object(v["tag"]), reverse=True) # Set the general release note URL if the code URL is a GitHub repository - if rmod['docs']['code_url'].startswith("https://github.com/") and not rmod['docs'].get('relnotes_url', ''): - rmod['docs']['relnotes_url']= f"{rmod['docs']['code_url']}/releases" - else: - rmod['docs']['relnotes_url'] = "" + if rmod['docs']['code_url'].startswith("https://github.com/") and 'relnotes_url' not in rmod['docs']: + rmod['docs']['relnotes_url'] = f"{rmod['docs']['code_url']}/releases" # Integrate the available set with instances that do not belong to any # repository. They can be found in the "installed" dict: From 754a0e99823a3375ac9ee6f149515871ddbccd28 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Wed, 29 Jan 2025 17:01:40 +0100 Subject: [PATCH 04/16] feat(SoftwareCenter): add release notes URL to the repodata schema --- .../var/lib/nethserver/cluster/repodata-schema.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json b/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json index 668c376e2..98bb52625 100644 --- a/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json +++ b/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json @@ -27,7 +27,8 @@ "docs": { "documentation_url": "https://docs.nethserver.org", "bug_url": "https://github.com/NethServer/dev", - "code_url": "https://github.com/NethServer/" + "code_url": "https://github.com/NethServer/", + "relnotes_url": "https://github.com/NethServer/ns8-kickstart/releases" }, "source": "ghcr.io/nethserver/dokuwiki", "versions": [ @@ -130,6 +131,10 @@ "code_url": { "type": "uri", "description": "Link to the source code repository" + }, + "relnotes_url": { + "type": "uri", + "description": "Optional link to the application release notes" } }, "required": [ From 6b1777a8e3cfc7b61f845e32b8de0ea7e3aeb9f3 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 09:12:11 +0100 Subject: [PATCH 05/16] fix: update schema to use string type for URLs --- .../actions/list-modules/validate-output.json | 12 ++++++++---- .../lib/nethserver/cluster/repodata-schema.json | 15 ++++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/imageroot/var/lib/nethserver/cluster/actions/list-modules/validate-output.json b/core/imageroot/var/lib/nethserver/cluster/actions/list-modules/validate-output.json index d57a6d8db..bc94829a6 100644 --- a/core/imageroot/var/lib/nethserver/cluster/actions/list-modules/validate-output.json +++ b/core/imageroot/var/lib/nethserver/cluster/actions/list-modules/validate-output.json @@ -160,19 +160,23 @@ "type": "object", "parameters": { "terms_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Optional link to the application Terms & Conditions document" }, "documentation_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the package documentation" }, "bug_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the package issue tracker" }, "code_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the source code repository" } }, diff --git a/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json b/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json index 98bb52625..7eeca495a 100644 --- a/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json +++ b/core/imageroot/var/lib/nethserver/cluster/repodata-schema.json @@ -117,23 +117,28 @@ "type": "object", "parameters": { "terms_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Optional link to the application Terms & Conditions document" }, "documentation_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the package documentation" }, "bug_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the package issue tracker" }, "code_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Link to the source code repository" }, "relnotes_url": { - "type": "uri", + "type": "string", + "format": "uri", "description": "Optional link to the application release notes" } }, From 49e6f9ae41dc579cec718bf1e409c5ed041ae16d Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 09:48:57 +0100 Subject: [PATCH 06/16] feat(AppInfoModal): add release notes link to app info modal --- core/ui/public/i18n/en/translation.json | 3 ++- core/ui/src/components/software-center/AppInfoModal.vue | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/ui/public/i18n/en/translation.json b/core/ui/public/i18n/en/translation.json index f15cfc552..e7f230271 100644 --- a/core/ui/public/i18n/en/translation.json +++ b/core/ui/public/i18n/en/translation.json @@ -87,7 +87,8 @@ "configure": "Configure", "terms_and_conditions": "Terms and Conditions", "terms_required": "Please read and agree to @:common.terms_and_conditions", - "not_available": "Not available" + "not_available": "Not available", + "release_notes": "Release notes" }, "error": { "error": "Error", diff --git a/core/ui/src/components/software-center/AppInfoModal.vue b/core/ui/src/components/software-center/AppInfoModal.vue index e862e22f2..988fcbff6 100644 --- a/core/ui/src/components/software-center/AppInfoModal.vue +++ b/core/ui/src/components/software-center/AppInfoModal.vue @@ -157,6 +157,14 @@ + From 77fd7163729aeaa2271e012664d58b0964b1ccb8 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 10:31:15 +0100 Subject: [PATCH 07/16] feat(ReleaseNotes): add release notes link for app versions in UpdateAppModal and SoftwareCenterAppInstances --- core/ui/public/i18n/en/translation.json | 3 ++- .../src/components/software-center/UpdateAppModal.vue | 10 ++++++++++ core/ui/src/views/SoftwareCenterAppInstances.vue | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/core/ui/public/i18n/en/translation.json b/core/ui/public/i18n/en/translation.json index e7f230271..c60ab3ef4 100644 --- a/core/ui/public/i18n/en/translation.json +++ b/core/ui/public/i18n/en/translation.json @@ -88,7 +88,8 @@ "terms_and_conditions": "Terms and Conditions", "terms_required": "Please read and agree to @:common.terms_and_conditions", "not_available": "Not available", - "release_notes": "Release notes" + "release_notes": "Release notes", + "release_notes_of_version": "Release notes of version {app}" }, "error": { "error": "Error", diff --git a/core/ui/src/components/software-center/UpdateAppModal.vue b/core/ui/src/components/software-center/UpdateAppModal.vue index a4f3dd0f5..3f72e6f68 100644 --- a/core/ui/src/components/software-center/UpdateAppModal.vue +++ b/core/ui/src/components/software-center/UpdateAppModal.vue @@ -39,6 +39,16 @@ } ) }} +
+
@@ -236,8 +245,8 @@ export default { }, updateTableData() { this.tableColumns = this.isCoreUpdatable - ? ["id", "node_id", "version", "update"] - : ["id", "node_id", "version"]; + ? ["id", "node_id", "version", "update", "release_notes"] + : ["id", "node_id", "version", "release_notes"]; }, async listCoreModules() { this.error.listCoreModules = ""; From 3e2ccccc19587e18593dc50270593399b55f6b6d Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 11:18:10 +0100 Subject: [PATCH 09/16] refactor(UpdateAppModal): remove release notes link for app version --- core/ui/public/i18n/en/translation.json | 3 +-- .../src/components/software-center/UpdateAppModal.vue | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/core/ui/public/i18n/en/translation.json b/core/ui/public/i18n/en/translation.json index cf0d80703..398b5b14c 100644 --- a/core/ui/public/i18n/en/translation.json +++ b/core/ui/public/i18n/en/translation.json @@ -88,8 +88,7 @@ "terms_and_conditions": "Terms and Conditions", "terms_required": "Please read and agree to @:common.terms_and_conditions", "not_available": "Not available", - "release_notes": "Release notes", - "release_notes_of_version": "Release notes of version {app}" + "release_notes": "Release notes" }, "error": { "error": "Error", diff --git a/core/ui/src/components/software-center/UpdateAppModal.vue b/core/ui/src/components/software-center/UpdateAppModal.vue index 3f72e6f68..a4f3dd0f5 100644 --- a/core/ui/src/components/software-center/UpdateAppModal.vue +++ b/core/ui/src/components/software-center/UpdateAppModal.vue @@ -39,16 +39,6 @@ } ) }} -
Date: Thu, 30 Jan 2025 11:31:58 +0100 Subject: [PATCH 10/16] feat(SoftwareCenter): display release notes in the version column --- core/ui/src/views/SoftwareCenterCoreApps.vue | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/ui/src/views/SoftwareCenterCoreApps.vue b/core/ui/src/views/SoftwareCenterCoreApps.vue index e2715f0e8..247db5890 100644 --- a/core/ui/src/views/SoftwareCenterCoreApps.vue +++ b/core/ui/src/views/SoftwareCenterCoreApps.vue @@ -97,19 +97,19 @@ }} {{ row.node_id }} - {{ row.version }} - - {{ row.update || "-" }} - - + {{ row.version }}: {{$t("common.release_notes")}}{{ $t("common.release_notes") }} - + + {{ row.update || "-" }} + @@ -245,8 +245,8 @@ export default { }, updateTableData() { this.tableColumns = this.isCoreUpdatable - ? ["id", "node_id", "version", "update", "release_notes"] - : ["id", "node_id", "version", "release_notes"]; + ? ["id", "node_id", "version", "update"] + : ["id", "node_id", "version"]; }, async listCoreModules() { this.error.listCoreModules = ""; From 88ee89ac2295a943c5e4a8bcfafcc368eb8b7d1a Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 12:25:45 +0100 Subject: [PATCH 11/16] feat(SoftwareCenter): display in the update column with icon --- core/ui/src/views/SoftwareCenterCoreApps.vue | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/ui/src/views/SoftwareCenterCoreApps.vue b/core/ui/src/views/SoftwareCenterCoreApps.vue index 247db5890..fc6f70d3c 100644 --- a/core/ui/src/views/SoftwareCenterCoreApps.vue +++ b/core/ui/src/views/SoftwareCenterCoreApps.vue @@ -97,18 +97,17 @@ }} {{ row.node_id }} - {{ row.version }}: - {{ $t("common.release_notes") }} - - + {{ row.version }} {{ row.update || "-" }} +
+ {{ $t("common.release_notes") }} +
@@ -137,10 +136,11 @@ import { import { mapState, mapActions } from "vuex"; import to from "await-to-js"; import AppInfoModal from "@/components/software-center/AppInfoModal"; +import { Launch20 } from "@carbon/icons-vue"; export default { name: "SoftwareCenterCoreApps", - components: { AppInfoModal }, + components: { AppInfoModal, Launch20 }, mixins: [ IconService, QueryParamService, From 59a9d6b4eea20f56b609d67fd09fe9d526501643 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 12:53:26 +0100 Subject: [PATCH 12/16] refactor(SoftwareCenterCoreApps): display changelog inline --- core/ui/src/views/SoftwareCenterCoreApps.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/core/ui/src/views/SoftwareCenterCoreApps.vue b/core/ui/src/views/SoftwareCenterCoreApps.vue index fc6f70d3c..91b74fe59 100644 --- a/core/ui/src/views/SoftwareCenterCoreApps.vue +++ b/core/ui/src/views/SoftwareCenterCoreApps.vue @@ -100,14 +100,12 @@ {{ row.version }} {{ row.update || "-" }} -
- {{ $t("common.release_notes") }} -
+ {{ $t("common.release_notes") }}
From d8cd85e791af4f8d2d867a65317ef566f0d3d870 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 13:01:18 +0100 Subject: [PATCH 13/16] feat(SoftwareCenterAppInstances): add launch icon to release notes link --- core/ui/src/views/SoftwareCenterAppInstances.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/ui/src/views/SoftwareCenterAppInstances.vue b/core/ui/src/views/SoftwareCenterAppInstances.vue index ec44e096b..fbb9872a7 100644 --- a/core/ui/src/views/SoftwareCenterAppInstances.vue +++ b/core/ui/src/views/SoftwareCenterAppInstances.vue @@ -330,7 +330,7 @@ :href="app.docs.relnotes_url" target="_blank" > - {{ $t("common.release_notes") }} + {{ $t("common.release_notes") }} @@ -472,6 +472,7 @@ import { mapState, mapActions } from "vuex"; import CloneOrMoveAppModal from "@/components/software-center/CloneOrMoveAppModal"; import UpdateAppModal from "../components/software-center/UpdateAppModal"; import Information16 from "@carbon/icons-vue/es/information/16"; +import { Launch20 } from "@carbon/icons-vue"; export default { name: "SoftwareCenterAppInstances", @@ -480,6 +481,7 @@ export default { CloneOrMoveAppModal, UpdateAppModal, Information16, + Launch20, }, mixins: [ TaskService, From 0d0d30cc75ee1c58fcb4a9f24bf246f54bb75610 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 16:01:43 +0100 Subject: [PATCH 14/16] refactor(SoftwareCenterCoreApps): replace release notes link with button component --- core/ui/src/views/SoftwareCenterCoreApps.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/ui/src/views/SoftwareCenterCoreApps.vue b/core/ui/src/views/SoftwareCenterCoreApps.vue index 91b74fe59..b4e3601c5 100644 --- a/core/ui/src/views/SoftwareCenterCoreApps.vue +++ b/core/ui/src/views/SoftwareCenterCoreApps.vue @@ -104,8 +104,11 @@ v-if="row.docs.relnotes_url && row.update" :href="row.docs.relnotes_url" target="_blank" - >{{ $t("common.release_notes") }} + > + + {{ $t("common.release_notes") }} + @@ -134,11 +137,10 @@ import { import { mapState, mapActions } from "vuex"; import to from "await-to-js"; import AppInfoModal from "@/components/software-center/AppInfoModal"; -import { Launch20 } from "@carbon/icons-vue"; export default { name: "SoftwareCenterCoreApps", - components: { AppInfoModal, Launch20 }, + components: { AppInfoModal }, mixins: [ IconService, QueryParamService, From 3a5f15af0baae17bf0a97c4213abb0a0af822a38 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Thu, 30 Jan 2025 16:16:30 +0100 Subject: [PATCH 15/16] feat(SoftwareCenterAppInstances): replace release notes link with button component --- .../src/views/SoftwareCenterAppInstances.vue | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/core/ui/src/views/SoftwareCenterAppInstances.vue b/core/ui/src/views/SoftwareCenterAppInstances.vue index fbb9872a7..62d8e5276 100644 --- a/core/ui/src/views/SoftwareCenterAppInstances.vue +++ b/core/ui/src/views/SoftwareCenterAppInstances.vue @@ -323,17 +323,23 @@ }) }}
- +
+ + + {{ $t("common.release_notes") }} + + +