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

Perform a weaker subtree check in Travis #11394

Merged
merged 2 commits into from Nov 9, 2017

Conversation

sipa
Copy link
Member

@sipa sipa commented Sep 25, 2017

Apparently many of our subtrees get modified by PRs in this repository, without getting noticed.

To improve upon this:

  • Make git-subtree-check.sh capable of doing a weaker consistency check (that doesn't need access to external repositories), but which should be sufficient to detect unintended changes. It can be fooled by a fake subtree merge commit, but that would hopefully be obvious to reviewers.
  • Make Travis invoke this subtree check for each of our subtrees.

Note that Travis is currently expected to fail on this PR, as 2 out of 4 subtrees (src/secp156k1 and src/univalue have been modified directly in master).

@laanwj
Copy link
Member

laanwj commented Sep 25, 2017

Apparently many of our subtrees get modified by PRs in this repository, without getting noticed.

We try to catch these in review, but apparently some changes still sneaked through. Thanks for adding a travis check.

@meshcollider
Copy link
Contributor

With bitcoin-core/secp256k1#478 merged, the test should pass on secp256k1 now right?

@gmaxwell
Copy link
Contributor

@meshcollider No, this won't pass for secp256k1 until we do another subtree merge of secp256k1.

@theuni
Copy link
Member

theuni commented Sep 25, 2017

Travis uses a shallow clone with depth 50: https://travis-ci.org/bitcoin/bitcoin/jobs/279351451#L478

In reality, git stores not only 50 commits, but far enough back to grab parents of any of those 50, which may be pretty far back if they're merges (which all of ours should be).

So.. Travis will need some luck to find all of the previous subtree merge commits, though the odds are pretty good. If the last merge was quite a long time ago, though, I believe we'd fail to notice any non-subtree-merge changes.

As a belt-and-suspenders, maybe add a dumb non-merge-commit checker? something like testing:
git rev-list --count --no-merges -n1 $TRAVIS_COMMIT_RANGE -- src/secp256k1

@maflcko
Copy link
Member

maflcko commented Sep 27, 2017

Concept ACK. To err on the safe side, you could amend the yaml:

git:
  depth: 99999

@maflcko
Copy link
Member

maflcko commented Sep 29, 2017

utACK 9c99247446911a26616d384c9f8fef720c123ad7

We have several pieces of information about subtrees:
1) What their current directory contents is
2) What their directory contents was at the time of the last subtree merge
3) What the directory contents of the upstream project is in the commit referred to by the subtree merge.

Normally, all 3 should be identical. git-subtree-check.sh so far only compared (1) with (3) however.

Fix this by comparing all three, and give some more useful diff output in the case of mismatch.

The added benefit is that (1) and (2) can be compared without needing to see the upstream repository.
@sipa
Copy link
Member Author

sipa commented Oct 11, 2017

Rebased after merge of #11420 and #11421; passes cleanly now.

@theuni Unsure if we should make it fetch that much back - I assume that would come with some unnecessary performance load?

Giving a good error message to detect this case would be useful though.

@maflcko
Copy link
Member

maflcko commented Nov 4, 2017 via email

@maflcko
Copy link
Member

maflcko commented Nov 9, 2017

re-utACK 487aff4

maflcko pushed a commit that referenced this pull request Nov 9, 2017
fa0025d Revert "Remove unused variable in shell script" (MarcoFalke)

Pull request description:

  This partially reverts commit ab8e8b9 (#10771), as the variable is still used. See for example #11394.

Tree-SHA512: 1788d5471e1399d4a15d287cd8c41979833524e31b8fe61af8a7d20c9777828460d61ab87885a228ba7ca919f1d08703f4cb182d5840eb863e2154b3cf8ff4e6
@maflcko maflcko merged commit 487aff4 into bitcoin:master Nov 9, 2017
maflcko pushed a commit that referenced this pull request Nov 9, 2017
487aff4 Check subtree consistency in Travis (Pieter Wuille)
e1d0cc2 Improve git-subtree-check.sh (Pieter Wuille)

Pull request description:

  Apparently many of our subtrees get modified by PRs in this repository, without getting noticed.

  To improve upon this:
  * Make git-subtree-check.sh capable of doing a weaker consistency check (that doesn't need access to external repositories), but which should be sufficient to detect unintended changes. It can be fooled by a fake subtree merge commit, but that would hopefully be obvious to reviewers.
  * Make Travis invoke this subtree check for each of our subtrees.

  Note that Travis is currently expected to fail on this PR, as 2 out of 4 subtrees (`src/secp156k1` and `src/univalue` have been modified directly in master).

Tree-SHA512: 465b680392d3daf38a8c1dda77d6f74b1d1c23324c378774777fb95aa673e119a8f7e3ccc124e41d97b5ac8975f3d79f3015797d2d309666582394364917ec4e
@str4d str4d mentioned this pull request Nov 9, 2020
zkbot added a commit to zcash/zcash that referenced this pull request Nov 10, 2020
Lint fixes

Fixes most lints currently reported by `test/lint/lint-all.sh`.

Includes changes cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8700
- bitcoin/bitcoin#8840
- bitcoin/bitcoin#9867
  - We backported the second commit in #3146
- bitcoin/bitcoin#10771
- bitcoin/bitcoin#11394
- bitcoin/bitcoin#11649
- bitcoin/bitcoin#17329
- bitcoin/bitcoin#19258
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants