The changes were made on Databricks repos not displaying in destination branch after merge with main

1.5k views Asked by At

My work flow is Developer creates a feature branch from main in Databricks repos -> after they make changes on it -> they raise a pull request for merge into main in azure devops-> it triggers the CICD pipeline push the code into the destination branch with changes.

In above process Am able to push the code from feature to feature branch but not into main because main don't have write permissions with CICD. Am confusing to how to achieve this. Below is my yaml pipeline. and also wanted to know, is there possible to update the code into feature branch from main. My target is to update into main. then after move the code from main to feature with same pipeline.

- script: |
      pip install --upgrade databricks-cli
      displayName: 'Install dependencies'

- script: |
      echo "Checking out the $(branchName) branch"
      databricks repos update --path $(Production) --branch $(branchName)
  env:
    DATABRICKS_HOST: $(databricks-url)
    DATABRICKS_TOKEN: $(databricks-pat)
  displayName: 'Update Staging project'

An also I tried to create repos in databricks repos api on higher level folders prod/staging, but this one also failed and throwing error:

Generating script.
Script contents: shell
databricks repos create --url https://[email protected]:***@dev.azure.com/royhill/Enterprise%20Data%20Platform/_git/EDP_Core --provider azureDevOpsServices --path /Repos/Staged/testrepo
========================== Starting Command Output ===========================
"C:\Windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "C:\agents\_work\_temp\7554fb9a-2bb8-4c75-98c3-a4d9819e4420.cmd""
Error: b'{"error_code":"BAD_REQUEST","message":"Remote repo not found. Please ensure that:\\n1. Your remote Git repo URL is valid.\\n2. Your personal access token or app password has the correct repo access."}'
##[error]Cmd.exe exited with code '1'.
Finishing: Update Production project

Below are the commands I tried create repos on Databricks repos API with cicd pipeline

- task: UsePythonVersion@0
  displayName: Configuring Python Version
  inputs:
     versionSpec: '3.9'
     addToPath: true
     architecture: 'x64'

- script: |
     pip install --upgrade databricks-cli
  displayName: 'Install dependencies'

- script: |
    databricks repos create --url https://$(userName):$(devOpsPat)@dev.azure.com/<org>/<projectname>/_git/<reponame> --provider azureDevOpsServices --path /Repos/Staged/reponame
  env:
    DATABRICKS_HOST: $(databricks-url)
    DATABRICKS_TOKEN: $(databricks-pat)
  displayName: 'Update Production project'

Even I tried below command also, but I am getting the same error.

databricks repos create --url https://github.com/<github_profile>/glow 
   --provider gitHub --path /Repos/Production/<reponame>

Please some one help me to sort out these two issues.

0

There are 0 answers