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

Validation of data on import:instance command #289

Open
HeidiRechek opened this issue Feb 7, 2022 · 3 comments
Open

Validation of data on import:instance command #289

HeidiRechek opened this issue Feb 7, 2022 · 3 comments
Labels

Comments

@HeidiRechek
Copy link

We do build automation using sfcc-ci commands. We are importing the sfra-data.zip for smoke tests, the OCAPI settings get updated with version updates and it breaks our smoke tests. Can we improve the output of the import:instance so we can use the validation to fail builds?

sfcc-ci import:Instance -i **** output shows this

Waiting for job to finish...

Job "sfcc-site-archive-import" finished. Status is: finished (OK)

Execution details:

client_id : ****

duration : 227860

end_time : 2022-02-07T21:02:48.913Z

execution_scopes :

0 : Organization

execution_status : finished

exit_status :

code : OK

status : ok

id : 20668

is_log_file_existing : true

is_restart : false

job_description : Imports Site import archive file content.

job_id : sfcc-site-archive-import

log_file_name : Job-sfcc-site-archive-import-1491fa9de6fcae618365c83493.log

modification_time : 2022-02-07T21:02:48.933Z

parameters :

0 :

  name : ImportMode

  value : merge

1 :

  name : ImportFile

  value : sfra-data.zip

start_time : 2022-02-07T20:59:01.053Z

status : OK

step_executions :

0 :

  duration : 227767

  end_time : 2022-02-07T21:02:48.892Z

  execution_scope : Organization

  execution_status : finished

  exit_status :

    code : OK

    message : 

    status : ok

  id : 21535

  is_chunk_oriented : false

  modification_time : 2022-02-07T21:02:48.892Z

  start_time : 2022-02-07T20:59:01.125Z

  status : OK

  step_description : 

  step_id : ImportSiteArchive

  step_type_id : ImportSiteArchive

  step_type_info : ImportSiteArchive

but the log file shows :
============ Import Results (SUMMARY)
The instance import finished with data errors.
Details:
DataErrorCount: 40
DataWarningCount: 56811
error: OK

@tobiaslohr
Copy link
Contributor

Hi @HeidiRechek , thanks for raising. A couple of thoughts:

  • The OCAPI Data API (used to check the status of the job) returns a status, however that status only reflects the technical status of the job, whether it failed or succeeded. In case of the Site Import (system job), the status is always ok regardless of whether there were data warnings or errors. this is the reason, why the command sfcc-ci instance:import or sfcc-ci job:status return a status OK
  • There is an option to address this through an API change and having the system job sfcc-site-archive-import returning a status ERROR in case of a data error/warning. For this I'd like to ask you to raise an idea on Idea Exchange (at https://ideas.salesforce.com/)
  • Apart from the API change, I can think of an enhancement in the CLI to gain more insights on the actual process (the job) through reading the log file and use this to compile a status on top of what the API does. However, this should be well-thought-out as I don't think we should overwrite the API result, but rather amending it or similar.

Would love to hear your thoughts.

@HeidiRechek
Copy link
Author

so instead of import:instance we could run job:run sfcc-site-archive-import and it would return the errors?

I agree amending the log file with the job result

@nickpalmigiano
Copy link
Contributor

nickpalmigiano commented Mar 23, 2022

@HeidiRechek There is the --failfast flag that you can use for instance:import. It only works with the --sync flag but you do get the correct exit code if the import fails.

sfcc-ci instance:import site_template.zip -i ***.demandware.net --sync --failfast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants