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

verify-subtree.sh: relax check and ignore old content #8

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Mar 6, 2019

If for whatever reasons a repo already had a release-tools directory
before doing a clean import of it with git subtree, the check used
to fail because it found those old commits.

This can be fixed by telling git log to stop when the directory
disappears from the repo. There has to be a commit with removes the
old content, because otherwise git subtree add doesn't work.

Fixes: kubernetes-csi/external-resizer#21

If for whatever reasons a repo already had a `release-tools` directory
before doing a clean import of it with `git subtree`, the check used
to fail because it found those old commits.

This can be fixed by telling `git log` to stop when the directory
disappears from the repo. There has to be a commit with removes the
old content, because otherwise `git subtree add` doesn't work.

Fixes: kubernetes-csi/external-resizer#21
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 6, 2019
@k8s-ci-robot k8s-ci-robot requested review from msau42 and saad-ali March 6, 2019 16:27
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 6, 2019
@msau42
Copy link
Collaborator

msau42 commented Mar 6, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2019
@k8s-ci-robot k8s-ci-robot merged commit 849db0a into kubernetes-csi:master Mar 6, 2019
@gnufied
Copy link
Contributor

gnufied commented Mar 6, 2019

@pohly can you address comments here:

I have been thinking some more about it. Does it make sense to use a content based diff for verifying subtree changes rather than git log based one? Something like:

git remote add csi-release-tools_root https://github.com/kubernetes-csi/csi-release-tools.git
git fetch csi-release-tools_root
git diff remotes/csi-release-tools_root/master HEAD:release-tools/

It does mean all CSI repos must have latest version of release-tools.

@pohly
Copy link
Contributor Author

pohly commented Mar 7, 2019

It does mean all CSI repos must have latest version of release-tools.

Exactly, and that is the problem. Each time we update the csi-release-tools master, the PR checks in all repos using it will start failing. Same for all old branches which have to be on an older revision (for example, because master adds new source code checks that older release do not pass).

One could argue that this is intentional because it forces maintainers to drop everything they are doing and sync up with csi-release-tools. But I find that rather intrusive and for older branches it may not be right.

Instead, the git diff could be against the revision that was imported. But determining that can only be done my parsing the commit messages, and that is probably not easier than the current approach.

pohly pushed a commit to pohly/csi-release-tools that referenced this pull request Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

release-tools fails on verifying subtree changes
4 participants