Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-130543 / 24.10 / Send app events on upgrade for UI #14183

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/plugins/apps/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def create_internal(
update_app_config(app_name, version, new_values)
update_app_metadata(app_name, app_version_details, migrated_app)
# At this point the app exists
self.middleware.send_event('app.query', 'ADDED', id=app_name)
self.middleware.send_event('app.query', 'ADDED', id=app_name, fields=self.get_instance__sync(app_name))

job.set_progress(60, 'App installation in progress, pulling images')
if dry_run is False:
Expand Down Expand Up @@ -294,7 +294,7 @@ def update_internal(self, job, app, data, progress_keyword='Update'):
# TODO: Eventually we would want this to be executed for custom apps as well
update_app_metadata_for_portals(app_name, app['version'])
job.set_progress(60, 'Configuration updated, updating docker resources')
self.middleware.send_event('app.query', 'CHANGED', id=app_name)
self.middleware.send_event('app.query', 'CHANGED', id=app_name, fields=self.get_instance__sync(app_name))
compose_action(app_name, app['version'], 'up', force_recreate=True, remove_orphans=True)

job.set_progress(100, f'{progress_keyword} completed for {app_name!r}')
Expand Down
4 changes: 3 additions & 1 deletion src/middlewared/middlewared/plugins/apps/rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def rollback(self, job, app_name, options):
# 5) Roll back ix_volume dataset's snapshots if available
# 6) Finally update collective metadata config to reflect new version
update_app_metadata(app_name, rollback_version)
self.middleware.send_event('app.query', 'CHANGED', id=app_name)
self.middleware.send_event(
'app.query', 'CHANGED', id=app_name, fields=self.middleware.call_sync('app.get_instance', app_name)
)
try:
if options['rollback_snapshot'] and (
app_volume_ds := self.middleware.call_sync('app.get_app_volume_ds', app_name)
Expand Down
4 changes: 3 additions & 1 deletion src/middlewared/middlewared/plugins/apps/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def upgrade(self, job, app_name, options):

job.set_progress(40, f'Configuration updated for {app_name!r}, upgrading app')

self.middleware.send_event('app.query', 'CHANGED', id=app_name)
self.middleware.send_event(
'app.query', 'CHANGED', id=app_name, fields=self.middleware.call_sync('app.get_instance', app_name)
)
try:
compose_action(app_name, upgrade_version['version'], 'up', force_recreate=True, remove_orphans=True)
finally:
Expand Down
Loading