jenkinsci / jenkinsci/configuration-as-code-plugin

Export does not produce empty element for empty inputs

Open
#2,811 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.8k
Forks
756
Avg merge
9h 47m
Merged PRs (30d)
10

Description

Continuing from #2802

Exporting a configuration that has no value for some of its inputs does not produce an empty element in the exported content.

Consider the following `folder-auth` model for example:
```
jenkins:
authorizationStrategy:
folderBased:
folderRoles:
- folders:
- "xxx"
name: "xxx"
permissions:
- id: "Job/Build"
- id: "Job/Discover"
- id: "Job/Read"
sids: []
```
The export configuration page does not display the empty "sids" element.

It seems `2053.vb_0da_47381a_25` introduced `@ParametersAreNonnullByDefault` which caused problems with my CASC configuration without "sids" element from initial export.

`folder-auth` is just one such case I had the misfortune of having to deal with, but there could be many others with similar symptoms.

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.