Repository navigation
Release 1.40.3: migrate C-Gate projects that 3.8.0 refuses to load - #177
Merged
Merged
Conversation
C-Gate 3.8.0 rejects a project last written by 3.3.x with a schema version error and then never starts it, so every bridge command fails with network not found. When the managed project is stopped or missing and project load returns that specific error, run transform migrate_sql and then load, use and start the project. Copy the database beside itself first, and do not overwrite that copy on a later attempt. A project that is already started, still loading, or failing for any other reason is left alone, and a migration problem does not stop the bridge from starting. Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the remaining part of #174. 1.40.2 set CGATE_APPDATA, which stops config commands hanging. A project last written by C-Gate 3.3.x still will not load on 3.8.0: project load returns a schema version error (schema 13, must be 14) and the project never starts, so every bridge command fails with network not found.
After the managed command port is up, and only when that project is stopped or missing, the add-on sends project load. If the response is that schema error, it copies the database to
<project>.db.before-schema-migrate(and will not overwrite an existing copy), runstransform migrate_sql, then load, use and start.A project that is already started, still loading, or already loaded is not touched. Any other load failure is not a migration. A query failure or a failed migration does not stop the bridge from starting.
Testing
npm test(3401),npm run lintandnpm run typecheckpass.npm run validate:changelogandnpm run validate:addon-configpass.Not run against a real C-Gate 3.8.0. The command sequence is the one reported to fix a live 3.3.2 to 3.8.0 upgrade. The sample project database in the repo is schema 13, which is the version 3.8.0 rejects, but the integration legs still install 3.3.x and that database loads there without this path.
No tag has been pushed. After merge,
git tag v1.40.3 && git push origin v1.40.3publishes the add-on.