Prefect: Make flow.register() work only on flows which are different from the latest one

Created on 5 Oct 2020  路  4Comments  路  Source: PrefectHQ/prefect

Current behavior

If a flow is unchanged and already register, when I register it again flow.register(project_name="Some Name") it produced a new version.

Proposed behavior

Either not register a flow if it's identical to the latest or have a flag in flow.register() which will only register the flow if different from the latest version.

Example

flow.register(project_name="Some Name", validate_difference=True) or something like that :)

enhancement

Most helpful comment

This was closed by https://github.com/PrefectHQ/prefect/pull/3590 and is now released!

All 4 comments

This makes sense - we could store some type of hash of the JSON representation of the Flow in the backend, and only create a new Flow ID when the provided JSON payload doesn't match the old one.

Awesome idea @snenkov

This is definitely a pain point because if you want to register your flows using a CI/CD tool, then, the flow versioning becomes meaningless 馃槙

Yeah i would like to do the flow registration in my CI process. One way to handle this issue is to allow to pass some sort of ID of a flow, in CI case this can be a commit hash or md5 of flow source file.

This was closed by https://github.com/PrefectHQ/prefect/pull/3590 and is now released!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kforti picture kforti  路  3Comments

fgblomqvist picture fgblomqvist  路  4Comments

WilliamBurdett picture WilliamBurdett  路  3Comments

petermorrow picture petermorrow  路  3Comments

Trymzet picture Trymzet  路  4Comments