-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support to create PR against ROS gz_*_vendor repositories in release.py #1151
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ced8c08
WIP: methods to run gh create issue
j-rivero b68bd35
Fully working version
j-rivero db11527
Missing helper file
j-rivero 67f4a2b
Improve the error reporting on gh
j-rivero 3236d73
Implement a basic testing
j-rivero 8ed2830
Cleanup
j-rivero fda1471
Merge branch 'master' into jrivero/vendor_gh_issue
j-rivero 0087404
WIP: create PR for vendor_repositories
j-rivero a777cd6
Implement the PR creation
j-rivero 6132758
Merge remote-tracking branch 'origin' into jrivero/vendor_gh_pr
j-rivero 6610c74
Remove debug
j-rivero 641899b
Dealing with error code coming from get_collections_from_package_and_…
j-rivero 80475de
Implement venv creation for vendor
j-rivero 8234443
Implement then --only-bump-ros-vendor-package option
j-rivero ed6ace7
Merge remote-tracking branch 'origin/master' into jrivero/vendor_gh_pr
azeey f049c45
Add ionic->rolling, harmonic->jazzy
azeey 807070d
Ignore dry-run when updating vendor package. Otherwise, the dry-run w…
azeey 1a84b58
Do not need to make argparse explicit
j-rivero c2da471
Update all files after running the create_vendor_package script
j-rivero 6c1e3c0
Fix test suite by injecting testing data
j-rivero 4180170
Use ssh protocol when cloning
j-rivero 24d6a83
Avoid to release metapackages
j-rivero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
#!/bin/bash -e | ||
|
||
test_dir=$(mktemp -d) | ||
mkdir -p ${test_dir}/{focal,jammy,ubuntu}/debian | ||
export _RELEASEPY_TEST_RELEASE_REPO=${test_dir} | ||
export _RELEASEPY_DEBUG=1 | ||
test_dir=$(mktemp -d) | ||
export _RELEASEPY_TEST_RELEASE_REPO="${test_dir}/test-release" | ||
mkdir -p ${_RELEASEPY_TEST_RELEASE_REPO}/{focal,jammy,ubuntu}/debian | ||
export _RELEASEPY_TEST_SOURCE_REPO="${test_dir}/src" | ||
mkdir -p ${_RELEASEPY_TEST_SOURCE_REPO} | ||
# Fake packages.xml to make the vendor package script happy | ||
cat > "${_RELEASEPY_TEST_SOURCE_REPO}/package.xml" <<-EOF | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>gz-foo</name> | ||
<version>0.0.0</version> | ||
<description>test</description> | ||
<maintainer email="[email protected]">Testing maintainer</maintainer> | ||
<license>Foo License</license> | ||
</package> | ||
EOF | ||
|
||
exec_releasepy_test() | ||
{ | ||
|
@@ -12,7 +25,7 @@ exec_releasepy_test() | |
./release.py \ | ||
--dry-run \ | ||
--no-sanity-checks \ | ||
gz-foo 1.2.3 token ${test_params}"" | ||
gz-foo 1.2.3 token ${test_params} | ||
} | ||
|
||
exec_ignition_releasepy_test() | ||
|
@@ -22,7 +35,7 @@ exec_ignition_releasepy_test() | |
./release.py \ | ||
--dry-run \ | ||
--no-sanity-checks \ | ||
ign-foo 1.2.3 token ${test_params}"" | ||
ign-foo 1.2.3 token ${test_params} | ||
} | ||
|
||
exec_ignition_gazebo_releasepy_test() | ||
|
@@ -32,7 +45,18 @@ exec_ignition_gazebo_releasepy_test() | |
./release.py \ | ||
--dry-run \ | ||
--no-sanity-checks \ | ||
ign-gazebo 1.2.3 token ${test_params}"" | ||
ign-gazebo 1.2.3 token ${test_params} | ||
} | ||
|
||
exec_releasepy_with_real_gz() | ||
{ | ||
gz_pkg=${1} major_version=${2} | ||
./release.py \ | ||
--dry-run \ | ||
--no-sanity-checks \ | ||
--source-repo-uri http://github.com/gazebosim/gz-common \ | ||
--source-repo-existing-ref http://github.com/gazebosim/gz-common/foo-tag \ | ||
"${gz_pkg}" "${major_version}.x.y" token | ||
} | ||
|
||
expect_job_run() | ||
|
@@ -73,35 +97,58 @@ expect_param() | |
echo "${param} not found in test output" | ||
exit 1 | ||
fi | ||
} | ||
|
||
expect_vendor_repo() | ||
{ | ||
output="${1}" repo="${2}" | ||
|
||
if ! grep -q "Github ${repo}" <<< "${output}"; then | ||
echo "${repo} not found in test output" | ||
exit 1 | ||
fi | ||
} | ||
|
||
expect_no_vendor() | ||
{ | ||
output="${1}" | ||
|
||
if grep -q 'in ROS 2' <<< "${output}"; then | ||
echo "ROS 2 string found in output" | ||
exit 1 | ||
fi | ||
} | ||
|
||
source_repo_uri_test=$(exec_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git") | ||
expect_job_run "${source_repo_uri_test}" "gz-foo-source" | ||
expect_job_not_run "${source_repo_uri_test}" "gz-foo-debbuilder" | ||
expect_number_of_jobs "${source_repo_uri_test}" "1" | ||
expect_param "${source_repo_uri_test}" "SOURCE_REPO_URI=https%3A%2F%2Fgithub.com%2Fgazebosim%2Fgz-foo.git" | ||
expect_no_vendor "${source_repo_uri_test}" # non existing package | ||
|
||
source_tarball_uri_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz") | ||
expect_job_run "${source_tarball_uri_test}" "gz-foo-debbuilder" | ||
expect_job_run "${source_tarball_uri_test}" "generic-release-homebrew_pull_request_updater" | ||
expect_job_not_run "${source_tarball_uri_test}" "gz-foo-source" | ||
expect_number_of_jobs "${source_tarball_uri_test}" "7" | ||
expect_param "${source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fgz-foo-1.2.3.tar.gz" | ||
expect_no_vendor "${source_tarball_uri_test}" | ||
|
||
nightly_test=$(exec_releasepy_test "--nightly-src-branch my-nightly-branch3 --upload-to-repo nightly") | ||
expect_job_run "${nightly_test}" "gz-foo-debbuilder" | ||
expect_job_not_run "${nightly_test}" "generic-release-homebrew_pull_request_updater" | ||
expect_job_not_run "${nightly_test}" "gz-foo-source" | ||
expect_number_of_jobs "${nightly_test}" "2" | ||
expect_param "${nightly_test}" "SOURCE_TARBALL_URI=my-nightly-branch3" | ||
expect_no_vendor "${nightly_test}" | ||
|
||
bump_linux_test=$(exec_releasepy_test "--source-tarball-uri https://gazebosim/gz-foo-1.2.3.tar.gz --only-bump-revision-linux -r 2") | ||
expect_job_run "${bump_linux_test}" "gz-foo-debbuilder" | ||
expect_job_not_run "${bump_linux_test}" "generic-release-homebrew_pull_request_updater" | ||
expect_job_not_run "${bump_linux_test}" "gz-foo-source" | ||
expect_number_of_jobs "${bump_linux_test}" "6" | ||
expect_param "${bump_linux_test}" "RELEASE_VERSION=2" | ||
expect_no_vendor "${bump_linux_test}" | ||
|
||
ignition_test=$(exec_ignition_releasepy_test "--source-repo-uri https://github.com/gazebosim/gz-foo.git") | ||
expect_job_run "${ignition_test}" "gz-foo-source" | ||
|
@@ -128,3 +175,9 @@ expect_number_of_jobs "${ign_gazebo_source_tarball_uri_test}" "7" | |
expect_param "${ign_gazebo_source_tarball_uri_test}" "SOURCE_TARBALL_URI=https%3A%2F%2Fgazebosim%2Fign-gazebo-1.2.3.tar.gz" | ||
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE=ign-gazebo" | ||
expect_param "${ign_gazebo_source_tarball_uri_test}" "PACKAGE_ALIAS=ignition-gazebo" | ||
|
||
ros_vendor_test=$(exec_releasepy_with_real_gz gz-fuel-tools 9) | ||
expect_vendor_repo "${ros_vendor_test}" gazebo-release/gz_fuel_tools_vendor | ||
|
||
ros_vendor_test=$(exec_releasepy_with_real_gz gz-cmake 2) | ||
expect_no_vendor "${ros_vendor_test}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to use
--force
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, this --force was added to handle the overwrite of previous existing branches (
branch_name = f'releasepy/{args.version}'
) created by the tool in previous runs without the need of removing the branch to make the tool to work. This is useful to correct erroneous/incomplete PRs created by the own tool but if we can stabilize the code could be removed. Whatever you prefer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Let's keep for now then. Maybe add a TODO to remove it later?