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

Fix matching for duplicated Specs #5683

Merged
merged 3 commits into from Apr 10, 2018

Conversation

Projects
None yet
2 participants
@stuhood
Copy link
Member

stuhood commented Apr 9, 2018

Problem

If a Specs object contains multiple Spec objects matching a single address, the second instance will fail to match. This is easy to do by just listing the same Spec twice (and which can be defended against by deduping), but it's also possible to hit by matching both SingleAddress('a', 'a') and DescendantAddresses('') in the same call.

Solution

I encountered this bug while testing #5672, and fixed it there. This PR reverts that fix and reapplies it (in order to make it cherry-pickable), and adds a test to cover it.

@stuhood stuhood requested review from baroquebobcat and kwlzn Apr 9, 2018

@stuhood stuhood changed the title Stuhood/address matching fix Fix matching for duplicated Specs Apr 9, 2018

@stuhood stuhood force-pushed the twitter:stuhood/address-matching-fix branch from 2193639 to 264a0ab Apr 9, 2018

@stuhood

This comment has been minimized.

Copy link
Member

stuhood commented Apr 9, 2018

The plan is to land this one via Rebase and merge, which will allow the middle commit to be cherry-picked to 1.6.x.

@stuhood stuhood added this to the 1.6.x milestone Apr 9, 2018

@kwlzn

kwlzn approved these changes Apr 9, 2018

Copy link
Member

kwlzn left a comment

thanks!

@stuhood stuhood merged commit 52845ba into pantsbuild:master Apr 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:stuhood/address-matching-fix branch Apr 10, 2018

stuhood added a commit that referenced this pull request Apr 10, 2018

stuhood added a commit to twitter/pants that referenced this pull request Apr 10, 2018

wisechengyi added a commit that referenced this pull request Apr 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment