jenkinsci / jenkinsci/scm-api-plugin

[JENKINS-49186] non exportable objects exported causing errors in api/xml?depth=2

Open
#408 3 comments 0 reactions 0 assignees View on GitHub
component:scm-api-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
33
Forks
87
PR merge metrics
No merged PRs in 30d

Description

When you try and view the XML api for a multibarnch pipeline job you are greated with an angry jenkins when you export depth > 1.

 

```
org.kohsuke.stapler.export.NotExportableException: class jenkins.scm.api.SCMHeadOrigin$Fork doesn't have @​ExportedBean

 
org.kohsuke.stapler.export.NotExportableException: class jenkins.scm.api.SCMHeadOrigin$Default doesn't have @​ExportedBean
```

 

The default is exported at least here presumably there are other exports from implementations of the branch-source.

 

To reproduce

 

Create a MultiBranch pipeline from a GitHub repo.

Make sure you have a PR, and some branches

go to ${joburl}/job/${branch}/api/xml?depth=3   

or ${joburl}/view/change-requests/job/${PR-number}/api/xml?depth=3

sit back and enjoy

---
Originally reported by teilo, imported from: non exportable objects exported causing errors in api/xml?depth=2


  • status: Open
  • priority: Minor
  • component(s): scm-api-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 20251223-222157

Raw content of original issue

When you try and view the XML api for a multibarnch pipeline job you are greated with an angry jenkins when you export depth > 1.

 



org.kohsuke.stapler.export.NotExportableException: class jenkins.scm.api.SCMHeadOrigin$Fork doesn't have @ExportedBean

 
org.kohsuke.stapler.export.NotExportableException: class jenkins.scm.api.SCMHeadOrigin$Default doesn't have @ExportedBean



 

The default is exported at least here presumably there are other exports from implementations of the branch-source.

 

To reproduce

 

Create a MultiBranch pipeline from a GitHub repo.

Make sure you have a PR, and some branches

go to ${joburl}/job/${branch}/api/xml?depth=3   

or ${joburl}/view/change-requests/job/${PR-number}/api/xml?depth=3

sit back and enjoy

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.