Introduce incremental source-first step template migration#1681
Open
bcullman wants to merge 3 commits intoOctopusDeploy:masterfrom
Open
Introduce incremental source-first step template migration#1681bcullman wants to merge 3 commits intoOctopusDeploy:masterfrom
bcullman wants to merge 3 commits intoOctopusDeploy:masterfrom
Conversation
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.
Background
This PR is an alternative to #1679.
Both PRs address the review-ability and contributor-workflow problems tracked in #1677 by moving step-template authoring toward a source-first layout while retaining generated step-templates/*.json as the compatibility output.
The difference is the migration strategy, and each approach has a real tradeoff.
This PR takes an incremental approach. Its main advantage is clarity: the migration mechanics are easier to understand in small commits, the workflow is easier to review, and future migrations can happen in controlled batches using the tooling introduced here. The downside is that it leaves the repository in a temporary mixed state, with both legacy JSON-first templates and migrated source-first templates coexisting. That is workable as a transition state, but if the repository were to remain in that state for a long time, it could become operationally burdensome.
PR #1679 takes the all-at-once approach. Its main advantage is that it removes the transition period entirely: the repository is migrated in one pass, and the bandage is removed immediately. The downside is reviewability. Because of the sheer volume of changed files, that PR is much harder to consume, even though it is largely applying the same migration logic at full-repository scale.
If the maintainers want to adopt a source-first model, the practical decision is not whether the end state is different, but which migration path is preferable: a clearer incremental rollout with temporary mixed-state complexity, or a harder-to-review bulk migration that finishes the transition immediately.
Results
This branch introduces the plumbing for a temporary mixed-mode repository state:
step-templates/*.jsonsrc/step-templates/<template>/step-templates/*.jsonremains the compatibility outputIt also adds migration tooling and contributor guardrails so future template migrations can happen in smaller, reviewable batches instead of a single repository-wide rewrite.
Before
step-templates/*.jsonstep-templates/After
.gitignoreacts as a guardrail and living inventory of remaining legacy templatesscriptbody.*andlogo.pngbesidemetadata.jsonDifference from #1679
#1679migrates the repository to source-first in one large changesrc/step-templates/<template>/logo.pngPre-requisites
Idshould be a GUID that is not00000000-0000-0000-0000-000000000000Idproperty (updating theIdwill break the Library sync functionality in Octopus).Versionshould be incremented, otherwise the integration with Octopus won't update the step template correctly$LastModifiedByfield must be present, and (optionally) updated with the correct authorCategoryhas been created:logo.pngfile must be present beside the migrated template undersrc/step-templates/<template>/switchin thehumanizefunction ingulpfile.babel.jsmust have acasestatement corresponding to itFixes #1677
Validation and compatibility note
This PR assumes compatibility is preserved as long as the build continues to generate
step-templates/*.jsonin the legacy location.The exact retrieval flow used by
library.octopus.comis not fully documented here, but the generated JSON output is believed to remain compatible.This PR intentionally takes an incremental path rather than the repository-wide migration used in #1679. Follow-up commits on this branch will demonstrate that workflow with:
Example migration: single template
Commit 6b21a9d demonstrates the incremental workflow on a single template by migrating
ssis-deploy-ispac-from-package-parameter.That commit was produced by running
node tools/migrate-source-first.js --template ssis-deploy-ispac-from-package-parameter.The result shows the intended source-first shape for one migrated template:
.gitignorewas updated to remove that template from the remaining legacy-template allowlistThis commit is intentionally small so reviewers can inspect one complete migration in isolation before looking at a larger batch.
Example migration: template batch by prefix
Commit 3e83aad demonstrates the incremental workflow on a small related batch by migrating the Akamai templates with a shared prefix.
That commit was produced by running
node tools/migrate-source-first.js --template-prefix akamai-.The result shows how the same four-step workflow applies to multiple templates in one pass:
.gitignorewas updated to remove that migrated Akamai batch from the remaining legacy-template allowlistThis commit is intended to show that the incremental model is not limited to one-template-at-a-time migration. Related templates can be migrated together in a controlled batch when that makes review and maintenance more practical.