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

Environment Variable Export - Wrong error message #301

Open
sgokaram-saagie opened this issue Aug 31, 2020 · 5 comments
Open

Environment Variable Export - Wrong error message #301

sgokaram-saagie opened this issue Aug 31, 2020 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sgokaram-saagie
Copy link
Contributor

sgokaram-saagie commented Aug 31, 2020

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.

  • What went wrong:
    Execution failed for task ':projectsExport'.

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

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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

@sgokaram-saagie sgokaram-saagie added the bug Something isn't working label Aug 31, 2020
@sgokaram-saagie sgokaram-saagie added this to the 2.2 milestone Aug 31, 2020
@medamineziraoui
Copy link
Contributor

Can you share the build for this issue please

@sgokaram-saagie
Copy link
Contributor Author

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.

  • What went wrong:
    Execution failed for task ':projectsExport'.

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

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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
Copy link
Contributor

medamineziraoui commented Sep 3, 2020

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
Copy link
Contributor Author

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.

  • What went wrong:
    Execution failed for task ':projectsExport'.

jobs, pipelines and variables to be exported cannot be empty at the same time, and cannot generate zip file**

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

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
Copy link
Contributor

ZouhairBear commented Sep 9, 2020

test for release 2.1.9

  • Export enviroment variable of scope = project with an existing job and without an existing pipline : test validated
    301warningnew

  • Export enviroment variable of scope = project without an existing job and an existing pipline: test validated
    301error2

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

3 participants