Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-5536

deployments: improve error handling in the /deployments/next endpoint

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Sprint:
      MEN Sprint 160, MEN Sprint 161
    • Story Points:
      8
    • Remaining Story Points:
      3
    • Backlog:
      yes
    • Days in progress:
      15

      Description

      There are three endpoints the device can use to ask for new update:

      GET /api/devices/v1/deployments/device/deployments/next

      POST /api/devices/v1/deployments/device/deployments/next

      POST /api/devices/v2/deployments/device/deployments/next

       

      When asking for an update, the device provides certain information about currently installed software, e.g. artifact_name, device_type, provides.

      Based on information abut current, active deployments and information from the device, deployments service selects deployment for the device and assigns the artifact.

      If the device will ask for an update, presenting same artifact_name as the one in the deployment, the device will get an empty response, but the deployments service will internally mark the deployment for this device as "Already installed". This should be done only if the deployment didn't started for this device yet.

      When starting the deployment for the device, deployments service saves data from the request with the device deployment object.

      It's possible that the device will ask couple of times for the same update.

      In that case, the deployments service should compare the data for the device from the request with data saved when the device was asking for this particular update for the first time.

      If there is difference between requests, the deployments service should mark the device deployment as failed, forcing the device to rollback.

      Acceptance criteria:

      • /deployments/next error handling implemented as described above;
      • acceptance tests checking the error handling written.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kjaskiewicz Krzysztof Jaśkiewicz
              Reporter:
              kjaskiewicz Krzysztof Jaśkiewicz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support