jenkinsci / azure-vm-agents-plugin

This repo is for azure vm agents plugin for jenkins. Azure devops CICD is the team which owns it for now
https://plugins.jenkins.io/azure-vm-agents/
44 stars 99 forks source link

usageMode with localization does not work with JaaC plugin #301

Closed mkrzywanski closed 3 years ago

mkrzywanski commented 3 years ago

Version report

Jenkins and plugins versions report:

Jenkins: 2.303.1
OS: Linux - 5.10.16.3-microsoft-standard-WSL2
---
ace-editor:1.1
apache-httpcomponents-client-4-api:4.5.13-1.0
azure-credentials:182.v3ccd4a755864
azure-sdk:30.vf3165534d6e8
azure-vm-agents:782.vb41dc00d85b1
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.0-3
bouncycastle-api:2.20
branch-api:2.6.5
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloud-stats:0.27
cloudbees-folder:6.16
command-launcher:1.2
configuration-as-code:1.52
credentials:2.5
credentials-binding:1.27
display-url-api:2.3.5
durable-task:1.39
echarts-api:5.1.2-11
extended-read-permission:3.2
font-awesome-api:5.15.4-1
git:4.8.2
git-client:3.9.0
git-server:1.10
handlebars:3.0.8
jackson2-api:2.12.4
jdk-tool:1.0
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.53
ldap:2.7
lockable-resources:2.11
mailer:1.34
matrix-auth:2.6.8
matrix-project:1.19
momentjs:1.1.1
pipeline-build-step:2.15
pipeline-graph-analysis:1.11
pipeline-input-step:2.12
pipeline-milestone-step:1.3.2
pipeline-model-api:1.9.1
pipeline-model-definition:1.9.1
pipeline-model-extensions:1.9.1
pipeline-rest-api:2.19
pipeline-stage-step:2.5
pipeline-stage-tags-metadata:1.9.1
pipeline-stage-view:2.19
plain-credentials:1.7
plugin-util-api:2.4.0
popper-api:1.16.1-2
popper2-api:2.9.3-1
resource-disposer:0.16
role-strategy:3.2.0
scm-api:2.6.5
script-security:1.78
snakeyaml-api:1.29.1
ssh-credentials:1.19
sshd:3.1.0
structs:1.23
trilead-api:1.0.13
workflow-aggregator:2.6
workflow-api:2.46
workflow-basic-steps:2.24
workflow-cps:2.93
workflow-cps-global-lib:2.21
workflow-durable-task-step:2.39
workflow-job:2.41
workflow-multibranch:2.26
workflow-scm-step:2.13
workflow-step-api:2.24
workflow-support:3.8
ws-cleanup:0.39
jenkins docker image jenkins/jenkins:2.303.1-jdk8

Reproduction steps

The problem is that, when using jenkins configuration as a code plugin, I want to set the usageMode Jenkins takes the localized description of the Mode. So for example if I want to configure usageMode for given template to be used , the exported JaaC configuration looks like :

usageMode: "Uruchamiaj te projekty, które mają etykietę pasującą do tego wę
        \żła"

this is for polish language. Later when I want to reload this configuration or create new Jenkins instance with this configuration it does not work and the default "NORMAL" mode is selected with localized description.

Results

Expected result:

I expect to be able to set the usageMode from the enum directly like "NORMAL", "EXCLUSIVE" and do not rely on localization.

Actual result:

The autocofiguration with jenkins as a code plugin does not work with exported configuration wchich uses localized description for usageMode option.

tonihoang commented 3 years ago

Also noticed this, is there any other bug, which is similar?

Whenever I export my config and restart the server I get this for deployments:

com.azure.core.management.exception.ManagementException: Status code 400, "{"error":{"code":"InvalidTemplate","message":"Deployment template validation failed: 'One of template variables has empty or invalid content. Please see https://aka.ms/arm-template/#variables for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":0,"linePosition":0,"path":""}}]}}": Deployment template validation failed: 'One of template variables has empty or invalid content. Please see https://aka.ms/arm-template/#variables for usage details.
timja commented 3 years ago

Created a new issue for above ^^