Skip to content

Conversation

@dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented May 11, 2023

resolves #7594

Description

This resolves the problem with a minimal code change that preserves the current style.

An alternative PR will be raised that is intended to solve the same problem, but with more code changes. Up to the reviewer to choose which is more fruitful to pursue further.

Test cases

There are a lot of separate cases to test here, and I'm not sure which are already covered (or not). Although I don't view this PR as adding tests for any of the tests below, enumerating all them for clarity.

Cases:

  1. In a project
    1. Skip profiles → return
    2. Not skip profiles
      1. Profile name already exists and not okay to overwrite → return
      2. Profile name does not already exist or okay to overwrite
        1. profile_template.yml exists
          1. profile_template.yml is invalid → return
          2. profile_template.yml is valid
            • create profile
            • return
        2. profile_template.yml does not exist
          1. No adapters exist → return
          2. At least one adapter exists
            • interactive prompt
            • create profile
            • return
  2. Not in a project
    1. Specified project name already exists → return
    2. Specified project name does not already exist
      1. Skip profiles → return
      2. Not skip profiles
        1. Profile name already exists and not okay to overwrite → return
        2. Profile name does not already exist or okay to overwrite
          1. No adapters exist → return
          2. At least one adapter exists
            • interactive prompt
            • create profile
            • return

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • Docs changes are not required/relevant for this PR
  • I have run changie new to create a changelog entry

@cla-bot cla-bot bot added the cla:yes label May 11, 2023
@dbeatty10 dbeatty10 changed the title Honor --skip-profile-setup parameter when inside an existing project (Minimal alternative) Honor --skip-profile-setup parameter when inside an existing project May 19, 2023
@dbeatty10
Copy link
Contributor Author

Closing in favor of #7609

@dbeatty10 dbeatty10 closed this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] dbt init _always_ launches an interactive prompt when it finds a dbt project directory

2 participants