Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(softwareCenter): add release note URLs for GitHub code repositories #795

Merged
merged 16 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/imageroot/usr/local/agent/pypkg/cluster/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ 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['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:
for module_source, module_instances in list_installed(rdb).items():
Expand Down
DavidePrincipi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
20 changes: 15 additions & 5 deletions core/imageroot/var/lib/nethserver/cluster/repodata-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -116,20 +117,29 @@
"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": "string",
"format": "uri",
"description": "Optional link to the application release notes"
}
},
"required": [
Expand Down
4 changes: 3 additions & 1 deletion core/ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -849,6 +850,7 @@
"uninstall": "Uninstall",
"cluster_up_to_date": "Your cluster is up to date",
"instances": "Instances",
"release_notes": "Release notes",
stephdl marked this conversation as resolved.
Show resolved Hide resolved
"app_info": "App info",
"categories": "Category | Categories",
"latest_version": "Latest version",
Expand Down
8 changes: 8 additions & 0 deletions core/ui/src/components/software-center/AppInfoModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@
</cv-link>
</span>
</template>
<template v-if="app.docs.relnotes_url">
&bull;
<span>
<cv-link :href="app.docs.relnotes_url" target="_blank">
{{ $t("common.release_notes") }}
</cv-link>
</span>
</template>
</div>
</div>
</template>
Expand Down
11 changes: 11 additions & 0 deletions core/ui/src/views/SoftwareCenterAppInstances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@
})
}}
</div>
<template v-if="app.docs.relnotes_url">
stephdl marked this conversation as resolved.
Show resolved Hide resolved
<span>
<cv-link
class="row icon-and-text"
:href="app.docs.relnotes_url"
target="_blank"
>
{{ $t("common.release_notes") }}
</cv-link>
</span>
</template>
<div class="row actions">
<!-- app is installed and can be updated -->
<template v-if="isStableUpdateAvailable(app, instance)">
Expand Down
11 changes: 10 additions & 1 deletion core/ui/src/views/SoftwareCenterCoreApps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,16 @@
}}</a></cv-data-table-cell
>
<cv-data-table-cell>{{ row.node_id }}</cv-data-table-cell>
<cv-data-table-cell>{{ row.version }}</cv-data-table-cell>
<cv-data-table-cell
>{{ row.version }}:
<a
v-if="row.docs.relnotes_url"
:href="row.docs.relnotes_url"
target="_blank"
>{{ $t("common.release_notes") }}</a
>
<span v-else>-</span></cv-data-table-cell
>
<cv-data-table-cell v-if="isCoreUpdatable">
{{ row.update || "-" }}
</cv-data-table-cell>
Expand Down