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

fix(dbt-doc): Allow copying asset when dbt docs command is run outside th… #11219

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cedric-orange
Copy link

@cedric-orange cedric-orange commented Jan 16, 2025

Resolves #9308

Problem

The directory assets is not being copied to target/assets when running dbt docs generate if you are not in root dbt project.

Solution

Add dbt_project_dir to asset path

Note: I added a devcontainer.json file to have quickly a full-featured development environment

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.

@cedric-orange cedric-orange requested a review from a team as a code owner January 16, 2025 19:46
Copy link

cla-bot bot commented Jan 16, 2025

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @cedric-orange

@github-actions github-actions bot added the community This PR is from a community member label Jan 16, 2025
@cla-bot cla-bot bot added the cla:yes label Jan 16, 2025
@cedric-orange
Copy link
Author

Before correction, when running dbt docs generate --project-dir myproject assets are missing in target output.

After this fix: there is now a directory on target output containing assets.

Copy link
Contributor

@dataders dataders left a comment

Choose a reason for hiding this comment

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

thanks for the PR @cedric-orange! You're right that it's a small change.

Two requests:

  1. remove the .devcontainer/devcontainer.json file you've added
  2. if possible add a unit test to ensure we don't break this behavior in future releases. Fix using project-dir with list command and path selector #8388 contains a test that Doug thinks would get you most of the way but needs some tweaking

Looking at the linked issue, there was a unit

@cedric-orange
Copy link
Author

Thanks for the review, I added a new test according to this topic.

I also remove devcontainer.json file.
I think it would be a good idea to provide a ready-to-use devcontainer for dbt-core.
Do I open another PR with that, or you disagree with it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-3509] [Bug] assets not being copied to target directory with docs generate --project-dir
2 participants