prefect icon indicating copy to clipboard operation
prefect copied to clipboard

prefect-bitbucket docs need a yaml example

Open j-carson opened this issue 4 months ago • 7 comments

Describe the current behavior

The docs for bitbucket only have examples with python, need to add instructions for how to pull from a prefect.yaml file.

pull:
  - prefect.deployments.steps.pull.pull_with_block:
      block_document_name: my-bitbucket-repo-block  
      block_type_slug: bitbucket-repository

Describe the proposed behavior

Add to the examples here https://github.com/PrefectHQ/prefect/blob/main/docs/integrations/prefect-bitbucket/index.mdx

Example Use

See above

Additional context

No response

j-carson avatar Nov 11 '25 21:11 j-carson

hey j-carson, I agree 👀. I’ll add a YAML example to the Bitbucket docs showing how to pull code using a prefect.yaml deployment with pull_with_block

ehab20011 avatar Dec 01 '25 04:12 ehab20011

@j-carson this is the currently documented way to clone from BitBucket via a prefect.yaml file:

pull:
    - prefect.deployments.steps.git_clone:
        respository: https://bitbucket.org/org/private-repo.git
        credentials: "{{ prefect.blocks.bitbucket-credentials.my-bitbucket-credentials-block }}"

Is there a reason that you prefer using the pull_with_block pull step? That was primarily added for backwards compatibility and doesn't support everything that the git_clone pull step supports.

desertaxle avatar Dec 03 '25 15:12 desertaxle

What is not supported? I created a BitBucketRepository block and then asked Marvin how to use it since it wasn’t clear. Your YAML doesn’t look right - is credentials supposed to be in there twice?

j-carson avatar Dec 03 '25 15:12 j-carson

The git_clone step supports stuff like submodules and sparse-checkout, but the BitBucket Repository block doesn't support those features.

There is a typo in the prefect-bitbucket docs. The first credentials should be repository (I updated my comment).

desertaxle avatar Dec 03 '25 16:12 desertaxle

OK - I'm not using submodules and sparse-checkout yet, but I have two BitBucketRepository blocks that point to different branches for sandbox and production. Can the example be updated to show all the possible features of the git_clone step?

Is there a "git clone" block where I can put the repo url, the branch, any new features I want to do in the future like sparse checkout to reference in one spot instead of in different yaml files that I have to remember to re-run "prefect deploy"?

j-carson avatar Dec 03 '25 18:12 j-carson

The full documentation for the git_clone pull step is here. We could include a link in the prefect-bitbucket docs for clarity.

We don't have a git block, but if you have multiple deployments using the same repo and branch, then you could consider putting them all in the same prefect.yaml file to consolidate the configuration.

desertaxle avatar Dec 03 '25 20:12 desertaxle

OK, so the answer to your original question is - the reason I prefer pull_with_block after being told about other options, is that it's really easy to wind up with a lot of configuration state scattered about, and I'm trying to use Prefect as my place to contain it all. I prefer my yaml files reference blocks and variables rather than any values that might change in the future. The BitBucketRepository block suits that preference.

j-carson avatar Dec 04 '25 23:12 j-carson