Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2023264

Summary: composer-cli blueprints delete not fully deleting blueprints
Product: Red Hat Enterprise Linux 8 Reporter: Marko Myllynen <myllynen>
Component: weldr-clientAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: jrusz, obudai
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: weldr-client-35.5-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 14:10:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marko Myllynen 2021-11-15 10:39:48 UTC
Description of problem:
image-builder@localhost ~]$ composer-cli blueprints list

[image-builder@localhost ~]$ composer-cli blueprints push test.toml
[image-builder@localhost ~]$ composer-cli blueprints list
test
[image-builder@localhost ~]$ vi test.toml
[image-builder@localhost ~]$ composer-cli blueprints push test.toml
[image-builder@localhost ~]$ composer-cli blueprints changes test
test
    2021-11-15T12:25:13Z  53991553ed960fab415e9ef85c1603d2a0c91535
    Recipe test, version 2021.11.15+12.25.00 saved.

    2021-11-15T12:24:58Z  05c83c18d33dc1e8a9f65d0d612f56f18c0fd409
    Recipe test, version 2021.11.15+12.24.00 saved.

[image-builder@localhost ~]$ composer-cli blueprints delete test
[image-builder@localhost ~]$ composer-cli blueprints list

[image-builder@localhost ~]$ composer-cli blueprints changes test
test
    2021-11-15T12:25:13Z  53991553ed960fab415e9ef85c1603d2a0c91535
    Recipe test, version 2021.11.15+12.25.00 saved.

    2021-11-15T12:24:58Z  05c83c18d33dc1e8a9f65d0d612f56f18c0fd409
    Recipe test, version 2021.11.15+12.24.00 saved.

[image-builder@localhost ~]$ composer-cli blueprints save test foo.toml
2021-11-15 12:26:06,893: test: 
[image-builder@localhost ~]$ echo $?
1
[image-builder@localhost ~]$ vi test.toml
[image-builder@localhost ~]$ composer-cli blueprints push test.toml
[image-builder@localhost ~]$ composer-cli blueprints list
test
[image-builder@localhost ~]$ composer-cli blueprints changes test
test
    2021-11-15T12:26:28Z  95c37a6e79633e7e3525b698e8d3fb68b986bf88
    Recipe test, version 2021.11.15+12.26.00 saved.

    2021-11-15T12:25:13Z  53991553ed960fab415e9ef85c1603d2a0c91535
    Recipe test, version 2021.11.15+12.25.00 saved.

    2021-11-15T12:24:58Z  05c83c18d33dc1e8a9f65d0d612f56f18c0fd409
    Recipe test, version 2021.11.15+12.24.00 saved.

[image-builder@localhost ~]$ 

So here the outcome of blueprint deletion is somewhat inconsistent and perhaps not as expected:

1) Listing blueprints after deleting the last or only blueprint shows nothing but if the name of the blueprint is known then its changes can still be listed. So looks like the blueprint deletion has been partial.

2) After deleting a blueprint and pushing a new blueprint with the same name its history consists of the current and previous changes.

3) Saving a deleted or non-existent blueprint fails as expected but the output message in completely unhelpful. The exit code is set properly which is good.

If this is working as intended then this should be explained in the manual page or elsewhere now when blueprint deletion seems partial it is perhaps a bit unexpected. Thanks.

Version-Release number of selected component (if applicable):
composer-cli-28.14.62-1.el8.x86_64
osbuild-composer-33.2-1.el8.x86_64

Comment 1 Brian Lane 2021-12-15 22:42:13 UTC
(In reply to Marko Myllynen from comment #0)

> So here the outcome of blueprint deletion is somewhat inconsistent and
> perhaps not as expected:
> 
> 1) Listing blueprints after deleting the last or only blueprint shows
> nothing but if the name of the blueprint is known then its changes can still
> be listed. So looks like the blueprint deletion has been partial.

This is normal, the previous API server used git on the backend so things were never really ever deleted. osbuild-composer emulates this behavior, mostly.

If you do 'composer-cli blueprints undo 53991553ed960fab415e9ef85c1603d2a0c91535' it will restore that version.

If there is a bug here it is that osbuild-composer doesn't make a change entry for delete like lorax-composer did. I'm not sure how important that is but feel free to file a bug for it.


> 
> 2) After deleting a blueprint and pushing a new blueprint with the same name
> its history consists of the current and previous changes.

That's expected. It's as if you never deleted it and pushed a new version of it.

> 
> 3) Saving a deleted or non-existent blueprint fails as expected but the
> output message in completely unhelpful. The exit code is set properly which
> is good.

The error (using composer-cli from weldr-client in 8.6.0) is now:

ERROR: UnknownBlueprint: test:

(this comes from the API server, composer-cli just passes these back to the user).

> 
> If this is working as intended then this should be explained in the manual
> page or elsewhere now when blueprint deletion seems partial it is perhaps a
> bit unexpected. Thanks.

Yeah, I can update the documentation in weldr-client to make that more clear.

> 
> Version-Release number of selected component (if applicable):
> composer-cli-28.14.62-1.el8.x86_64
> osbuild-composer-33.2-1.el8.x86_64

FYI weldr-client-35.4 is now available in 8.6.0 and it should be used for future tests.

Comment 2 Brian Lane 2021-12-15 23:40:00 UTC
https://github.com/osbuild/weldr-client/pull/38 (needs to be added upstream first, then rebase weldr-client)

Comment 4 Marko Myllynen 2021-12-16 07:42:03 UTC
Thanks for looking into this.

I now tried with weldr-client-35.3-2.el8.x86_64 and agree what with the above documentation update things look as expected. But I get an error with weldr-client which doesn't happen with composer-cli, see https://bugzilla.redhat.com/show_bug.cgi?id=2033192.

Thanks.

Comment 8 Jakub Rusz 2022-03-02 10:25:27 UTC
Upstream documentation updated and there are no other issues to test. Moving to VERIFIED.

Comment 10 errata-xmlrpc 2022-05-10 14:10:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (weldr-client bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:1886