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

Check missing release props #372

Merged
merged 4 commits into from Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -685,6 +685,17 @@ AsValidatorIssueTag as_validator_issue_tag_list[] = {
N_("The value set as release type is invalid."),
},

{ "release-version-missing",
AS_ISSUE_SEVERITY_ERROR,
/* TRANSLATORS: Please do not translate AppStream tag and property names (in backticks). */
N_("The release is missing the `version` property."),
},

{ "release-time-missing",
AS_ISSUE_SEVERITY_ERROR,
/* TRANSLATORS: Please do not translate AppStream tag and property names (in backticks). */
N_("The release is missing either the `date` (preferred) or the `timestamp` property."),
},
{ "artifact-type-invalid",
AS_ISSUE_SEVERITY_ERROR,
/* TRANSLATORS: Please do not translate AppStream tag and property names (in backticks). */
@@ -1519,11 +1519,22 @@ as_validator_check_release (AsValidator *validator, xmlNode *node, AsFormatStyle
{
gchar *prop;

/* validate presence of version property */
prop = as_xml_get_prop_value (node, "version");
if (prop == NULL)
as_validator_add_issue (validator, node, "release-version-missing", "version");
g_free (prop);

/* validate date strings */
prop = as_xml_get_prop_value (node, "date");
if (prop != NULL) {
as_validator_validate_iso8601_complete_date (validator, node, prop);
g_free (prop);
} else {
g_autofree gchar *timestamp = as_xml_get_prop_value (node, "timestamp");
/* Neither timestamp, nor date property exists */
if (timestamp == NULL)
as_validator_add_issue (validator, node, "release-time-missing", "date");
}
prop = as_xml_get_prop_value (node, "date_eol");
if (prop != NULL) {