Support classic and alternate import syntax in flogo.json #44
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.
What kind of change does this PR introduce? (check one with "x")
What is the current behavior?
Currently imports in the "imports" array of flogo.json file follow the Go import path syntax (including aliases).
Hence it is not possible to know what is the path to the underlying module (if it exists) neither to specify a custom version.
This complicates the interaction of the Flogo CLI with
go mod
commands for instance in theflogo create
command and it prevents the flogo.json to recreate an application in a reproducible way (since all declared imports will always used the @latest stable version available).What is the new behavior?
In PR project-flogo/cli#32, a proposal is made to create a new syntax which would be more verbose while remaining readable.
This syntax is aimed at keeping good default values (no version = latest, no alias by default).
The only
mandatoryadd-on is the : when the original import path does not point to a Go module like the github.com/project-flogo/contrib/activity/log contribution.So
becomes
Notice the : separating the path to the module and the relative import path.
Notice also that the github.com/project-flogo/flow import is unchanged as it already points to a Go module and it is expected to use latest version.
Update : this new syntax format can totally be mixed with the old one. Using the new one gives more flexibility to manage dependencies under the hood. Hence I suggest to name those two compatible syntaxes the classic syntax and the alternate syntax.