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

Add a url_for utility for generating URLs for Prefect objects #13885

Merged
merged 14 commits into from
Jun 13, 2024
Merged

Conversation

abrookins
Copy link
Collaborator

@abrookins abrookins commented Jun 7, 2024

Adds a url_for utility function that generates a URL for any Prefect API object. This gives us a consistent place to generate URLs (something we do in various places) and also gives users a way to generate a UI URL or API URL for API objects, such as FlowRuns, TaskRuns and PrefectFuture objects representing task runs.

Example

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

For documentation changes:

  • This pull request includes redirect settings in mint.json for files that are removed or renamed.

For new functions or classes in the Python SDK:

  • This pull request includes helpful docstrings.
  • If a new Python file was added, this pull request contains a stub page in the Python SDK docs and an entry in docs/mint.json navigation.

@abrookins abrookins changed the title Use the new url_for utility in a few places Add a url_for utility for generating URLs of Prefect objects Jun 7, 2024
@abrookins abrookins changed the title Add a url_for utility for generating URLs of Prefect objects Add a url_for utility for generating URLs for Prefect objects Jun 7, 2024
@abrookins abrookins marked this pull request as ready for review June 7, 2024 23:32
@abrookins abrookins requested review from zangell44 and a team as code owners June 7, 2024 23:32
@abrookins
Copy link
Collaborator Author

I'm ok with where this landed, but I'll probably want to go back someday and add all the different variations of each schema, since there are a lot of different versions of each one (server vs. client runs, server vs. core event and automations schemas, etc.).

Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

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

Beautifully done

@abrookins abrookins merged commit e282567 into main Jun 13, 2024
26 checks passed
@abrookins abrookins deleted the url-for branch June 13, 2024 16:45
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.

4 participants