devtron icon indicating copy to clipboard operation
devtron copied to clipboard

Bug: Not able to fetch commit when build type is tag creation

Open kamal-devtron opened this issue 6 months ago • 2 comments

📜 Description

Not able to fetch commit when build type is tag creation

Criticality

P2 - Medium

Impact on Enterprise

Not able to build the image, so testing is stuck

👟 Steps to replicate the Issue

1- Create a build pipeline of type tag creation 2- Give a regex "^v" 3- Create a github release with tagGitHub

👍 Expected behavior

It should fetch the commits from the tag

👎 Actual Behavior

Not able to fetch commits from the tag

☸ Kubernetes version

1.26

Cloud provider

🌍 Browser

Chrome

🧱 Your Environment

No response

✅ Proposed Solution

No response

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find any similar issue

🏢 Have you read the Code of Conduct?

AB#8436

kamal-devtron avatar Feb 12 '24 10:02 kamal-devtron

Root Cause:

The issue was produced as, we save the user given git material (git repo url) directly into database. So if the user has given an additional trailing slash to the git material. It will work fine for CI Build (Branch fix and Regex); as we have the handling in code for them. But where as in case PR based/ Tag based CI; we get the web-hook payload with the git repo url and we search the exact url in the database. For this case the unsanitized git material url (user given) will fail to match.

Proposed Solution:

Instead of saving user given git repo url, we should use the remote url present in git config after cloning.

Ash-exp avatar Feb 12 '24 14:02 Ash-exp

Moving this ticket to be prioritised as this is not an blocking issue

Ash-exp avatar Feb 12 '24 14:02 Ash-exp