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

Block dbt deploys from within Astro project #1676

Merged
merged 2 commits into from
Jul 17, 2024
Merged

Conversation

jeremybeard
Copy link
Contributor

Description

This change blocks the astro dbt deploy command from deploying a dbt project that is within an Astro project. This use case is not supported because it can create unexpected behavior when the full Astro project is then deployed with astro deploy.

🧪 Functional Testing

  • Unit tests added/updated
  • Manually tested within and outside of an Astro project

📸 Screenshots

Screenshot 2024-07-17 at 1 32 41 PM

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 64.70588% with 12 lines in your changes missing coverage. Please review.

Project coverage is 86.27%. Comparing base (a8e81d7) to head (a24d24d).

Files Patch % Lines
config/config_test_utils.go 60.00% 3 Missing and 3 partials ⚠️
config/config.go 69.23% 2 Missing and 2 partials ⚠️
cmd/cloud/dbt.go 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1676      +/-   ##
==========================================
- Coverage   86.31%   86.27%   -0.05%     
==========================================
  Files         116      117       +1     
  Lines       17052    17085      +33     
==========================================
+ Hits        14719    14740      +21     
- Misses       1403     1409       +6     
- Partials      930      936       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

config/config.go Outdated
@@ -230,6 +231,26 @@ func IsProjectDir(path string) (bool, error) {
return fileutil.Exists(configFile, nil)
}

// IsWithinProjectDir returns true if the path is at or within an Astro project directory
func IsWithinProjectDir(path string) (bool, error) {
dbtProjectPathAbs, err := filepath.Abs(filepath.Clean(path))
Copy link
Contributor

Choose a reason for hiding this comment

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

If this function not just for DBT, can we make the variable names generic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good call.

@jeremybeard jeremybeard merged commit cabcae3 into main Jul 17, 2024
3 of 5 checks passed
@jeremybeard jeremybeard deleted the block-dbt-within-astro branch July 17, 2024 18:26
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