Project

Profile

Help

Issue #6442

Advisory upload fails if checksum type is provided for any of its packages

Added by ttereshc about 1 year ago. Updated about 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
Yes
Tags:
Sprint:
Quarter:

Description

Upload of an advisory raises invalid literal for int() with base 10: 'sha256' if checksum type is specified.

An example of advisory which triggers the error.

{
  "id": "my_advisory_id",
  "updated_date": "2014-06-10 00:00:00",
  "description": "description",
  "issued_date": "2014-06-10 00:00:00",
  "fromstr": "me",
  "status": "final",
  "title": "kexec-tools bug fix update",
  "summary": "summary",
  "version": "1",
  "type": "bugfix",
  "severity": "",
  "solution": "solution",
  "release": "",
  "rights": "Copyright 2014",
  "pushcount": "1",
  "pkglist": [
    {
      "name": "long namet",
      "shortname": "short name",
      "packages": [
        {
          "arch": "x86_64",
          "epoch": "0",
          "filename": "kexec-tools-2.0.4-32.el7_0.1.x86_64.rpm",
          "name": "kexec-tools",
          "reboot_suggested": false,
          "relogin_suggested": false,
          "restart_suggested": false,
          "release": "32.el7_0.1",
          "src": "kexec-tools-2.0.4-32.el7_0.1.src.rpm",
          "sum": "8e214681104e4ba73726e0ce11d21b963ec0390fd70458d439ddc72372082034",
          "sum_type": "sha256",
          "version": "2.0.4"
        }
      ]
    }
  ],
  "references": [
    {
      "href": "https://example.com/",
      "id": "",
      "title": "my advisory",
      "type": "bugzilla"
    }
  ],
  "reboot_suggested": false
}

Proposed solution

Currently, sum_type is a TextField which stores an id(int) of checksum type as it defined in createrepo_c. The suggestion is:

  • change a filed type and store an integer value in the PositiveIntegerField with choices, values for which are taken from what is supported in createrpo_c.
  • write a migration to convert the field to integer
  • convert a string representing checksum type to a createrepo_c id during upload

Associated revisions

Revision 73c7dc0e View on GitHub
Added by ppicka about 1 year ago

Advisory package sum_type

Advisory package sum_type will be stored as INT as createrepo_c uses it. Upload will translate supported checksum from str to int. User will still see a string representation of sum_type.

closes #6442 https://pulp.plan.io/issues/6442

Revision ee108c15 View on GitHub
Added by ppicka about 1 year ago

Sum type in lower

Advisory package sum types is now shown in lower for consistency.

re #6442 https://pulp.plan.io/issues/6442

History

#1 Updated by ttereshc about 1 year ago

  • Description updated (diff)

#2 Updated by ppicka about 1 year ago

  • Triaged changed from No to Yes
  • Sprint Candidate changed from No to Yes

#3 Updated by ppicka about 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ppicka

#4 Updated by pulpbot about 1 year ago

  • Status changed from ASSIGNED to POST

#5 Updated by ppicka about 1 year ago

  • Status changed from POST to MODIFIED

#7 Updated by dalley about 1 year ago

  • Sprint/Milestone set to Pulp RPM 3.3.0

#8 Updated by dalley about 1 year ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF