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

gbp reporting error "Can't find upstream vcs tag" when the upstream tag is not on any branch #228

Open
wlyu2 opened this issue Nov 28, 2024 · 0 comments

Comments

@wlyu2
Copy link

wlyu2 commented Nov 28, 2024

When I am trying to create a debian package for "k8s.io/cli-runtime", I encountered the following error:

$ dh-make-golang make -git_revision v0.30.1 -type l k8s.io/cli-runtime
2024/11/26 10:33:32 Starting "dh-make-golang v0.7.0 linux/amd64"                                                                                                                                            
2024/11/26 10:33:32 revision: "v0.30.1"                                                                                                                                                                     
2024/11/26 10:33:32 Downloading "k8s.io/cli-runtime/..."                                                                                                                                                    
2024/11/26 10:33:34 Determining upstream version number                                                                                                                                                     
2024/11/26 10:33:34 Found latest tag "kubernetes-1.30.1"                                                                                                                                                    
2024/11/26 10:33:34 WARNING: Latest tag "kubernetes-1.30.1" is not a valid SemVer version                                                                                                                   
2024/11/26 10:33:34 Latest tag "kubernetes-1.30.1" matches master                                                                                                                                           
2024/11/26 10:33:34 Package version is "1.30.1"
...
2024/11/27 11:30:10 Adding remote "origin" with URL "[email protected]:go-team/packages/golang-k8s-cli-runtime.git"                                                                                      
2024/11/27 11:30:10 Adding remote "k8s" with URL "https://github.com/kubernetes/cli-runtime"                                                                                                                
2024/11/27 11:30:10 Running "git fetch k8s"                                                           
remote: Enumerating objects: 8128, done.                                                              
remote: Counting objects: 100% (3177/3177), done.                                                                                                                                                           
remote: Compressing objects: 100% (643/643), done.                                                                                                                                                          
remote: Total 8128 (delta 2613), reused 3066 (delta 2525), pack-reused 4951 (from 1)                                                                                                                        
Receiving objects: 100% (8128/8128), 4.90 MiB | 17.98 MiB/s, done.                                    
Resolving deltas: 100% (5200/5200), done.                                                             
From https://github.com/kubernetes/cli-runtime                                                        
 * [new branch]      master                    -> k8s/master                                                                                                                                                
 * [new branch]      release-1.12              -> k8s/release-1.12                                                                                                                                          
 * [new branch]      release-1.13              -> k8s/release-1.13                                                                                                                                          
 * [new branch]      release-1.14              -> k8s/release-1.14                                                                                                                                          
 * [new branch]      release-1.15              -> k8s/release-1.15         
 * [new branch]      release-1.16              -> k8s/release-1.16         
 * [new branch]      release-1.17              -> k8s/release-1.17         
 * [new branch]      release-1.18              -> k8s/release-1.18         
 * [new branch]      release-1.19              -> k8s/release-1.19        
 * [new branch]      release-1.20              -> k8s/release-1.20         
 * [new branch]      release-1.21              -> k8s/release-1.21        
 * [new branch]      release-1.22              -> k8s/release-1.22  
 * [new branch]      release-1.23              -> k8s/release-1.23  
 * [new branch]      release-1.24              -> k8s/release-1.24         
 * [new branch]      release-1.25              -> k8s/release-1.25         
 * [new branch]      release-1.26              -> k8s/release-1.26 
 * [new branch]      release-1.27              -> k8s/release-1.27      
 * [new branch]      release-1.28              -> k8s/release-1.28        
 * [new branch]      release-1.29              -> k8s/release-1.29        
 * [new branch]      release-1.30              -> k8s/release-1.30        
 * [new branch]      release-1.31              -> k8s/release-1.31        
 * [new tag]         kubernetes-1.13.12        -> kubernetes-1.13.12      
 * [new tag]         kubernetes-1.13.13-beta.0 -> kubernetes-1.13.13-beta.0                                                                                                                                 
 * [new tag]         kubernetes-1.14.8         -> kubernetes-1.14.8            
 * [new tag]         kubernetes-1.14.9-beta.0  -> kubernetes-1.14.9-beta.0   
 * [new tag]         kubernetes-1.10.0-alpha.0 -> kubernetes-1.10.0-alpha.0
 * [new tag]         kubernetes-1.10.0-alpha.1 -> kubernetes-1.10.0-alpha.1                                                                                                                                 
 * [new tag]         kubernetes-1.10.0-alpha.2 -> kubernetes-1.10.0-alpha.2
 * [new tag]         kubernetes-1.10.0-alpha.3 -> kubernetes-1.10.0-alpha.3                                                                                                                                 
 * [new tag]         kubernetes-1.11.0-alpha.0 -> kubernetes-1.11.0-alpha.0                                                                                                                                 
 * [new tag]         kubernetes-1.11.0-alpha.1 -> kubernetes-1.11.0-alpha.1                                                                                                                                 
 * [new tag]         kubernetes-1.11.0-alpha.2 -> kubernetes-1.11.0-alpha.2                                                                                                                                 
 * [new tag]         kubernetes-1.12.0-alpha.0 -> kubernetes-1.12.0-alpha.0
 * [new tag]         kubernetes-1.12.0-alpha.1 -> kubernetes-1.12.0-alpha.1
 * [new tag]         kubernetes-1.12.0-beta.0  -> kubernetes-1.12.0-beta.0
 * [new tag]         kubernetes-1.13.0-alpha.0 -> kubernetes-1.13.0-alpha.0
 * [new tag]         kubernetes-1.13.0-beta.2  -> kubernetes-1.13.0-beta.2
 * [new tag]         kubernetes-1.13.10        -> kubernetes-1.13.10                                  
 * [new tag]         kubernetes-1.13.11        -> kubernetes-1.13.11                                                                                                                                        
 * [new tag]         kubernetes-1.13.11-beta.0 -> kubernetes-1.13.11-beta.0                           
 * [new tag]         kubernetes-1.13.12-beta.0 -> kubernetes-1.13.12-beta.0                           
 * [new tag]         kubernetes-1.14.0         -> kubernetes-1.14.0                                   
 * [new tag]         kubernetes-1.14.0-rc.1    -> kubernetes-1.14.0-rc.1                              
 * [new tag]         kubernetes-1.14.1-beta.0  -> kubernetes-1.14.1-beta.0                            
 * [new tag]         kubernetes-1.9.0-alpha.0  -> kubernetes-1.9.0-alpha.0                            
 * [new tag]         kubernetes-1.9.0-alpha.1  -> kubernetes-1.9.0-alpha.1                            
 * [new tag]         kubernetes-1.9.0-alpha.2  -> kubernetes-1.9.0-alpha.2                            
 * [new tag]         kubernetes-1.9.0-alpha.3  -> kubernetes-1.9.0-alpha.3   
gbp:error: Import of /home/wlyu/work/deb_package_sid/dh-make-golang/golang-k8s-cli-runtime_1.30.1.orig.tar.gz failed: Can't find upstream vcs tag at 'kubernetes-1.30.1'
2024/11/26 10:33:41 Could not create git repository: import-orig: exit status 1

Turns out that many release tags, including this kubernetes-1.30.1 tag, in the "k8s.io/cli-runtime" upstream repo are not on any branches:

$ git remote -v
origin  https://github.com/kubernetes/cli-runtime.git (fetch)
origin  https://github.com/kubernetes/cli-runtime.git (push)

$ git tag --contains v0.31.3
kubernetes-1.31.3
v0.31.3

$ git branch --contains kubernetes-1.31.3 && echo DONE
DONE

When "dh-make-golang" is creating the "debianized" source repo based on the upstream repo in make.go:createGitRepository(), "dh-make-golang" is creating it from scratch, adding the remote, and updating the tags. However, during this step, "dh-make-golang" is using "get fetch" with no additional flags or options:

if err := runGitCommandIn(dir, "fetch", u.remote); err != nil {

This results in upstream tags not on any branch not being fetched resulting in the observed gbp error.

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