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

Incorporate SolveMeta into LockDiff #623

Closed
carolynvs opened this issue May 22, 2017 · 4 comments
Closed

Incorporate SolveMeta into LockDiff #623

carolynvs opened this issue May 22, 2017 · 4 comments

Comments

@carolynvs
Copy link
Collaborator

carolynvs commented May 22, 2017

Currently LockDiff only compares the memo. but now that #584 has added new metadata fields, the LockDiff should be updated to include them as well. Also we should print "Inputs Digest" instead of "Memo" now that the field has been renamed.

For example:

Old Gopkg.lock

[solve-meta]
  analyzer-name = "dep"
  analyzer-version = 1
  inputs-digest = "abc123"
  solver-name = "gps-cdcl"
  solver-version = 1

New Gopkg.lock

[solve-meta]
  analyzer-name = "dep+imports"
  analyzer-version = 4
  inputs-digest = "def456"
  solver-name = "gps-cdcl"
  solver-version = 2

Running dep ensure -n would print:

Would have written the following changes to Gopkg.lock:
Analyzer Name: dep -> dep imports
Analyzer Version: 1 -> 4
Solver Version: 1 -> 2
Inputs Digest: abc123 -> def456
@mikijov
Copy link
Contributor

mikijov commented May 31, 2017

Hi. I will take a stab at this.

@mikijov
Copy link
Contributor

mikijov commented May 31, 2017

Hi @carolynvs. I took a look around the code and I think I understand what is being asked. It's not as simple as adding serialization. The biggest work is around gps.Lock interface having no idea about the new SolveMeta data which is in root namespace. I will probably refactor SolveMeta or an interface resembling it into gps, and then I would have to add at least getter for it into gps.Lock. Before I start on this not so trivial refactoring, I would like little guidance from you, @sdboyer or someone else on the project if I am on the right track.

@carolynvs
Copy link
Collaborator Author

@mikijov Sorry, I didn't realize that SolveMeta isn't in gps and shouldn't have flagged this as a good first PR... 😞

I'll let @sdboyer say if he'd like this refactored.

@sdboyer
Copy link
Member

sdboyer commented Jun 2, 2017

Yeah, this'd be a little more involved, as SolveMeta is a layer that dep adds itself. gps is aware of all the constituent parts, but they aren't consolidated in a way where it'd be easy to produce the diff.

Hmm...I think, maybe, we should actually go the opposite direction, and drop the input hash from the diff, so that we're ignoring all the solve meta. That's information people can see in a git diff, but it's not really actionable information in the way that actual project changes are.

mikijov added a commit to mikijov/dep that referenced this issue Jun 24, 2017
LockDiff now uses only project dependencies to identify changes,
thus ignoring any changes to the SolveMeta iformation. If required
changes in the SolveMeta can still be seen using source diffs.
Modified and added tests to check new behaviour.
mikijov added a commit to mikijov/dep that referenced this issue Jun 29, 2017
LockDiff now uses only project dependencies to identify changes,
thus ignoring any changes to the SolveMeta iformation. If required
changes in the SolveMeta can still be seen using source diffs.
Modified and added tests to check new behaviour.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants