-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
Let maintainers know that an action is required on their side
|
|
First shot with GitHub Copilot for https://devolutions.atlassian.net/browse/ARC-417 |
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? |
e31ac91 to
891c910
Compare
|
I opened a PR with agent instructions: #1564 |
c852b7a to
a338674
Compare
|
@pacmancoder Can you review this? EDIT: Avoid merging the PR with the current description. It will get as-is in the changelog. |
|
The PR is ready, what matters is that it doesn't introduce a breaking change to the existing Devolutions Gateway auto-updater feature. Normally it shouldn't, the JSON fields are optional so it won't break if one of the two version field is missing, etc. We just need a proper review. |
Extends the agent updater to support automatic updates for Devolutions Hub Service in addition to Gateway. This enables centralized management of both products through a unified update.json configuration file. Changes include: - Extended UpdateJson schema to support Hub Service version updates via new hub_service field alongside existing gateway field - Added HUB_SERVICE_UPDATE_CODE UUID constant and registry lookups for Hub Service MSI detection and version tracking - Expanded updater core to track Hub Service as an updateable product alongside Gateway with proper staging and processing - Enhanced MSI handling to support both Gateway (single service) and Hub Service (multi-service: PAM, Encryption, Reporting features) installation patterns - Improved MSI exit code handling to distinguish between success (0), reboot required (3010, 1641), and actual errors; previously treated all non-zero codes as failures - Added UTF-8 BOM stripping in update.json parsing to handle files created by certain editors that add a BOM header - Refactored service state management to use generic ServiceUpdateActions trait supporting both single-service (Gateway) and multi-service (Hub Service) products - Added smart service startup mode restoration: Gateway uses P.SERVICESTART MSI parameter while Hub Service uses ADDLOCAL to preserve installed features Backward compatibility: - The hub_service field is optional with skip_serializing_if = Option::is_none - Gateway API continues to write hub_service: None, maintaining existing behavior - Each product independently queries its own field; Gateway only checks gateway field - Old update.json files with only Gateway field deserialize correctly - Existing Gateway auto-update feature is unaffected and fully compatible
a338674 to
3f51df2
Compare
pacmancoder
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! 👍
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)