There've been multiple posts in here in the past c...
# ask-community
j
There've been multiple posts in here in the past couple of days about pulling from github repos. Can one of the prefect folks please confirm whether deploying like this should result in the flow pulling the repo on each flow run? I want to know whether I should make a feature request / PR if not. https://docs.prefect.io/v3/deploy/infrastructure-concepts/store-flow-code#git-based-storage
@Nate do you have any ideas here? I can't tell if it's user error or working as intended when it doesn't pull the repo on each run. If it's working as intended, I'd gladly work on a PR to add some sort of flag to the deployment to refetch on each flow run.
n
There've been multiple posts in here in the past couple of days about pulling from github repos. Can one of the prefect folks please confirm whether deploying like this should result in the flow pulling the repo on each flow run?
hi @Jeff S itd be helpful if you could describe what you're seeing but yes if a deployment has a
git_clone
pull step, then it will pull the specified git repo
j
If I deployed like this should it pull from github every time the flow runs?
Copy code
flow.from_source(
        source="<https://github.com/org/my-public-repo.git>",
        entrypoint="gh_no_block.py:my_flow",
    ).deploy(
        name="my-github-deployment",
        work_pool_name="my_pool",
    )
Or is there another step i need to add here?
n
there is no additional step you should need to add
j
Interesting - OK. Then it's something on my end. The behavior I was seeing is that it simply doesn't clone the repo on each future scheduled run. But I'll have to investigate. Thanks for confirming.
It would only clone it initially
Copy code
After creating a deployment, you may need to change your flow code. If baking your flow code into a Docker image, you will need to rebuild your image. If storing your flow code in a git-based version control platform or a cloud-based storage location, often you can update your flow code without rebuilding your deployment.

The exception is when something the server needs to know about has changed, such as the flow entrypoint parameters.

Rerun the Python script with deploy or run prefect deploy from the CLI for YAML-based deployments to update your deployment with the new flow code.
@Nate do I have to re-deploy when the code changes? Or will the next scheduled run of the deployment automatically fetch the new code? Because the latter is what hasn't been working for me.
n
you should not have to redeploy unless features of your deployment change • where the code lives • job variables bound to the deployment • etc if you can reproduce this, an issue would be most helpful!
❤️ 1