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

Brew CI: try checking out matching branches #575

Merged
merged 4 commits into from
Dec 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions jenkins-scripts/lib/project-default-devel-homebrew-amd64.bash
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ echo '# BEGIN SECTION: setup the osrf/simulation tap'
brew tap osrf/simulation
echo '# END SECTION'

if [[ -n "${PULL_REQUEST_URL}" ]]; then
echo "# BEGIN SECTION: pulling ${PULL_REQUEST_URL}"
brew pull ${PULL_REQUEST_URL}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brew pull command has been deprecated

So there's no use for PULL_REQUEST_URL anymore? Should it be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not used in this job, but I think it is used in a downstream job that updates the bottle hash sha256 values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed that it is still in use in the downstream job

If I read correctly the DSL code:

  parameters { 
        currentBuild() 
          predefinedProp("PULL_REQUEST_URL", "https://github.com/osrf/homebrew-simulation/pull/\${ghprbPullId}") 
}

Looks to me like we are overriding PULL_REQUEST_URL value to the base URL + ghprbPullId instead of using the current one in this script (injected by currentBuild().

If we remove PULL_REQUEST_URL from here, is there anyway of launching the job manually? Can that be done without these changes? Maybe is not a supported use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, maybe some of this logic is left over from when release.py could trigger a bottle build and would pass PULL_REQUEST_URL. Now we only start bottle builds from GitHub comments. I'll see if there's something that should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove PULL_REQUEST_URL from here, is there anyway of launching the job manually? Can that be done without these changes? Maybe is not a supported use case.

it's not easy to start the "bottle hash updater job" manually since it needs artifacts from a bottle build

I looked and I don't think there's anything more to be changed

if [[ -n "${ghprbSourceBranch}" ]] && \
[[ "${ghprbSourceBranch}" =~ ci_matching_branch\/ ]]
then
echo "# BEGIN SECTION: trying to checkout branch ${ghprbSourceBranch} from osrf/simulation"
pushd $(brew --repo osrf/simulation)
git fetch origin ${ghprbSourceBranch} || true
git checkout ${ghprbSourceBranch} || true
popd
echo '# END SECTION'
fi

Expand Down