-
Notifications
You must be signed in to change notification settings - Fork 23
feat(agent,dgw): add Hub Service auto-updater support #1557
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
base: master
Are you sure you want to change the base?
Conversation
- Add Hub Service MSI upgrade code (f437046e-8e13-430a-8c8f-29fcb9023b59) - Add HubService product variant to updater system - Support three Hub Service Windows services (PAM, Encryption, Reporting) - Gracefully handle optional services that may not be installed - Refactor ServiceUpdateActions to support multiple services per product - Preserve individual service states and startup modes during updates - Extend update.json schema with hub_service field (backward compatible)
Let maintainers know that an action is required on their side
|
|
First shot with GitHub Copilot for https://devolutions.atlassian.net/browse/ARC-417 |
Add missing hub_service field (set to None) when Gateway API creates update.json for Gateway-only updates.
CBenoit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall.
I think we also need to update the /jet/update endpoint of the Devolutions Gateway (found in devolutions-gateway/src/api/update.rs), to support the product selection.
Likely need a quick manual test before merging as well. I assume you didn’t get a chance to try it out yet.
|
Follow up. We use the title of the PR and the body to generate the changelog. The title must follow the conventional commit specification, and the body must include (optional) details about the features. This can be technical to some extend (in-repository changelog for technically-inclined users), but crucially, it should still be used-oriented. (Does not apply to chore, ci, and other commit types we do not include in the changelog). The Jira ticket must be specified using This is stuff I’ll add in the agents instructions so you don’t have to remember when using Copilot, but maybe you could try providing it with instructions above? |
This commit addresses several issues with the updater's MSI installation and Hub Service update process:
1. Strip UTF-8 BOM from update.json parsing
- Some editors add UTF-8 BOM (0xEF 0xBB 0xBF) which caused parse failures
- Now strips BOM before JSON deserialization if present
2. Validate MSI exit codes properly
- Previously only checked if msiexec launched, not if it succeeded
- Now validates exit codes: 0 = success, 3010/1641 = success with reboot
(logged as warning since our installers shouldn't require reboot)
- Other codes properly treated as failures
- Applied to both install and uninstall operations
3. Hub Service installer parameter improvements
- Removed P.SERVICESTART parameter for Hub Service (not supported)
- Added ADDLOCAL parameter generation based on installed services
- Maps service names to MSI features: PAM, Encryption, Reporting
- Preserves user's feature selection during updates
4. Enhanced service restart logic for Hub Service
- Gateway: only restarts services with manual startup that were running
- Hub Service: restarts all services that were running (since we can't
control startup mode via installer parameters)
These changes ensure Hub Service updates preserve the installed features and properly handle installation success/failure cases.
e31ac91 to
891c910
Compare
|
I opened a PR with agent instructions: #1564 |
Overview
Extends the Devolutions Agent auto-updater to support Devolutions Hub Service MSI updates, using the same mechanism as Gateway updates.
Changes
Core Implementation
f437046e-8e13-430a-8c8f-29fcb9023b59HubServicesbin(from productinfo.htm)Code Changes
crates/devolutions-agent-shared/src/windows/mod.rs: AddedHUB_SERVICE_UPDATE_CODEconstantcrates/devolutions-agent-shared/src/update_json.rs: Extended schema with optionalhub_servicefielddevolutions-agent/src/updater/productinfo/mod.rs: AddedHUB_SERVICE_PRODUCT_IDdevolutions-agent/src/updater/product.rs: AddedHubServiceproduct variantdevolutions-agent/src/updater/detect.rs: Extended detection logic for Hub Servicedevolutions-agent/src/updater/package.rs: Extended MSI operations for Hub Servicedevolutions-agent/src/updater/product_actions.rs: Refactored toServiceUpdateActionssupporting multiple services per productdevolutions-agent/src/updater/mod.rs: Added HubService toPRODUCTSarrayKey Features
Testing Instructions
Prerequisites
Test 1: Manual Update Trigger
Verify current state:
Create update.json:
Monitor logs:
Expected log sequence (within 3 seconds):
Verify results:
Test 2: Service State Preservation
Set PAM service to Manual startup:
Trigger update (same as Test 1)
Expected behavior:
Verify:
Test 3: Multiple Services Installed
Install all Hub Service features (PAM, Encryption, Reporting)
Set different startup types:
Trigger update
Expected:
Test 4: Already Up-to-Date
Create update.json with current version (same as installed)
Expected log:
No installation should occur.
Test 5: Backward Compatibility
Create update.json for Gateway only (no
hub_servicefield):Expected: Gateway updates normally, Hub Service ignored (backward compatible).
Test 6: Negative Test - Invalid Checksum
Create update.json with wrong checksum:
Expected:
Installation should NOT proceed.
Validation Script
Notes
hub_servicefield (backward compatible)