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

Environment Variable Export - Wrong error message #301

Open sgokaram-saagie opened 4 years ago

sgokaram-saagie commented 4 years ago

Trying to export all project environment variables from a project where none is defined then the task fails with a mis leading error message

saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport

Task :projectsExport FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s 1 actionable task: 1 executed

In the usecase of exporting all Global or Project level environment variables and if none is found then just print out a WARN statement that No variables found and do not create the zip file.

Also the message jobs, pipelines and variables to be exported can t be empty at the same time

What is this " can t " ? Gramatically wrong in ENGLISH, change this to cannot

medamineziraoui commented 4 years ago

Can you share the build for this issue please

sgokaram-saagie commented 4 years ago

Steps to recreate issues

  1. Select project that does not have any PROJECT scope variables defined in it.

  2. Run the below plugins { id "io.saagie.gradle-saagie-dataops-plugin" version "2.1.4" }

saagie { server { url = saagieurl login = saagieuserid password = saagiepassword environment = saagieplatformid jwt = true } project { id = saagieprojectid } env { include_all_var = 'true' scope = 'project' } exportArtifacts { export_file = "./env/env.zip" overwrite=true temporary_directory='./tmp'
} }

This gradle tasks errors with the below

saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport

Task :projectsExport FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 3s 1 actionable task: 1 executed

medamineziraoui commented 4 years ago

How to test :

Version to test : 2.1.8

The error build case with warning message:

Case platform have no project scope env.

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

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

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

   project {
    id = saagieprojectid
}
env {
    include_all_var=true
    scope = "project"
}
    importArtifacts {
        import_file = "./job/export.zip"
        temporary_directory='./tmp'
    }
}

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

301

The successful case : The platform have one job requested in the build but have no project scope env.

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

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

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

job {
    ids = ['19d89f9a-1175-4833-a0cb-7d5ab4a8fd34']
}
project {
    id = saagieprojectid
}
env {
    include_all_var=true
    scope = "project"
}
}

Then use this command line: The command line : gradle -b build.projectsImport.gradle projectsImport

Expected behvior

Warning message will be displayed in every case.

301warning

sgokaram-saagie commented 4 years ago

This is still misleading. saagies-mbp:Gradle shivakumar$ gradle -b build.gradle.projectExportEnvV2 projectExport

**> Task :projectsExport FAILED WARNING: No environment variable found on the targeted platform with scope project

FAILURE: Build failed with an exception.

BUILD FAILED in 2s 1 actionable task: 1 executed

The out put has a failure which is correct but then there is additional statements like what went wrong and thats misleading. Why are we printing 2 contradicting statements.

ZouhairBear commented 4 years ago

test for release 2.1.9