Skip to content

Commit

Permalink
Add validation support for external release metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Jan 11, 2023
1 parent 9f26940 commit c3391e0
Show file tree
Hide file tree
Showing 4 changed files with 373 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/as-component.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ as_component_get_releases (AsComponent *cpt)
g_autoptr(GError) error = NULL;

if (!as_component_load_releases (cpt, FALSE, FALSE, &error))
g_warning ("Error loading data for %s: %s",
g_debug ("Error loading data for %s: %s",
as_component_get_data_id (cpt), error->message);
return priv->releases;
}
Expand Down
22 changes: 22 additions & 0 deletions src/as-validator-issue-tag.h
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,28 @@ AsValidatorIssueTag as_validator_issue_tag_list[] = {
"Sorting releases also increases overall readability of the metainfo file."),
},

{ "releases-type-invalid",
AS_ISSUE_SEVERITY_ERROR,
/* TRANSLATORS: Please do not translate AppStream tag/property names (in backticks). */
N_("The type of the releases block is invalid. It needs to either `embedded` (the default) or `external`."),
},

{ "releases-url-insecure",
AS_ISSUE_SEVERITY_ERROR,
N_("The URL to an external release metadata file is insecure. This is not allowed, please use HTTPS URLs only."),
},

{ "releases-download-failed",
AS_ISSUE_SEVERITY_ERROR,
N_("Failed to download release metadata."),
},

{ "releases-external-not-found",
AS_ISSUE_SEVERITY_WARNING,
N_("A local release metadata file was not found. It is strongly recommended to validate this metadata "
"together with the main MetaInfo file."),
},

{ "release-urgency-invalid",
AS_ISSUE_SEVERITY_WARNING,
N_("The value set as release urgency is not a known urgency value."),
Expand Down
Loading

0 comments on commit c3391e0

Please sign in to comment.