Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into jrivero/dsl_gz_source_jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rivero committed Oct 3, 2023
2 parents cf5af71 + cf72fde commit f3472a7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
30 changes: 18 additions & 12 deletions bloom/ros_gz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ version the version of `ros_gz` released will be the latest one existing in the
official `gbp -release repository`. The version would be the same but the
release number will start on 1000.


## 2. Initial setup

To release a modified version of `ros_gz` which supports a different major
Expand All @@ -53,31 +52,25 @@ version of gazebo, before running bloom some actions need to be taken:

For a new official wrappers the notation used below correspond to `ros_ign-release`:

1. Fork (manually or using gh) current gbp repository:
1. Fork (or create a new repo with all the tags and branches) the current gbp repository:
https://github.com/ros2-gbp/ros_ign-release

Note: the same -release repository can obviously hosts multiple ROS 2 releases but
can not have multipe Gazebo releases since the bloom templates are set to just one
package name.

On the fork, the `rename-ros_gz-pkgs.bash` script will change the bloom templates to modify package names and inject the `GZ_VERSION` needed:

1. Clone the new repo, go to the directory and run rename-gazebo-ros-pkgs.bash
- Usage: `$ rename-ros_gz-pkgs.bash <desired_gz_version> <space separted list of rosdistros to release>`
- Example: `$ rename-ros_gz-pkgs.bash garden humble`

The script supports to inject a custom RELEASE_REPO_URL that points to a bloom gbp
repository different than https://github.com/gazebo-release/ros_ign-release.
If several unofficial wrappers using different Gazebo releases are going to exist for the same ROS 2 distribution (i.e: Garden and Harmonic for ROS 2 Iron), the rename script supports to declare a conflict using the `GZ_RELEASE_TO_CONFLICT` variable:

```
i.e use a https://github.com/gazebo-testing/ros_ign-gzharmonic-release as gbp testing repository
RELEASE_REPO_URL=https://github.com/gazebo-testing/ros_ign-gzharmonic-release \
./bloom_from_special_env.bash \
humble \
garden \
https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/replace_fortress_with_garden/00-replace-gz-fortress-with-garden.list
GZ_RELEASE_TO_CONFLICT=garden ./rename-ros_gz-pkgs.bash harmonic humble
```


### 2.2 Create a custom track in tracks.yml

Copy the existing ROS 2 yaml track information and rename it to `${ros2}_gz${version}`.
Expand Down Expand Up @@ -126,6 +119,19 @@ and invoke rocker with `--home` and `--user` flags to pass the credentials and
customatizations needed for the bloom call. It will run the `bloom-release` command
with the arguments required for the ros_gz wrappers.

The script supports to inject a custom RELEASE_REPO_URL that points to a bloom gbp
repository different than https://github.com/gazebo-release/ros_ign-release.

```
i.e use a https://github.com/gazebo-testing/ros_ign-gzharmonic-release as gbp testing repository
RELEASE_REPO_URL=https://github.com/gazebo-testing/ros_ign-gzharmonic-release \
./bloom_from_special_env.bash \
humble \
garden \
https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/replace_fortress_with_garden/00-replace-gz-fortress-with-garden.list
```

### 3.2 Launching jobs in the osrf buildfarm

The previous step generates the metadata needed to build the debians but there is
Expand Down
2 changes: 1 addition & 1 deletion bloom/ros_gz/_check_metadata.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TMP_DIR=$(mktemp -d)
git clone -q "${RELEASE_REPO_URL}" "${TMP_DIR}"
pushd "${TMP_DIR}" 2> /dev/null > /dev/null || exit
DEBIAN_LATEST_TAG=$(git for-each-ref --sort=creatordate --format '%(refname)' refs/tags | \
grep "debian/ros-${ROS_DISTRO}" | \
grep -v 'ros-ign-' | grep "debian/ros-${ROS_DISTRO}" \
tail -1 | sed 's:refs/tags/::')
git checkout -q "${DEBIAN_LATEST_TAG}"
if ! dpkg-parsechangelog -SSource 2> /dev/null | grep -q "gz${GAZEBO_DISTRO}"; then
Expand Down
14 changes: 11 additions & 3 deletions source-repo-scripts/source_changelog.bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/bash
# Generates a list of changes since the last tagged version.
# bash source_changelog.bash
#
# Optionally, the previous version can be provided
# bash source_changelog.bash <PREV_VER>

PREV_VER=$1
#
# E.g.
# bash source_changelog.bash 3.0.0

git fetch --tags

PREV_VER=${1:-$(git describe --tags --abbrev=0 | sed 's/.*_//')}
echo "Changes since $PREV_VER"

ORIGIN_URL=$(git remote get-url origin)
REPO=$(basename ${ORIGIN_URL%.git})

Expand All @@ -14,7 +22,7 @@ PREV_TAG=$(git tag | grep "_${PREV_VER}$")
# Compare current branch to PREV_TAG
BRANCH=$(git rev-parse --abbrev-ref HEAD)

COMMITS=$(git log ${BRANCH}...${PREV_TAG} --pretty=format:"%h")
COMMITS=$(git log ${BRANCH}...${PREV_TAG} --no-merges --pretty=format:"%h")

for COMMIT in $COMMITS
do
Expand Down

0 comments on commit f3472a7

Please sign in to comment.