0
$\begingroup$

Rosanswers logo

Hello community,

I want to release a repository using bloom (first time) and I am following ROS2's official documentation: https://docs.ros.org/en/humble/How-To-Guides/Releasing/Releasing-a-Package.html

What I have done so far:

  • Installed the tools required (python3-bloom python3-catkin-pkg)
  • Created a release team
  • Created a release repository
  • Create a GIT access token to authenticate
  • Created a 'bloom' file to use the GIT access token
  • Create a ros/rosdistro source entry
  • Generated a Changelog
  • Bumped the package version using catkin_prepare_release

Then I executed:

bloom-release --new-track --rosdistro humble --track humble wall_follower_ros2

Which asked me to enter a release repository URL, which I did entering: https://github.com/ros2-gbp/wall_follower_ros2-release.git

And then I get prompt to enter the repository name, the repo URL, VSC type, among others (you can see values entered below).

My problem is that I get this error:

==> git push --dry-run
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Cannot push to remote release repository.
Hint: If you just typed in your username/password and you have two-factor authentication,see:
  http://wiki.ros.org/bloom/Tutorials/GithubManualAuthorization

My guess is that this is related to the fact that locally I am on branch main and I don't have a master branch.

Output of git branch is:

*main

Output of git remote -v is:

origin  https://github.com/rfzeg/wall_follower_ros2.git (fetch)
origin  https://github.com/rfzeg/wall_follower_ros2.git (push)

I Googled it and I found this question that says regarding having having main as branch :

works OK for regular releases (as master will just be another branch to git and Github, and Bloom is able to find everything it needs just fine)

But I doesn't seem to work for me. What is it that I am doing wrong?

I really appreciate any help you can provide.

Roberto


Here are the lines of output of 'bloom-release` :

Release repository url [press enter to abort]: https://github.com/ros2-gbp/wall_follower_ros2-release.git
==> Fetching 'wall_follower_ros2' repository from 'https://github.com/ros2-gbp/wall_follower_ros2-release.git'
Cloning into '/tmp/tmp72wn05ft'...
warning: You appear to have cloned an empty repository.
WARNING [vcstools] Command failed: 'git checkout master'
 run at: '/tmp/tmp72wn05ft'
 errcode: 1:
error: pathspec 'master' did not match any file(s) known to git
[/vcstools]
Creating 'master' branch.
Creating track 'humble'...
Repository Name:
  <name>
    Name of the repository (used in the archive name)
  upstream
    Default value, leave this as upstream if you are unsure
  ['upstream']: wall_follower_ros2
Upstream Repository URI:
  <uri>
    Any valid URI. This variable can be templated, for example an svn url
    can be templated as such: "https://svn.foo.com/foo/tags/foo-:{version}"
    where the :{version} token will be replaced with the version for this release.
  [None]: https://github.com/rfzeg/wall_follower_ros2
Upstream VCS Type:
  git
    Upstream URI is a git repository
  hg
    Upstream URI is a hg repository
  svn
    Upstream URI is a svn repository
  tar
    Upstream URI is a tarball
  ['git']:
Version:
  :{auto}
    This means the version will be guessed from the devel branch.
    This means that the devel branch must be set, the devel branch must exist,
    and there must be a valid package.xml in the upstream devel branch.
  :{ask}
    This means that the user will be prompted for the version each release.
    This also means that the upstream devel will be ignored.
  <version>
    This will be the version used.
    It must be updated for each new upstream version.
  [':{auto}']:
Release Tag:
  :{version}
    This means that the release tag will match the :{version} tag.
    This can be further templated, for example: "foo-:{version}" or "v:{version}"

    This can describe any vcs reference. For git that means {tag, branch, hash},
    for hg that means {tag, branch, hash}, for svn that means a revision number.
    For tar this value doubles as the sub directory (if the repository is
    in foo/ of the tar ball, putting foo here will cause the contents of
    foo/ to be imported to upstream instead of foo itself).
  :{ask}
    This means the user will be prompted for the release tag on each release.
  :{none}
    For svn and tar only you can set the release tag to :{none}, so that
    it is ignored.  For svn this means no revision number is used.
  [':{version}']:
Upstream Devel Branch:
  <vcs reference>
    Branch in upstream repository on which to search for the version.
    This is used only when version is set to ':{auto}'.
  [None]: main
ROS Distro:
  <ROS distro>
    This can be any valid ROS distro, e.g. foxy, galactic, humble, melodic, noetic, rolling
  ['humble']:
Patches Directory:
  <path in bloom branch>
    This can be any valid relative path in the bloom branch. The contents
    of this folder will be overlaid onto the upstream branch after each
    import-upstream.  Additionally, any package.xml files found in the
    overlay will have the :{version} string replaced with the current
    version being released.
  :{none}
    Use this if you want to disable overlaying of files.
  [None]:
Release Repository Push URL:
  <url>
    (optional) Used when pushing to remote release repositories. This is only
    needed when the release uri which is in the rosdistro file is not writable.
    This is useful, for example, when a releaser would like to use a ssh url
    to push rather than a https:// url.
  :{none}
    This indicates that the default release url should be used.
  [None]:
Created 'humble' track.
==> Testing for push permission on release repository
==> git remote -v
origin  https://github.com/ros2-gbp/wall_follower_ros2-release.git (fetch)
origin  https://github.com/ros2-gbp/wall_follower_ros2-release.git (push)
==> git push --dry-run
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

Cannot push to remote release repository.
Hint: If you just typed in your username/password and you have two-factor authentication,see:
  http://wiki.ros.org/bloom/Tutorials/GithubManualAuthorization

Originally posted by Roberto Z. on ROS Answers with karma: 500 on 2022-11-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Bloom likely expects/assumes/requires a non-empty release repository.

"Non-empty" meaning: a repository with at least one branch in it.

ros2-gbp/wall_follower_ros2-release does not contain any branch, hence the error message.

I'd suggest doing something like:

git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git /tmp/ros2-gbp/wall_follower_ros2-release
cd /tmp/ros2-gbp/wall_follower_ros2-release
# if needed:
# git config --local user.name ... && git config --local user.email ...
git commit --allow-empty -m "Initial commit"
git push origin master  # or whatever you have as default branch

It should start working after this.


Originally posted by gvdhoorn with karma: 86574 on 2022-11-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Roberto Z. on 2022-12-08:
Hello @gvdhoorn, thank you for your answer. I did as described in your answer but I didn't work. Any thoughts? This is what I did:

user:~/ros2_ws/src/wall_follower_ros2$ cd ..
user:~/ros2_ws/src$ git clone https://github.com/ros2-gbp/wall_follower_ros2-release.git
Cloning into 'wall_follower_ros2-release'...
warning: You appear to have cloned an empty repository.
user:~/ros2_ws/src$ cd wall_follower_ros2-release/
user:~/ros2_ws/src/wall_follower_ros2-release$ git commit --allow-empty -m "Initial commit"
[main (root-commit) 8b1bd57] Initial commit
user:~/ros2_ws/src/wall_follower_ros2-release$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/ros2-gbp/wall_follower_ros2-release.git'
user:~/ros2_ws/src/wall_follower_ros2-release$ git branch
* main

Comment by Roberto Z. on 2022-12-08:
It managed to get past the point where bloom-release was failing before. I followed @gvdhoorn advice with one small change:
Once, inside the cloned wall_follower_ros2-release repository I had to create and switch to the master branch before creating the empty commit. Like so:

cd wall_follower_ros2-release/
git branch master
git switch master
Switched to branch 'master'
git commit --allow-empty -m "Initial commit"

Now bloom-release is failing with the message:

Bloom requires a version 4 or greater rosdistro index to support package format 3.
<== Error running command '['/usr/bin/git-bloom-generate', '-y', 'rosdebian', '--prefix', 'release/humble', 'humble', '-i', '1', '--os-name', 'ubuntu']'
Release failed, exiting.

Regardless I will mark this answer as correct since it pointed to the solution, and the error now is a different one. I will post a new question regarding the new error message. Thanks you @gvdhoorn !

Comment by gvdhoorn on 2022-12-08:
From the git output:

[main (root-commit) 8b1bd57] Initial commit

you can see that main is actually the branch that was created/is the default.

That's why I added the comment:

# or whatever you have as default branch

I would expect a git push origin main to have worked. Bloom would most likely have complained there was no master branch, but would then have created it.

Explicitly creating a master branch and then pushing it obviously also works.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.