Skip to content

network: Add sessionStorage event informing about NetworkManager Chec…#22830

Merged
mvollmer merged 2 commits intocockpit-project:mainfrom
rvykydal:add-session-storage-network-checkpoint-event
Feb 26, 2026
Merged

network: Add sessionStorage event informing about NetworkManager Chec…#22830
mvollmer merged 2 commits intocockpit-project:mainfrom
rvykydal:add-session-storage-network-checkpoint-event

Conversation

@rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Jan 30, 2026

…kpoint

This is a PR with basic implementation of https://issues.redhat.com/browse/COCKPIT-1417 that should allow me to work on Anaconda part using the copr build.

Resolves: COCKPIT-1417

@rvykydal
Copy link
Contributor Author

Anaconda would need to get informed also about the change confirmation dialog.

@rvykydal
Copy link
Contributor Author

rvykydal commented Feb 6, 2026

Adding tests

})
.catch(function () {
// Clear checkpoint status on failure
window.sessionStorage.setItem("cockpit_has_checkpoint", "false");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tests (integration)

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

I am wondering if there isn't a NetworkManager API to subscribe to checkpoints? And wouldn't that be enough to satisfy Anaconda's needs?

Copy link
Member

@jelly jelly left a comment

Choose a reason for hiding this comment

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

Alternatively we do have a page communication mechanism in pkg/lib/notifications.ts why won't we use that over sessionStorage.

@mvollmer mvollmer self-assigned this Feb 18, 2026
})
.catch(function () {
// Clear checkpoint status on failure
window.sessionStorage.setItem("cockpit_has_checkpoint", "false");
Copy link
Member

Choose a reason for hiding this comment

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

I would move this after the rollback or destroy below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved.

@mvollmer
Copy link
Member

Looks good to me! Maybe we should generalize this to "cockpit:busy" which could be used for dialogs and checkpoints and whatever else might come up?

@mvollmer
Copy link
Member

Alternatively we do have a page communication mechanism in pkg/lib/notifications.ts why won't we use that over sessionStorage.

The notifications work by sending messages to the Shell, which is not used with Anaconda (I think). Anaconda could implement the same protocol, but I think that's a distraction. "ad-hoc" session storage is good enough, I'd say.


testlib.wait(checkpoint_cleared)

def testCheckpointSessionStorageEventRollback(self):
Copy link
Member

Choose a reason for hiding this comment

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

This test needs to be excluded on Testing Farm, see test/browser/run-test.sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excluded.

@mvollmer
Copy link
Member

@rvykydal, do you want me to finish this?

@rvykydal rvykydal force-pushed the add-session-storage-network-checkpoint-event branch from 2ab8c24 to 377d6fd Compare February 24, 2026 10:58
@rvykydal
Copy link
Contributor Author

Looks good to me! Maybe we should generalize this to "cockpit:busy" which could be used for dialogs and checkpoints and whatever else might come up?

I would wait with this a bit until we hit another instance of this, but yes, we may end up with it. I'd also need to look deeper whether we really need individual events or not.

@rvykydal rvykydal marked this pull request as ready for review February 24, 2026 11:04
@rvykydal rvykydal changed the title WIP network: Add sessionStorage event informing about NetworkManager Chec… network: Add sessionStorage event informing about NetworkManager Chec… Feb 24, 2026
@rvykydal
Copy link
Contributor Author

I am wondering if there isn't a NetworkManager API to subscribe to checkpoints? And wouldn't that be enough to satisfy Anaconda's needs?

At this stage of integration with Cockpit network module (POC/MVP before design review) I'd prefer to synchronize via Cockpit. In the current WebUI we are using NM API only via super minimal Anaconda backend network module (connectivity status) and don't use any NM API on our own yet.

@rvykydal rvykydal requested a review from mvollmer February 24, 2026 11:28
@mvollmer mvollmer force-pushed the add-session-storage-network-checkpoint-event branch from 377d6fd to 3f56d2a Compare February 25, 2026 07:27
Copy link
Member

@mvollmer mvollmer left a comment

Choose a reason for hiding this comment

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

Thanks!

@mvollmer
Copy link
Member

I have force pushed a linting fix.

@@ -1701,6 +1709,9 @@ export function with_checkpoint(model, modify, options) {
manager.checkpoint_rollback(cp);
else
manager.checkpoint_destroy(cp);
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test. Details

@allisonkarlitskaya allisonkarlitskaya added the release-blocker Targetted for next release label Feb 26, 2026
@mvollmer mvollmer merged commit 6d1a45b into cockpit-project:main Feb 26, 2026
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker Targetted for next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants