David Yang

    David Yang

    6 months ago
    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.
    Kevin Kho

    Kevin Kho

    6 months ago
    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?
    David Yang

    David Yang

    6 months ago
    No....
    although the flow uses some parameters , environment variables and secrets in prefect cloud.
    Kevin Kho

    Kevin Kho

    6 months ago
    I think those should be fine, but really you can test this behavior on a basic flow
    David Yang

    David Yang

    6 months ago
    Is their a way to get flow metadata?
    Kevin Kho

    Kevin Kho

    6 months ago
    yep! print flow.serialized_hash() maybe
    David Yang

    David Yang

    6 months ago
    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?
    Kevin Kho

    Kevin Kho

    6 months ago
    I can try to replicate a bit later
    David Yang

    David Yang

    6 months ago
    @Kevin Kho, I guess it's caused by some mistakes I mad.. Sorry about the confusion..
    Kevin Kho

    Kevin Kho

    6 months ago
    Oh no worries I was just about to try replicating. Thanks for circling back. Is it working for you now?
    David Yang

    David Yang

    6 months ago
    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.
    Kevin Kho

    Kevin Kho

    6 months ago
    Yes you shouldnt need them