Skip to content

Add run_shell_script and pip_install_requirements utility steps#655

Merged
mitchnielsen merged 5 commits intomainfrom
feature/654-add-util-pull-steps
Mar 13, 2026
Merged

Add run_shell_script and pip_install_requirements utility steps#655
mitchnielsen merged 5 commits intomainfrom
feature/654-add-util-pull-steps

Conversation

@bdalpe
Copy link
Contributor

@bdalpe bdalpe commented Mar 13, 2026

Summary

Adds support for two additional Prefect deployment utility pull steps in Terraform deployment configuration:

  • run_shell_script
  • pip_install_requirements

This updates deployment pull_steps so these step types can be configured in Terraform and correctly serialized/deserialized with the Prefect API, based on upstream step definitions in utility.py.

What Changed

  • Extended API pull step models and union mapping to include:
    • prefect.deployments.steps.run_shell_script
    • prefect.deployments.steps.pip_install_requirements
  • Updated deployment resource pull_steps schema to support new fields, including:
    • script, env, stream_output, expand_env_vars, requirements_file, and shared directory
  • Added Terraform ↔ API mapping logic for both new step types.
  • Kept deployment datasource pull_steps schema in parity with resource changes.
  • Expanded deployment acceptance test fixture coverage to include both new pull step types.
  • Regenerated deployment docs for resource and datasource nested pull_steps schema.

Validation

  • Formatted updated Go files with gofmt.
  • Ran targeted package compile/test checks for touched areas (internal/api, deployment resource, deployment datasource).

Closes #654


General

  • The contributing guide has been read
  • Title follows the conventional commits format
  • Body includes Closes <issue>, if available
  • Relevant labels have been added
  • Draft status is used until ready for review

Code-level changes

  • Unit tests are added/updated
  • Acceptance tests are added/updated (including import tests, when needed)

New or updated resource/datasource

  • Documentation is added (generated by mise run docs from source code)
    - When applicable, provide a link back to the relevant page in the Prefect documentation site.
    - Use the doc preview tool to confirm page(s) render correctly.
  • For resources, the following are added:
    - Resource example under examples/resources/prefect_<name>/resource.tf
    - Import example under examples/resources/prefect_<name>/import.sh
  • For datasources, the following is added:
    - Datasource example under examples/data-sources,resources>/prefect_<name>/data-source.tf

@bdalpe bdalpe requested a review from a team as a code owner March 13, 2026 14:32
@bdalpe bdalpe added enhancement New feature or request go Pull requests that update Go code labels Mar 13, 2026
@bdalpe bdalpe had a problem deploying to Acceptance Tests March 13, 2026 14:32 — with GitHub Actions Failure
@github-actions github-actions bot added the docs label Mar 13, 2026
@mitchnielsen
Copy link
Member

Thanks for opening this @bdalpe. Looks like there are some test failures to check out.

@bdalpe
Copy link
Contributor Author

bdalpe commented Mar 13, 2026

Thanks @mitchnielsen. Lint issues should be fixed now.

@bdalpe bdalpe had a problem deploying to Acceptance Tests March 13, 2026 16:09 — with GitHub Actions Failure
bdalpe added 2 commits March 13, 2026 11:16
This is expected behavior and controlled
even on non-run_shell_script pull steps
@mitchnielsen
Copy link
Member

@bdalpe what do you think of adding example(s) in the deployment example? I think it could be helpful for end users to see a real example of how you'd set this up.

@bdalpe bdalpe temporarily deployed to Acceptance Tests March 13, 2026 19:09 — with GitHub Actions Inactive
@bdalpe
Copy link
Contributor Author

bdalpe commented Mar 13, 2026

@mitchnielsen good call out. I added the missing supported steps to the example resource file.

@mitchnielsen mitchnielsen merged commit 0cf091a into main Mar 13, 2026
8 checks passed
@mitchnielsen mitchnielsen deleted the feature/654-add-util-pull-steps branch March 13, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement New feature or request go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prefect_deployment: Add support for run_shell_script and pip_install_requirements pull steps

2 participants