Skip to content

Conversation

@croissanne
Copy link
Member

@croissanne croissanne commented Oct 29, 2025

blueprints: enable exporting blueprints in cockpit

Export the blueprint as TOML on premise, and not as JSON. The
expectation is that users might want to use this blueprint with
composer-cli or image-builder-cli.

Because the behaviour is different between the cockpit and hosted UIs,
refrain from making the backend api abstraction.

@croissanne croissanne force-pushed the cockpit-toml-export branch 2 times, most recently from cc28ed9 to 6ab29ba Compare October 29, 2025 15:25
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 27.58621% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.95%. Comparing base (29373db) to head (b1f1940).

Files with missing lines Patch % Lines
src/Components/Blueprints/BlueprintActionsMenu.tsx 27.58% 21 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3779      +/-   ##
==========================================
- Coverage   81.00%   80.95%   -0.05%     
==========================================
  Files         217      217              
  Lines       25079    25102      +23     
  Branches     2494     2496       +2     
==========================================
+ Hits        20315    20322       +7     
- Misses       4736     4752      +16     
  Partials       28       28              
Files with missing lines Coverage Δ
src/Components/Blueprints/BlueprintActionsMenu.tsx 52.94% <27.58%> (-8.35%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29373db...b1f1940. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@croissanne croissanne force-pushed the cockpit-toml-export branch 2 times, most recently from 06c08e2 to 92d0be5 Compare October 30, 2025 10:41
@croissanne croissanne changed the title Cockpit toml export cockpit-image-builder: export blueprints (RHEL-123840) Oct 30, 2025
@croissanne croissanne force-pushed the cockpit-toml-export branch 2 times, most recently from 16c1ba9 to fc8fbb2 Compare October 30, 2025 16:21
@croissanne croissanne marked this pull request as ready for review October 30, 2025 16:28
@croissanne croissanne requested a review from a team as a code owner October 30, 2025 16:28
Export the blueprint as TOML on premise, and not as JSON. The
expectation is that users might want to use this blueprint with
composer-cli or image-builder-cli.

Because the behaviour is different between the cockpit and hosted UIs,
refrain from making the backend api abstraction.
Also verify the contents of the exported blueprint. For hosted this is
not important as there the exported blueprint is just forwarded from
image-builder-crc. But in cockpit-image-builder all blueprint management
is handled inside of the plugin itself, thus it is important to verify
the contents of the export.
@croissanne
Copy link
Member Author

/retest

Copy link
Collaborator

@mgold1234 mgold1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@croissanne it looks great, I left 2 small suggestion, other then that it looks good to me

import { EllipsisVIcon } from '@patternfly/react-icons';
import TOML from 'smol-toml';

// The exported contents are different between hosted and on prem, so
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think maybe write it little different?
// The hosted UI exports JSON, while the Cockpit plugin exports TOML.
// Because the blueprint formats are not aligned, relying on a generic 'backendApi'
// would be misleading. Import and handle each environment explicitly.

// and on prem, so just import both separately.
import { selectSelectedBlueprintId } from '../../store/BlueprintSlice';
import { useLazyExportBlueprintCockpitQuery } from '../../store/cockpit/cockpitApi';
import type { Blueprint as CloudApiBlueprint } from '../../store/cockpit/composerCloudApi';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is litte confusing to use CloudApi and also cockpit -
maybe 'cockpitExportResponse' instead of CloudApiBlueprint'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants