-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[docs] Add source control code references docs #22319
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @benpankow and the rest of your teammates on Graphite |
Deploy preview for dagster-docs ready! Preview available at https://dagster-docs-1ejx9w2bl-elementl.vercel.app Direct link to changed pages: |
305e92c
to
918f3c4
Compare
9e225d2
to
7f93139
Compare
7f93139
to
cebed80
Compare
875b084
to
ac47dcd
Compare
3a9a88a
to
29b779b
Compare
f4e6d8e
to
6ce81f3
Compare
29b779b
to
e9156bb
Compare
6ce81f3
to
0cac947
Compare
e9156bb
to
12f6271
Compare
0cac947
to
acff923
Compare
12f6271
to
89eb430
Compare
acff923
to
2f34c5b
Compare
021df7a
to
080127d
Compare
ae49538
to
87722d6
Compare
eb645c2
to
b774d69
Compare
b774d69
to
348d2c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments - otherwise looks good to go!
|
||
### In Dagster Plus | ||
|
||
If using Dagster Plus, you can use the `link_code_references_to_git_if_cloud` utility to conditionally convert local file code references to source control links. This utility will automatically detect if your code is running in a Dagster Cloud environment and convert local file code references to source control links, pointing at the commit hash of the code running in the current deployment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use PyObject
to link to the API doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As below - cloud packages aren't worked into the docs build
|
||
If using Dagster Plus, you can use the `link_code_references_to_git_if_cloud` utility to conditionally convert local file code references to source control links. This utility will automatically detect if your code is running in a Dagster Cloud environment and convert local file code references to source control links, pointing at the commit hash of the code running in the current deployment. | ||
|
||
```python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snippet should go in a .py file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now our docs build doesn't include cloud packages, so this won't work in a snippet file. Can file as a todo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah - worth adding a comment to explain why we're doing this.
Co-authored-by: Sandy Ryza <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but heed final comments.
Also, do we have these in an rst file?
..._snippets/docs_snippets/guides/dagster/code_references/link_to_source_control_conditional.py
Outdated
Show resolved
Hide resolved
@@ -27,7 +27,7 @@ To complete the steps in this guide, you'll need: | |||
|
|||
--- | |||
|
|||
## Automatically attaching code references to asset definitions | |||
## Automatically attaching local file code references to asset definitions | |||
|
|||
### Assets defined in Python | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on the line below, but we should use PyObject
and avoid an import that goes through a private path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, meant to approve on that last one (but heed final comments)
5c16d82
to
9615f76
Compare
## Summary Expands the code references guide to include info on attaching references to git source control on cloud and OSS. ## Test Plan Vercel. --------- Co-authored-by: Sandy Ryza <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to the game but these docs still need work before we can publish 1.8 I think? None of the API links work.
|
||
### Assets defined in Python | ||
|
||
To automatically attach code references to Python assets' function definitions, you can use the `dagster._core.definitions.metadata.with_source_code_references` utility. Any asset definitions passed to the utility will have their source file attached as metadata. | ||
To automatically attach code references to Python assets' function definitions, you can use the <PyObject module="dagster" object="with_source_code_references"/> utility. Any asset definitions passed to the utility will have their source file attached as metadata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PyObject link doesn't work
@@ -65,7 +65,7 @@ Dagster's dbt integration can automatically attach references to the SQL files b | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A link to the asset's source in `with_source_code_references.py` will then be visible in the **Asset Catalog** view in the Dagster UI:
There's no reference to with_source_code_references.py
in the above prose/code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also that image is way too big
|
||
### In any Dagster environment | ||
|
||
The <PyObject module="dagster" object="link_code_references_to_git"/> utility allows you to convert local file code references to source control links. You'll need to provide the base URL of your git repository, the branch or commit hash, and a path to the repository root locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PyObject also doesn't work
Summary
Expands the code references guide to include info on attaching references to git source control on cloud and OSS.
Test Plan
Vercel.