saagie / gradle-saagie-dataops-plugin

Saagie Gradle Plugin for the new version (2.0) of Saagie Dataops Orchestrator
Apache License 2.0
2 stars 0 forks source link

Error importing Java/Scala Job #220

Closed sgokaram-saagie closed 4 years ago

sgokaram-saagie commented 4 years ago

Unable to import the Java/Scala Job. Export works fine. Job id is 21754

shivakumar@saagies-mbp Gradle % gradle -b build.gradle.projectExportJobV1 projectExportV1

Task :projectsExportV1 {"status":"success","exportfile":"./job/export.zip"}

BUILD SUCCESSFUL in 19s 1 actionable task: 1 executed shivakumar@saagies-mbp Gradle % gradle -b build.gradle.projectImportJob projectImport

Task :projectsImport FAILED Something went wrong when creating project job: {"errors":[{"message":"Job not valid","extensions":{"commandLine":"not allowed","package":"not allowed","classification":"ValidationError"}}],"data":null}

FAILURE: Build failed with an exception.

BUILD FAILED in 5s 1 actionable task: 1 executed

plugins { id "io.saagie.gradle-saagie-dataops-plugin" version "2.0.8" }

saagie { server { url = saagieurl login = saagieuserid password = saagiepassword environment = saagieplatformid jwt = true } job { ids = [ "21754" ] } exportArtifacts { export_file = "./job/export.zip" overwrite=true temporary_directory='./tmp' } }

medamineziraoui commented 4 years ago

Release fixe : 2.0.9

medamineziraoui commented 4 years ago

Need validation for this issue @sgokaram-saagie

medamineziraoui commented 4 years ago

How to test :

Version to test : 2.0.22

The Export phase:

Create a build file: Example of build.projectsExportV1.gradle:

plugins {
  id "io.saagie.gradle-saagie-dataops-plugin" version "2.0.22"
}
saagie {
    server {
        url = "REPLACE_SAAGIEURL"
        login = "REPLACE_SAAGIELOGIN"
    password = "REPLACE_SAAGIEPASSWORD"
        environment = "REPLACE_SAAGIE"
    jwt = true
    }
    job {
          ids =  [ "21754" ]
        }
    exportArtifacts {
          export_file = "./job/export.zip" // <=== url "./job/" should exist  
          overwrite=true
      temporary_directory='./tmp'    // <=== temporary_directory ./tmp'  should exist        
    }
}

Export job using this commande : The command line : gradle -b build.projectsExportV1.gradle projectsExportV1

The import phase:

Create a new build file: Example : build.projectsImport.gradle:

plugins {
    id 'groovy'
    id 'io.saagie.gradle-saagie-dataops-plugin' version '2.0.22'
}

saagie {
    server {
        url = "REPLACE_SAAGIEURL"
        login = "REPLACE_SAAGIELOGIN"
    password = "REPLACE_SAAGIEPASSWORD"
        environment = "REPLACE_SAAGIE"
    jwt = true
        acceptSelfSigned = true
    }
    project {
        id = "REPLACE_SAAGIE_PROJECT_ID"
    }
    importArtifacts {
        import_file = "./job/export.zip"
        temporary_directory='./tmp'
    }
}

Then use this command line: The command line : gradle -b build.projectsImport.gradle projectsImport Bug behvior You should get

Task :projectsImport FAILED
Something went wrong when creating project job: {"errors":[{"message":"Job not valid","extensions":{"commandLine":"not allowed","package":"not allowed","classification":"ValidationError"}}],"data":null}

Expected behvior

> Task :projectsImport
{status=success, job=[{id=21754, name=RetrieveCustomerData}], pipeline=[]}

BUILD SUCCESSFUL in 5s
1 actionable task: 1 executed