jenkinsci / jenkinsci/structs-plugin

[JENKINS-31532] snippet generator produces invalid output with latest git 2.5.0-beta2 plugins + submodule option.

Open
#268 1 comment 0 reactions 0 assignees View on GitHub
component:structs-plugin imported-jira-issue pipeline priority:minor resolution:unresolved
Dominant language
Java
Stars
11
Forks
33
PR merge metrics
No merged PRs in 30d

Description

I ran into this exploring JENKINS-20941">JENKINS-20941

Steps to reproduce:

1) Install latest git plugin and git client plugin from experimental repo

2) In a workflow job from the snippet generator, choose 'General SCM'. Choose 'Git' as the type, then in the dropdown for additional behaviors, add 'Advanced Submodule Behaviors', then click 'Generate Groovy'. The generator outputs this which is syntatically incorrect:



checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '23a7815f-3fbd-462c-ba41-23668de4868d', url: 'git@​git.example.com:foo/bar.git']]])



Expected is something more like:



checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'src'], [$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, trackingSubmodules: false, parentCredentials: true]], submoduleCfg: [], userRemoteConfigs: [[ url: 'git@​git.example.com:foo/bar.git']]])



(The parentCredentials doesn't seem to work anyway yet, but it at least pareses as valid that way.)

---
Originally reported by b2jrock, imported from: snippet generator produces invalid output with latest git 2.5.0-beta2 plugins + submodule option.


  • assignee: jglick
  • status: Open
  • priority: Minor
  • component(s): structs-plugin
  • label(s): pipeline
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 20260604-211335

Raw content of original issue

I ran into this exploring JENKINS-20941

Steps to reproduce:
1) Install latest git plugin and git client plugin from experimental repo
2) In a workflow job from the snippet generator, choose 'General SCM'. Choose 'Git' as the type, then in the dropdown for additional behaviors, add 'Advanced Submodule Behaviors', then click 'Generate Groovy'. The generator outputs this which is syntatically incorrect:

checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [<object of type hudson.plugins.git.extensions.impl.SubmoduleOption>], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '23a7815f-3fbd-462c-ba41-23668de4868d', url: 'git@git.example.com:foo/bar.git']]])

Expected is something more like:

checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'src'], [$class: 'SubmoduleOption', disableSubmodules: false, recursiveSubmodules: true, trackingSubmodules: false, parentCredentials: true]], submoduleCfg: [], userRemoteConfigs: [[ url: 'git@git.example.com:foo/bar.git']]])

(The parentCredentials doesn't seem to work anyway yet, but it at least pareses as valid that way.)

environment

```
jenkins using the docker hub 'jenkins' image 1.625.1

Workflow 1.11-beta4 and 1.10.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.