RESTAPI PUT Baseline in 9.2.7

Has anyone tried out PUT-ing a baseline in 9.2.7?

I have noticed that all of the baseline components simply get concatenated together. For example if I PUT:

Component 1
Component 2

Then PUT that again, the baseline now has:

Component 1
Component 2
Component 1
Component 2

Does anyone know if this is a feature or a bug?

So are you trying to update an existing baseline?

I typically make baselines from scratch every time.

I use updates to re-sync baselines using the API

What API function are you using to update the baselines?

PUT /api/fixlet/<site>/<baseline-id>

I used fixlet because previously the baseline resource did (does?) not allow for PUT or POST for whatever reason.

Are you passing in the complete baseline XML with updated components, or just the XML of the individual components you’re trying to update?

I am passing in the complete baseline with updated components. In 9.2.5 this would result in replacing the baseline as it existed before wholesale, but in 9.2.7 it results in appending the new baseline components to the existing baseline components.

Looks like a bug to me. I see the problem you describe in 9.2.6 also. I’ll ask the team to investigate.

1 Like

The team has been looking at this, and we’ve determined that the “append” behavior when PUT-ing to a baseline is undesired. It’s a bug because current behavior provides no way to remove components from a baseline via REST.

In addition to hooking this up to be usable through the baseline resource, we will be making the change to “replace” behavior for a PUT to existing baseline. I would like to get an idea of how disruptive that might be. Anyone out there with a workflow that uses RESTAPI to append components to baselines please speak up now. (@grlucche, are you still making use of this?) It seems like this isn’t too heavily used in the current state.

@iwolf I believe that the behavior as you describe it was the way the RESTAPI worked in 9.2.5, at least that is how I had been using it, to replace the entire contents of a Baseline. I doubt anyone would use the current functionality (9.2.6+) productively.

So please, replace it! :slight_smile: