-
Notifications
You must be signed in to change notification settings - Fork 73
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
automatically update vendored dependencies #7
Comments
Yes I think that sounds valuable. It would be great if there was also a wrapper script that can update and create prs across all the branches |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
add approvers for hostpath csi driver
Quick-and-dirty script that I just used to update csi-relase-tools:
|
/lifecycle frozen |
In kubernetes-csi/csi-driver-smb#28 we were discussing how to use squashing instead of including the commits as done so far. We came up with a revised script, too. However, when I just tried to do the Go 1.15 update (see PR #97) I found that importing fails if (and only if) /cc @animeshk08
|
Thanks for putting up this script! I am able to run the script #7 (comment) with some small changes. One thing people need to notice is that it depends on how their local git remote setup is. My remote setup is One thing to investigate is the squash thing mentioned #7 (comment). |
Also to copy my revised script here for anyone who is also using #!/bin/sh -x
die () {
echo >&2 "\nERROR: $@\n"
exit 1
}
while read repo branches; do
if [ "$repo" != "#" ]; then
(
cd $repo || die "$repo: does not exit"
git fetch upstream || die "$repo: fetch upstream"
git fetch origin || die "$repo: git fetch"
for i in $branches; do
git checkout $i
git merge upstream/$i
git checkout -B prow-update-$i origin/$i || die "$repo:$i checkout"
git subtree pull --prefix=release-tools -m "release-tools: update" https://github.com/kubernetes-csi/csi-release-tools.git master || die "$repo:$i update release tools"
changes=$(git log --no-merges --oneline origin/$i..prow-update-$i)
if [ "$changes" ]; then
release-tools/update-vendor.sh || die "update vendor"
git add vendor
git commit --amend -F - <<EOF
release-tools: update
Commit summary:
$changes
EOF
make test || die "$repo:$i make test"
git push origin prow-update-$i || die "origin:prow-update-$i push failed - probably there is already an unmerged branch and pending PR"
hub pull-request -F - -b kubernetes-csi/$repo:$i -h Jiawei0227/$repo:prow-update-$i <<EOF
$i: update release-tools
Commit summary:
$changes
\`\`\`release-note
NONE
\`\`\`
EOF
if [ "$?" -ne 0 ]; then
die "$repo:$i pull-request"
fi
fi
done
) || die "failed"
fi
done <<EOF
external-resizer release-1.0
external-provisioner release-2.0
external-attacher release-3.0
external-snapshotter release-3.0
EOF |
It may be nice to actually check in the script to the repo. We can probably sub out some of the hardcoded values with variables? |
It looks like having the "Merge pull request" messages from importing all the individual commits from csi-release-tools is messing up the release-notes generation tool. See https://github.com/kubernetes-csi/external-resizer/pull/112/files#r501164729, where wrong PRs were picked up. I believe what's happening is the release-notes tool is seeing "Merge pull request #98" from the release-tools update commit, and then going to PR 98 in the sidecar repo and sees that there's a release note for it. So this is another reason why we should move towards the commit squashing model. |
Here's a version of the update script which uses WARNING: "origin" in "git fetch origin" below must reference the upstream repository under github.com/kubernetes-csi.
|
I created PRs using this script, for example: One downside (at least initially?) is that the list of commits includes everything. This might be because "git subtree" was unable to identify what was already there, which might also explain the merge conflict. Perhaps it'll work better after we switched. The squash commit contains some annotations which may help with that. |
Here is the wrapper script I used to generate PRs for 1.26 sidecar release:
|
remove non-go code from vendor
In our various Kubernetes-CSI repos we should regularly update dependencies to ensure that we have included all upstream bug fixes.
This includes:
dep ensure -update
git subtree pull
forrelease-tools
(see https://github.com/kubernetes-csi/csi-release-tools/blob/master/README.md#sharing-and-updating)Then once the PR is pending, CI testing will cover the initial round of testing. Even if that fails, having a PR pending is a reminder to the maintainer that the component is not up-to-date.
The steps above could be automated with a script, like
update-dependencies.sh
in this repo. Thehub
tool might be useful for managing the PRs. Bonus points for making it possible to update release branches.Running this script for one or more component is probably best done by the same person at a regular cadence. If multiple people do it, we end up with multiple competing PRs. We could also try to move it into a Prow job, but that would be a second step.
@msau42 does that sound useful?
The text was updated successfully, but these errors were encountered: