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

Fixing an edge case in lockdiff where all the projects may be removed… #1972

Merged
merged 1 commit into from
Aug 4, 2018

Conversation

tariq1890
Copy link
Contributor

… from the lock file.

What does this do / why do we need it?

Fixes an edge case in the Diff locks case. Never hurts to be too cautious ¯_(ツ)_/¯

What should your reviewer look out for in this PR?

If the changes look okay. Please let me know , If I need to more test cases.

Do you need help or clarification on anything?

Which issue(s) does this PR fix?

#1971

Copy link
Member

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Your understanding is correct, and this is definitely a case that i missed. It doesn't seem like it could possibly be the cause behind #1945, but still, this covers an important case.

ProjectAdded: true,
// Edge case: If there are no lockedProjects on the RHS, they have most probably been removed from the lock file.
if len(p2) == 0 {
lpd.ProjectRemoved = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having to outdent everything under an else statement, let's just put a continue in here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I'll have to add diff.ProjectDeltas[pr1] = lpd just before the continue. I'll be duplicating it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdboyer I have updated the PR however. Let me know if the new changes are okay.

@tariq1890
Copy link
Contributor Author

@sdboyer I've modified the PR as per your review comment .

@sdboyer
Copy link
Member

sdboyer commented Aug 4, 2018

Great, thank you!

@sdboyer sdboyer merged commit 00830b6 into golang:master Aug 4, 2018
sdboyer added a commit that referenced this pull request Aug 4, 2018
This is a more generalized version of the fix from #1972.

By virtue of being more general, it also fixes #1945.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants