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

"Invalid git branch: main" when using piperider compare #866

Open
DaveFlynn opened this issue Aug 30, 2023 · 1 comment
Open

"Invalid git branch: main" when using piperider compare #866

DaveFlynn opened this issue Aug 30, 2023 · 1 comment

Comments

@DaveFlynn
Copy link
Contributor

When using the piperider compare function, you may come across the following error message:

Error: Invalid git branch: main

This is caused because PipeRider expects the name of the default/base branch to be main. This may not always be the case, and another common alternative is master.

To workaround this issue, you should create a default compare 'recipe' and specify the actual name of your default/base branch.

For instance, if your default branch is called master, you should create the following file in .piperider/compare/default.yml

base:
  branch: master
  dbt:
    commands:
    - dbt deps
    - dbt build
  piperider:
    command: piperider run
target:
  dbt:
    commands:
    - dbt deps
    - dbt build --select state:modified+ --state <DBT_STATE_PATH>
  piperider:
    command: piperider run

After creating this file, specifying the correct base branch name, you should be able run piperider compare

@DaveFlynn
Copy link
Contributor Author

Another solution, that may be more desirable, is to use the --base-branch option when running compare:

piperider compare --base-branch master

The reason is that the --select option that specifies resources actually supersedes recipes, so the following command would still default to using main branch as the base:

piperider compare --select models/marts

Instead, add the --base-branch option:

piperider compare --select models/marts --base-branch master

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

No branches or pull requests

1 participant