Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

LockDiff not returning expected Deltas when LockedProject on the RHS is empty #1971

Closed
tariq1890 opened this issue Jul 29, 2018 · 2 comments
Closed

Comments

@tariq1890
Copy link
Contributor

What version of dep are you using (dep version)?

dep 0.5.0

What dep command did you run?

N/A

I added the following test case for the DiffLocks method (see lockdiff.go:67) in TestLockDelta(see lockdiff_test.go:59)

		"remove all projects and imports" : {
			lt: dup.rmII("baz.com/qux").rmII("foo.com/bar").rmProject("baz.com/qux").rmProject("foo.com/bar").rmProject("transitive.com/dependency"),

What did you expect to see?

I expect the following deltas to be populated in the resultant lockDiff

delta: InputImportsChanged | ProjectRemoved,

What did you see instead?

delta: InputImportsChanged

@sdboyer @carolynvs This seems to happen because the project list of RHS LockedProject is required to be non-empty if the ProjectRemoved delta is to be added as a delta.

Is this expected? If not, I can add a PR that handles the case of empty projects in the RHS.

@sdboyer
Copy link
Member

sdboyer commented Jul 29, 2018

This absolutely sounds like the sort of edge case I may have missed.

it's not clear to me what real circumstance should result in empty projects on the rhs, but it should be covered anyway.

It could also explain the one bug that'd been reported against the diffing system, originally as a panic.

@tariq1890
Copy link
Contributor Author

tariq1890 commented Jul 29, 2018

Thanks for your response. I was waiting for an acknowledgement on this from you guys before I'd attempt a PR. Is my expectation of the delta dimensions correct ?

Could you also send me the details of that bug? That would serve as useful reference.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants