Inform user better when job import completes

Assignee

Reporter

Sprint

Description

Sometimes the job import completes but there are some things user should be informed about. The info/warning/error messages must be nice and human readable.

We'll need to be able to report and display multiple messages at the same time (e.g. both source and target were imported with some warning).

 

This should produce info in wrangler UI:

  • Import completed without any issues.

These should produce warning in wrangler UI:

This should produce error in wrangler UI:

  • 'Overwrite' was disabled and some of the resources already exist (e.g. source with same name already exists). The message must clearly describe which file caused this problem.

 

When the job was actually imported (so the result is info or warning), the imported job should be selected in the table. This focusing is already implemented, we just need to not break it.

Steps to reproduce

None

Activity

Show:

Jaroslav Kylberger July 4, 2023 at 9:43 AM

QA:

Check that the messages are displayed correctly when importing the job.

Examples of how to produce different results:

To produce error - import job without overwrite option checked when the job or source with the same name already exists.

To produce multiple warnings - export job without source files with multiple lookups, delete the source files for the lookup sources, import the job.

Pavel Salamon June 23, 2023 at 8:43 AM
Edited

Processing and displaying of the new response in UI will be done here: https://cloverdx.atlassian.net/browse/CLO-26809#icft=CLO-26809

Jaroslav Kylberger June 22, 2023 at 12:34 PM

Two related issues implemented as part of this issue/pull request:

https://cloverdx.atlassian.net/browse/CLO-26607#icft=CLO-26607 Cannot import job when it uses unavailable library - now the job is imported with warning

https://cloverdx.atlassian.net/browse/CLO-26664#icft=CLO-26664 Error (Request is not valid) when importing a job - this is about the source (csv) file missing (in zip and on disk) - now the job is imported with warning

 

Jaroslav Kylberger June 22, 2023 at 12:05 PM
Edited

Response changes
If the request can be processed, it returns HTTP status code 200 and the real result is in response body.
If the request cannot be processed returns 4xx (bad request, access forbidden, not found).

Response format for 200:

example:

{
  result: "WARN",  ... required, "OK" -> imported, "WARN" -> imported with warning(s), "ERROR" -> not imported
  messages: [      ... present only if some message of 'result' severity exists
    "Source file 'file1' is missing.",
    "Source file 'file2' is missing.",
  ],
  job:                  ... present only if job was imported

  {

  },

{{}}}

definition in yaml:

JobImportResult:
  description: "Result of job import"
  readOnly: true
  required:
    - "result"
  properties:
    "result":
      type: string
      enum:
        - "OK" (imported)
        - "WARN" (imported with warning(s))
        - "ERROR" (not imported)
    "messages":
      type: array
      readOnly: true
      items:
        type: string
    "job":
      $ref: "#/components/schemas/Job"

Fixed

Details

Priority

Fix versions

QA Testing

JUnit test

QA Test Identification

Created June 20, 2023 at 8:49 AM
Updated October 3, 2023 at 8:44 AM
Resolved July 4, 2023 at 9:43 AM