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

Error 500 when exporting global scope variables #293

Open
medamineziraoui opened this issue Aug 25, 2020 · 3 comments
Open

Error 500 when exporting global scope variables #293

medamineziraoui opened this issue Aug 25, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@medamineziraoui
Copy link
Contributor

medamineziraoui commented Aug 25, 2020

When using this build with this command line
gradle -b build.exportV2.gradle projectsExport

File name : Build.exportV2.gradle

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

saagie {
    server {
        url = saagieurl
        login = saagieuserid
        password = saagiepassword
        environment = 4
        jwt = true
        acceptSelfSigned = true
    }
    
    project {
        id = saagieprojectid
    }
    
    env {
        include_all_var = true
        scope = 'global'
    }

    exportArtifacts {
        export_file = "/test_gradle/variable_export_4.zip"
        temporary_directory='/test_gradle/tmp'
        overwrite=true
    }
}

We get build failure :

> Task :projectsExport FAILED
Error 500 when requesting 


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':projectsExport'.
> Error 500 when requesting 

@medamineziraoui medamineziraoui added the bug Something isn't working label Aug 25, 2020
@medamineziraoui medamineziraoui added this to the 2.2 milestone Aug 25, 2020
@medamineziraoui
Copy link
Contributor Author

medamineziraoui commented Aug 25, 2020

Release 2.1.2

How to test :
Export variables:

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

saagie {
    server {
        url = saagieurl
        login = saagieuserid
        password = saagiepassword
        environment = 4
        jwt = true
        acceptSelfSigned = true
    }
    
    project {
        id = saagieprojectid
    }
    
    env {
        include_all_var = false // <==== should be true or false
        scope = 'project' // <=== alternate between project | global
        name = ['PROJECT_VAR', 'pro'] // <===== name should bot be empty if include_all_var is false
    }

    exportArtifacts {
        export_file = "/path/to/exported/variable/export_variables.zip"
        overwrite=true
    }
}

Commande line :
gradle -b build.exportV2.gradle projectsExport

case scope is global and include_all_var is true :
exportV2ScopeGlobalAllVars

case scope is global and include_all_var is false with names defined:
exportV2ScopeGlobalVarsByName

case scope is project and ( include_all_var is true and include_all_var is false with names defined )
exportV2ScopeProjectAllVarAndByName
:

Import Variables :

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

saagie {
    server {
        url = saagieurl
        login = saagieuserid
        password = saagiepassword
        environment = saagieplatformid
        jwt = true
        acceptSelfSigned = true
    }

    project {
        id = saagieprojectid
    }

    importArtifacts {
        import_file = "/path/to/export/fileShouldExist/export_project_var.zip" // <==== switch between export_project_var and export_global_var_name for global var import and project var import

    }
}

export_project_var :
export_project_var.zip

export_global_var_name :
export_global_var_name.zip

Commande line :
gradle -b build.import.gradle projectsImport

Should have successful build:

{status=success, job=[], pipeline=[], variable=[{id=id, name=PROJECT_VAR_FROM_TEST_2.1.2}, {id=id, name=pro_FROM_PROJECT_2.1.2}]}
BUILD SUCCESSFUL in 3s

Importing environment variable test for global scope:
importv2globalscope

Importing environment variable test for project scope:
IMPORTANT NOTE: Those variables shouldn t exist on the server.
importv2projectvar

@ZouhairBear
Copy link
Contributor

ZouhairBear commented Sep 1, 2020

  • i have tested the issue for the exportV2 : test works successfully as expected

293

  • i have tested the issue for the importV2 : test works successfully as expected

293-import

  • It's validated for me

@ZouhairBear
Copy link
Contributor

Test for release 2.1.5

  • i have tested the issue for the exportV2 : test works successfully as expected

293exportNew

  • i have tested the issue for the importV2 : test works successfully as expected

293importNew

  • It's validated for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants