https://prefect.io logo
Title
d

David Yang

03/10/2022, 7:02 PM
I use CLI "prefect register --project ${{ parameters.project }} --label $(dockeragent_label) -p flows/" to register all prefect flow files in "flows" folder. This command runs in an azure devop pipeline. But it seems that the command registers all flows with new version although most of them have no metadata changes. The pipeline run always install the latest prefect version. Any idea why that happens? I though the latest prefect version won't create new version if the metadata is not changed.
k

Kevin Kho

03/10/2022, 7:04 PM
This should actually not register stuff if the metadata is unchanged. Do you have something like
datetime.datetime.now()
somewhere in the flow that changes value each time?
d

David Yang

03/10/2022, 7:04 PM
No....
although the flow uses some parameters , environment variables and secrets in prefect cloud.
k

Kevin Kho

03/10/2022, 7:11 PM
I think those should be fine, but really you can test this behavior on a basic flow
d

David Yang

03/10/2022, 7:11 PM
Is their a way to get flow metadata?
k

Kevin Kho

03/10/2022, 7:11 PM
yep! print flow.serialized_hash() maybe
d

David Yang

03/10/2022, 7:39 PM
It's caused by using git storage. devops_storage=Git( repo="xxxxxxxx", # name of repo flow_path="./flows/xxxxx.py", repo_host="xxxxxxxxxxxx", # repo host name branch_name= "main", git_clone_url_secret_name="azureflowurl" ) @Kevin Kho, any suggestion to solve this issue?
k

Kevin Kho

03/10/2022, 7:41 PM
I can try to replicate a bit later
💯 1
d

David Yang

03/10/2022, 8:37 PM
@Kevin Kho, I guess it's caused by some mistakes I mad.. Sorry about the confusion..
k

Kevin Kho

03/10/2022, 8:39 PM
Oh no worries I was just about to try replicating. Thanks for circling back. Is it working for you now?
d

David Yang

03/10/2022, 8:41 PM
yeah. because of the repo and git_clone_url values are out of sync after I migrate code from one project to another project. BTW, repo and repo_host are optional since git_clone_url has all these info? I may should remove them if they are optional.
k

Kevin Kho

03/10/2022, 8:45 PM
Yes you shouldnt need them
🌠 1
🙌 1