I use CLI "prefect register --project ${{ paramet...
# prefect-community
d
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
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
No....
although the flow uses some parameters , environment variables and secrets in prefect cloud.
k
I think those should be fine, but really you can test this behavior on a basic flow
d
Is their a way to get flow metadata?
k
yep! print flow.serialized_hash() maybe
d
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
I can try to replicate a bit later
💯 1
d
@Kevin Kho, I guess it's caused by some mistakes I mad.. Sorry about the confusion..
k
Oh no worries I was just about to try replicating. Thanks for circling back. Is it working for you now?
d
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
Yes you shouldnt need them
🌠 1
🙌 1