project-flogo/cli

sync command

Closed this issue ยท 8 comments

We should add a "sync" that should synchronize the build environment to the imports section of the flogo.json. That way people can just update their json file.. then do a sync to get all the stuff they need.

Synchronize as in how? Isn't flogo install doing similar thing?

Yes but being able to do it directly in the flogo.json would be nice !

For both methods we should also think to some sort of update of the imports in the flogo.json in the case of imports using module queries instead of a fully-specified version.

For instance when

  "imports": [
    "github.com/project-flogo/contrib/activity/log@master"
    "github.com/project-flogo/contrib/trigger/rest",
    "github.com/project-flogo/flow",
  ],

we might not expect that syncing will always use master version (which could change between sync). So either we could remove the @master from the import path or replace it by the actual version computed in the go.mod file.
This way the imports array would be a mirror of both go.mod and imports.go files and we could have reproducible builds with only the flogo.json as a source.

I think having @master or any tag for that matter would help in readability of JSON file. I believe the use of this command will be to prepare the mod dependencies by just updating the JSON file and not worrying about flogo install specific version. @fm-tibco thoughts?

I would prefer @master than that crazy autogenerated version. I think if you are using master instead of latest, its not terrible to ask to manually update your imports if you want to fix it to a particular version. Maybe some soft of "flogo imports lock/resolve" command can resolve all the flogo.json imports to the computed version?

If we go with that, this command can be "flogo imports sync" or something?

I really like the idea of flogo imports command with different subcommands. So resolve will "force" the replacement of module queries by actual versions in the flogo.json file while the sync will just do it in go.mod file right ?

Yes, Samip can go ahead and implement the flogo imports command with the sync and resolve subcommands?

Yes.

I feel like the flogo list command in #55 could be moved to flogo imports list, what do you think?

yeah.. makes sense... I'll move it over once flogo imports is in place