Skip to content
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

Support classic and alternate import syntax in flogo.json #44

Merged
merged 3 commits into from
Feb 28, 2019

Conversation

debovema
Copy link
Contributor

@debovema debovema commented Feb 22, 2019

What kind of change does this PR introduce? (check one with "x")

[] Bugfix
[x] Feature
[] Code style update (formatting, local variables)
[] Refactoring (no functional changes, no api changes)
[] Other... Please describe:

This PR is required to be merged before project-flogo/cli#32

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 the flogo 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 mandatory add-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

    "github.com/project-flogo/contrib/activity/log",

becomes

    "github.com/project-flogo/contrib:/activity/log",

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.

@debovema debovema changed the title Update imports in flogo.json to the new Flogo import syntax Support classic and alternate import syntax in flogo.json Feb 28, 2019
@debovema
Copy link
Contributor Author

I updated the names of the syntaxes: the classic syntax and the alternate syntax

@fm-tibco : I reverted the examples/engine/flogo.json and created examples/alt/engine/flogo.json instead. So the default behaviour is to use the classic syntax. This way the alternate syntax will only be used by advised users.

@fm-tibco fm-tibco self-requested a review February 28, 2019 15:55
@fm-tibco fm-tibco merged commit 5073768 into project-flogo:master Feb 28, 2019
@debovema debovema deleted the new-import-syntax branch February 28, 2019 16:24
@debovema debovema restored the new-import-syntax branch March 1, 2019 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants