prefect-bitbucket docs need a yaml example
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
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
@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.
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?
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).
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"?
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.
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.