Bug #23581

Upgrade to Foreman 1.17 converts YAML to JSON Hash

Added by Frederik Weber 2 months ago. Updated about 8 hours ago.

Status:Ready For Testing
Priority:Normal
Assignee:-
Category:DB migrations
Target version:1.17.2
Difficulty: Team Backlog:
Triaged:No Fixed in Releases:
Bugzilla link: Found in Releases:1.17.0
Pull request:https://github.com/theforeman/foreman/pull/5559

Description

We have Puppet parameters with the type hash and a YAML hash as content (this is valid per Foreman documentation).
After the run of db:migrate the content gets migrated to a JSON hash.

If I extract an example value from the DB:

Before db:migrate

---             
frequency: daily

After db:migrate

 --- '{"frequency"=>"daily"}'

I see two solutions:
1. Change the db:migrate task that migrates valid YAML hashes to JSON hashes.
2. Update the documentation that YAML hashes are no longer valid.


Related issues

Related to Foreman - Bug #23382: Editing Smart Class Parameter of type YAML creates malfor... Closed 04/24/2018

History

#1 Updated by Frederik Weber 2 months ago

Just verified that an upgrade from 1.16.0 to 1.16.1 doesn't convert hashes.
Therefore it is likely that the issue was introduced in the version 1.17.

#2 Updated by Frederik Weber 2 months ago

It is likely that this "bug" was introduced by PR #5403 (https://github.com/theforeman/foreman/pull/5403).
Should all YAML lookup_values become JSON hashes? Especially since it is possible to change the values back to YAML hashes (through the UI) and they get written like that to the DB.

#3 Updated by The Foreman Bot 2 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5556 added

#4 Updated by Frederik Weber 2 months ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/5556)

#5 Updated by The Foreman Bot 2 months ago

  • Pull request https://github.com/theforeman/foreman/pull/5559 added

#6 Updated by Tomer Brisker 17 days ago

  • Triaged set to No
  • Legacy Backlogs Release (now unused) set to 360

#7 Updated by Tomer Brisker 17 days ago

  • Related to Bug #23382: Editing Smart Class Parameter of type YAML creates malformed value in release 1.17.0 added

Also available in: Atom PDF