Repository navigation
Pin the plain agent version in the version file - #12
Conversation
e4620a1 to
3f27b2e
Compare
3f27b2e to
adb8cec
Compare
adb8cec to
aa392b9
Compare
d14d30b to
fe82187
Compare
|
proxy-agent-manager.sh:204 and proxy-agent-manager.ps1:399 parse the version file before command dispatch, so a malformed non-empty version prevents stop, status, and logs from running. Defer parsing to commands that need the version. |
The version file used to hold a full image tag (1.2.9-ubuntu-26.04 or 1.2.9-windows-ltsc2022), so a user rolling back had to know the tag suffix for their container mode, and a bare version on Linux silently selected the legacy numeric tag. The installers now write the plain version and the management scripts append the suffix for the detected container mode when starting the container. Legacy full tags in the version file are still accepted and rewritten to the plain version on the next start or upgrade. The -WindowsVersion override is now persisted as $WINDOWS_VERSION in settings.ps1 instead of in the pinned tag; a variant pinned by a legacy Windows tag is migrated there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cover each accepted version file entry in the manager unit tests: a plain version, a legacy Ubuntu tag rewritten to the plain version on start, restart and upgrade, and a legacy Windows tag migrated to the plain version plus the $WINDOWS_VERSION setting. Also cover the $WINDOWS_VERSION setting overriding host detection, and that the bash manager rejects Windows tags. The integration tests now check that the version file holds exactly the plain version, start from a legacy tag, and check that install.ps1 persists -WindowsVersion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A legacy -ubuntu-26.04 tag in the version file is still accepted with Windows containers, but the switch to the Windows image is now logged as a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fe82187 to
358b774
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The migration can corrupt settings without a trailing newline or lose the pinned variant, and accepted uppercase WindowsVersion values produce Docker tags that fail installation.
2 open issues
What changed in this PR
This PR simplifies agent rollbacks by pinning a plain version in the version file and letting the management scripts select the image suffix for the container mode.
Changes:
- Return and store plain versions while migrating legacy image tags.
- Persist Windows LTSC overrides in
settings.ps1. - Update documentation and tests for exact version pins, migration, and rollback behavior.
| File | Description |
|---|---|
tests/pwsh/Manager.Tests.ps1 |
Covers plain pins, legacy migration, and Windows overrides. |
tests/pwsh/Install.Tests.ps1 |
Checks plain versions and persisted Windows overrides. |
tests/integration/windows.ps1 |
Verifies exact pins, legacy migration, and override persistence. |
tests/integration/linux.sh |
Verifies suffixed images and plain version migration. |
tests/bash/manager.bats |
Adds migration checks and exact version assertions. |
README.md |
Documents plain pins and Windows override storage. |
proxy-agent-manager.sh |
Normalizes pins and appends the Ubuntu image suffix. |
proxy-agent-manager.ps1 |
Resolves image suffixes and migrates legacy Windows variants. |
install.sh |
Extracts plain versions from Ubuntu registry tags. |
install.ps1 |
Stores plain versions and Windows overrides separately. |
Review effort: Balanced
|
@GiovanniMoya Thanks for catching this. Fixed in ce69b35: both managers now parse and validate the pinned version only for start, restart, and upgrade. I added regression tests showing stop, status, and logs still work with a malformed non-empty version file. The Bash and PowerShell unit tests are passing in CI. |

Summary
The
versionfile used to hold a full image tag, such as1.2.9-ubuntu-26.04or1.2.9-windows-ltsc2022. That made rollbacks awkward: a user had to know the tag suffix for their container mode, and on Linux a bare1.2.9silently selected the legacy numeric tag instead of the Ubuntu one. This came up while reviewing the Docker rollback steps in the public docs (fivetran/engineering#286828).The
versionfile now holds the plain agent version (for example1.2.9). The management scripts append the image tag suffix for the detected container mode when they start the container:<version>-ubuntu-26.04<version>-windows-<ltsc>Changes
install.shandinstall.ps1write the plain version to theversionfile, and the registry lookups return plain versions.proxy-agent-manager.shandproxy-agent-manager.ps1build the image tag from the pinned version at start and upgrade time. Legacy full tags in theversionfile are still accepted and rewritten to the plain version on the nextstart,restart, orupgrade. Invalid content fails withInvalid proxy agent version '<x>' in <file>. Expected <major>.<minor>.<patch>.-WindowsVersionoverride is persisted as$WINDOWS_VERSIONinsettings.ps1instead of in the pinned tag. A variant pinned by a legacy Windows tag is migrated there on first run. A legacy Windows tag under Linux containers still errors, as before.Get-ImageTagType,Get-ImageTagVariant, andResolve-ImageTagare removed fromproxy-agent-manager.ps1, along with the "switch to explicit Ubuntu tag" branch inupgrade, since a plain version now covers both cases.versionfile as the pinned agent version and to note where the Windows override is stored.Compatibility
Installs running the previous management scripts handle a plain version already: the bare numeric tag is the same Linux image as the Ubuntu tag, and
proxy-agent-manager.ps1already appended the LTSC suffix for Windows containers. So the docs can tell users to roll back withecho "1.2.7" > versionregardless of which manager version they have.Testing
shellcheckandbash -npass on both shell scripts.proxy-agent-manager.shwith stubbeddockerandcurl: a legacy1.2.9-ubuntu-26.04pin starts1.2.9-ubuntu-26.04and rewrites the file to1.2.9;upgradepicks1.2.10and ignores bare and Windows tags in the registry listing; a secondupgradeis a no-op;echo 1.2.7 > versionfollowed bystartruns1.2.7-ubuntu-26.04;2.0fails with the validation error.proxy-agent-manager.ps1andinstall.ps1are not tested yet. There is no PowerShell on the machine this was written on, sostartandupgradeneed a run on a Windows host before merge.🤖 Generated with Claude Code
Stack
main