Updating go.sum artifact on Bitbucket Cloud #24783
Replies: 30 comments
-
We will need an enhancement to our go artifacts code here: renovate/lib/manager/gomod/artifacts.ts Lines 13 to 29 in 6ec460b |
Beta Was this translation helpful? Give feedback.
-
@rarkins in much the same spirit as was done with python hash support, I'm happy to test anything that may be proposed. I will try duplicating the mentioned code and adjusting for Bitbucket to see if that results in any progress. Will provide feedback here for you. One question, are host-rules capable of being specified in the Renovate configuration that runs as a cronjob? or must it be specified in the renovate.json within the repository under management. |
Beta Was this translation helpful? Give feedback.
-
hostRules can be defined in the bot config too |
Beta Was this translation helpful? Give feedback.
-
Hey, I'm having a similar issue. I'm using renovate cli from docker image on bitbucket pipelines like: renovate-bot:
- step:
image: renovate/renovate:23.89
name: Renovate Bot
clone:
enabled: false
script:
- export GOPRIVATE=bitbucket.org/my_org/*
- export BB_USER=renovateuser
- git config --global url."https://${BB_USER}:${RENOVATE_PASSWORD}@bitbucket.org".insteadOf "https://bitbucket.org"
- renovate --username=${BB_USER} --log-level debug --platform=bitbucket $BITBUCKET_REPO_FULL_NAME however, getting the following error:
Question:
|
Beta Was this translation helpful? Give feedback.
-
the parameter value need to be an stringified json array. so better add a Renovate doesn't use your gitconfig for lookup updates, it needs a hostRule for auth. |
Beta Was this translation helpful? Give feedback.
-
@viceice thanks for your reply! Can you share the example of how to use Would it be something like: "hostRules": [
{
"domainName": "bitbucket.org",
"username": process.env.BB_USER,
"password": process.env.RENOVATE_PASSWORD
}
] and that is it? |
Beta Was this translation helpful? Give feedback.
-
yes: module.exports = {
"hostRules": [
{
"domainName": "bitbucket.org",
"username": process.env.BB_USER,
"password": process.env.RENOVATE_PASSWORD
}
]
} |
Beta Was this translation helpful? Give feedback.
-
I had no luck with using this, it still fails. Code here has hardcoded github, so no matter what is set in the renovate/lib/manager/gomod/artifacts.ts Lines 12 to 25 in a1cddea So looks like there is no way to use it until https://github.com/renovatebot/renovate/issues/3496 is implemented. |
Beta Was this translation helpful? Give feedback.
-
Where/how do you run the bot? e.g. are you using our official image, or installing the CLI via npm into your own container, etc? |
Beta Was this translation helpful? Give feedback.
-
@rarkins right now I'm using the official image locally:
Also,
|
Beta Was this translation helpful? Give feedback.
-
Also, interesting that I do not see any specific error explaining what happened:
no details at all |
Beta Was this translation helpful? Give feedback.
-
You would need a host rule for Renovate, and the git config rule for |
Beta Was this translation helpful? Give feedback.
-
I do have git config rule for go: And it works for me when I run About the host rule, I tried in many different ways and none of them worked for me, can you share an example of how should it look like? Also, in the trace logs, I was able to spot: {"name":"renovate","hostname":"e19b786e7ef3","pid":1682,"level":10,"logContext":"bHvOPOxOl","repository":"my_org/my_service","url":"https://bitbucket.org/my_org/go-dep1?go-get=1","options":{"method":"get","hostType":"go","hooks":{"beforeRedirect":[null]},"headers":{"accept-encoding":"gzip, deflate","user-agent":"https://github.com/renovatebot/renovate"},"timeout":60000},"msg":"got request","time":"2020-12-04T12:44:34.068Z","v":0} And when I tried to fetch the URL |
Beta Was this translation helpful? Give feedback.
-
Didn't this work in combination with your global git config? |
Beta Was this translation helpful? Give feedback.
-
Nope, let me try again, so I can share what was the outcome. |
Beta Was this translation helpful? Give feedback.
-
yes, some more debug log lines would be helpful |
Beta Was this translation helpful? Give feedback.
-
@trane9991 Can you create a small public github repo with a go dependency pointing to a public bitbucket repo. If this works, we know it's and auth problem, otherwise it's a general renovate go datasource issue |
Beta Was this translation helpful? Give feedback.
-
ok, let me try that |
Beta Was this translation helpful? Give feedback.
-
maybe we need to add some special handling for bitbucket.org here: renovate/lib/datasource/go/index.ts Line 31 in 2932e88 so like we replace |
Beta Was this translation helpful? Give feedback.
-
Here, it failed with the public dependency as well:
You probably right about this:
For example, this handling of |
Beta Was this translation helpful? Give feedback.
-
and finally here is the query against api.bitbucket.org: |
Beta Was this translation helpful? Give feedback.
-
I'll check the code, maybe i can send a fast feature to support this |
Beta Was this translation helpful? Give feedback.
-
nope, needs a new renovate/lib/datasource/go/index.ts Line 116 in 2932e88 |
Beta Was this translation helpful? Give feedback.
-
@viceice @rarkins I made an attempt to resolve this in PR #7892. I want to try to run it on the repo I prepared before to make sure that it works, just need to figure out how to run it locally :) |
Beta Was this translation helpful? Give feedback.
-
Ok, was able to run it locally. Getting tags seems to work fine, but that repo has no Tags so it fails.
Looks like I need to implement |
Beta Was this translation helpful? Give feedback.
-
Is the above config , the correct way to get the private go packages if they are in the bitbucket server. |
Beta Was this translation helpful? Give feedback.
-
It should probably work 🤷♂️ I do not use go nor bitbucket.org, so you need to validate yourself. Please postback any issues here. If it works we can close this issue. |
Beta Was this translation helpful? Give feedback.
-
I hate to piggy back on another issue but I appear to be running into this exact issue trying to run renovate on a kubernetes cluster. the logs show:
for all of our private repos. I can confirm from other experience that this error message is generic and shows up in places where only read access is needed. Just like the OP my pull requests are opened but a note is left with an error for each failed go.sum update. my abridged (removed the repos list) config is
My most recent run from today was using |
Beta Was this translation helpful? Give feedback.
-
So I couldn't really leave this alone lol... I took another look at the renovate config docs as I knew I had seen a mention of So I took a look at the code and found https://github.com/renovatebot/renovate/blob/main/lib/datasource/go/releases-goproxy.ts#L175 so I was hoping that simply setting the Happy to try to debug this (even by taking a stab at it myself, though my TS is blah at best) but I think I need at least some direction to attempt that. |
Beta Was this translation helpful? Give feedback.
-
Hi there, Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction. We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
Beta Was this translation helpful? Give feedback.
-
Which Renovate are you using?
Renovate Open Source CLI
Which platform are you using?
Bitbucket Cloud
Have you checked the logs? Don't forget to include them if relevant
I'm not sure if the logs are relevant or not. If they are, please advise.
What would you like to do?
I have a BitBucket cloud repo with a go.mod file in it which resembles the following,
The relevant part of this question concerns the bitbucket.org
require
line. This is a private Bitbucket-cloud repository.Renovate successfully finds and creates an issue with an update to the github.com requirements. I have a
excludePackagePatterns
package rule defined for the bitbucket.org due to missing support for such things in Renovate.After Renovate creates the PR, it attempts to update the go.sum file. It fails though and adds a comment to the PR with the following in it
For the life of me, I can't see to figure out what I need to configure to give it the necessary access. The user that renovate runs as has an app token and is a member of a group in Bitbucket which has write access to all repos.
I was hoping there is an obvious config or environment variable I can configure on the renovate side (not the repo side) to give it the necessary info (like a host rule or something).
I see mention of Github specific config concerning preCommands here
https://github.com/renovatebot/renovate/blob/master/lib/manager/gomod/artifacts.ts#L13
though its unclear to me if applying the same for Bitbucket would make the above
go
command work as this appears to be specifically raised bygo
.Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions