Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support --credentials #7

Merged
merged 5 commits into from
Feb 4, 2025
Merged

Support --credentials #7

merged 5 commits into from
Feb 4, 2025

Conversation

jakekaplan
Copy link
Collaborator

@jakekaplan jakekaplan commented Feb 4, 2025

Support a --credentials option on deployment. This will create a secret block if one does not exist using the repo's name and owner. If one does it exists, it will update it with the newly passed credentials.

Example Usage:

$ prefect-cloud deploy FUNCTION_NAME --from PYTHON_FILE_URL_IN_REPO --credentials GITHUB_TOKEN

This doesn't AUTOMAGICALLY use credentials for that repo if it exists and you don't provide them. That's a future story.

CLOSES ENG-1232

@jakekaplan jakekaplan requested review from jeanluciano and removed request for chrisguidry February 4, 2025 20:01
Copy link

linear bot commented Feb 4, 2025

@@ -115,6 +120,37 @@ async def set_deployment_id(self, storage_id: UUID, deployment_id: UUID):
json={"deployment_id": str(deployment_id)},
)

async def create_credentials_secret(self, name: str, credentials: str):
try:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably am going to see if I can make a single endpoint that just works this way, there is some the back and forth here is noticeable. In the worst case scenario it's 4 extra calls because you've never add credentials for this repo.

Copy link
Contributor

@jeanluciano jeanluciano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks good.

@jakekaplan jakekaplan merged commit 180725c into main Feb 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants