cloud dbt using git and pinning to a commit or tag

Hey everyone,

can cloud dbt jobs be pinned to a commit? I know packages.yml can but it seems that cloud dbt always takes HEAD. It would be extra special if it can so using a main can be used for commits without those commits being deployed to production.

I believe specifying custom branch will take a tag or commit too. Or at the least that’s the first thing I’d try

Nice, I will try it out. That makes sense if I think about it - checking out a commit is not really any different than checking out a custom branch. Tag maybe a stretch too far but

I will reply once I confirm. This will be my second great find this week that I thought was something I could not do. Woot woot!

Close, but no cigar. Looks like it cloned and checked out the commit in the beginning but then tries to hard reset to the commit from origin and fails. Maybe I did something wrong? The only thing I did was to replace the custom branch name with the 7 char commit which seems to work fine but fails in the last few steps.

Output in dbt cloud console:
Cloning into ‘/tmp/jobs/103062679/target’…
Successfully cloned repository.
Listing tags in repo…
Checking out to aee4192…
Note: switching to ‘aee4192’.

You are in ‘detached HEAD’ state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at aee4192 feat: updated sqlfluff byte limit, clean-targets for dbt_project, added package.json to support git hooks, added prettier to devcontainers, and added profiles.yml to cloud-dbt with last updated profiles.yml from dbt_project_dan
Checking out branch 'aee4192’Failed to checkout to specified revision.
git reset --hard origin/aee4192
fatal: ambiguous argument ‘origin/aee4192’: unknown revision or path not in the working tree.
Use ‘–’ to separate paths from revisions, like this:
‘git […] – […]’

So, seems I can’t get back to checking out branches on that environment. I have tested pretty thoroughly with updating and attempting to build with a branch name but the commit id seems to stick. I updated to a new commit id and it finally updated but no luck with an actual branch name. Weird! I blame user error - but I know not what :).

I will take it no other comments for 8 days from the community means that the community does not know if cloud dbt can pull anything but head and I consider this question closed.

I would request cloud dbt team add this to their feature list. dbt labs must understand the importance of pinning to a commit revision or tag(tags are better) if that functionality exists in packages.yml. This is an important capability for deployments through cloud dbt and forces SDLC branching paradigms to stay off of main/production branch for staging/shippable increment builds.