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

Add json report to fetch and local exclusion option #692

Merged
merged 132 commits into from Dec 26, 2017

Conversation

Projects
None yet
2 participants
@wisechengyi
Collaborator

wisechengyi commented Nov 10, 2017

This patch introduces changes for cli with json output #659. Format as follows:

{
  "conflict_resolution": {
    "org:name:version" (requested): "org:name:version" (reconciled) 
  },
  "dependencies": [
    {
      "coord": "orgA:nameA:versionA",
      "files": [
        [
          <classifier>,
          <path>
        ]
      ],
      "dependencies": [ // coodinates for its transitive dependencies
        <orgX:nameX:versionX>,
        <orgY:nameY:versionY>,
      ]
    },
    {
      "coord": "orgB:nameB:versionB",
      "files": [
        [
          <classifier>,
          <path>
        ]
      ],
      "dependencies": [ // coodinates for its transitive dependencies
        <orgX:nameX:versionX>,
        <orgZ:nameZ:versionZ>,
      ]
    },
  ]
}

For example:

fetch -t org.apache.avro:trevni-avro:1.8.2  org.slf4j:slf4j-api:1.7.6 --json-output-file x.out
  Result:
├─ org.apache.avro:trevni-avro:1.8.2
│  ├─ org.apache.avro:trevni-core:1.8.2
│  │  ├─ org.apache.commons:commons-compress:1.8.1
│  │  ├─ org.slf4j:slf4j-api:1.7.7
│  │  └─ org.xerial.snappy:snappy-java:1.1.1.3
│  └─ org.slf4j:slf4j-api:1.7.7
└─ org.slf4j:slf4j-api:1.7.6 -> 1.7.7

would produce the following json file:

$ jq < x.out 
{
  "conflict_resolution": {
    "org.slf4j:slf4j-api:1.7.6": "org.slf4j:slf4j-api:1.7.7"
  },
  "dependencies": [
    {
      "coord": "org.apache.avro:trevni-core:1.8.2",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/avro/trevni-core/1.8.2/trevni-core-1.8.2.jar"
        ]
      ],
      "dependencies": [
        "org.slf4j:slf4j-api:1.7.7",
        "org.xerial.snappy:snappy-java:1.1.1.3",
        "org.apache.commons:commons-compress:1.8.1"
      ]
    },
    {
      "coord": "org.apache.avro:trevni-avro:1.8.2",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/avro/trevni-avro/1.8.2/trevni-avro-1.8.2.jar"
        ]
      ],
      "dependencies": [
        "org.apache.avro:trevni-core:1.8.2",
        "org.slf4j:slf4j-api:1.7.7",
        "org.xerial.snappy:snappy-java:1.1.1.3",
        "org.apache.commons:commons-compress:1.8.1"
      ]
    },
    {
      "coord": "org.slf4j:slf4j-api:1.7.7",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar"
        ]
      ],
      "dependencies": []
    },
    {
      "coord": "org.apache.commons:commons-compress:1.8.1",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar"
        ]
      ],
      "dependencies": []
    },
    {
      "coord": "org.xerial.snappy:snappy-java:1.1.1.3",
      "files": [
        [
          "",
          "/Users/yic/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.1.3/snappy-java-1.1.1.3.jar"
        ]
      ],
      "dependencies": []
    }
  ]
}

@wisechengyi wisechengyi changed the title from Add json report to fetch and soft exclusion option to Add json report to fetch and local exclusion option Dec 19, 2017

@wisechengyi

This comment has been minimized.

Show comment
Hide comment
@wisechengyi

wisechengyi Dec 19, 2017

Collaborator

Hi @alexarchambault, this PR is ready for review. It is unclear why the last commits did not trigger travis, but I have it passed on my fork's travis. https://travis-ci.org/wisechengyi/coursier/builds/318498357

Collaborator

wisechengyi commented Dec 19, 2017

Hi @alexarchambault, this PR is ready for review. It is unclear why the last commits did not trigger travis, but I have it passed on my fork's travis. https://travis-ci.org/wisechengyi/coursier/builds/318498357

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -ev
set -evx

This comment has been minimized.

@wisechengyi

wisechengyi Dec 19, 2017

Collaborator

so CI will show the command run in case of any error.

@wisechengyi

wisechengyi Dec 19, 2017

Collaborator

so CI will show the command run in case of any error.

@@ -7,7 +7,7 @@ import caseapp._
import scala.language.reflectiveCalls
final case class Fetch(
case class Fetch(

This comment has been minimized.

@wisechengyi

wisechengyi Dec 19, 2017

Collaborator

removed 'final' so I can create an instance of it in test. please advise if there's a better way.

@wisechengyi

wisechengyi Dec 19, 2017

Collaborator

removed 'final' so I can create an instance of it in test. please advise if there's a better way.

This comment has been minimized.

@alexarchambault

alexarchambault Dec 26, 2017

Member

The way case-app 1.1.x uses the body of case classes for actual code makes it hard to do otherwise, yep. Switching to case-app 1.2.x should allow not to have to do that (when it'll be used in the cli module…).

@alexarchambault

alexarchambault Dec 26, 2017

Member

The way case-app 1.1.x uses the body of case classes for actual code makes it hard to do otherwise, yep. Switching to case-app 1.2.x should allow not to have to do that (when it'll be used in the cli module…).

@alexarchambault

This comment has been minimized.

Show comment
Hide comment
@alexarchambault

alexarchambault Dec 20, 2017

Member

Can't review right now, but I should find time for it today or tomorrow.

Member

alexarchambault commented Dec 20, 2017

Can't review right now, but I should find time for it today or tomorrow.

@wisechengyi

This comment has been minimized.

Show comment
Hide comment
@wisechengyi

wisechengyi Dec 22, 2017

Collaborator

np. happy holidays!

Collaborator

wisechengyi commented Dec 22, 2017

np. happy holidays!

@alexarchambault

I'm pushing a few commits on top of that to use argonaut instead of jackson in particular (argonaut was already around, so that's one dependency less).

@@ -7,7 +7,7 @@ import caseapp._
import scala.language.reflectiveCalls
final case class Fetch(
case class Fetch(

This comment has been minimized.

@alexarchambault

alexarchambault Dec 26, 2017

Member

The way case-app 1.1.x uses the body of case classes for actual code makes it hard to do otherwise, yep. Switching to case-app 1.2.x should allow not to have to do that (when it'll be used in the cli module…).

@alexarchambault

alexarchambault Dec 26, 2017

Member

The way case-app 1.1.x uses the body of case classes for actual code makes it hard to do otherwise, yep. Switching to case-app 1.2.x should allow not to have to do that (when it'll be used in the cli module…).

Show outdated Hide outdated .travis.yml
@wisechengyi

This comment has been minimized.

Show comment
Hide comment
@wisechengyi

wisechengyi Dec 26, 2017

Collaborator

Thanks so much @alexarchambault! Looks like argonaut is quite easy to use as well :)

I am going to merge it momentarily.

Collaborator

wisechengyi commented Dec 26, 2017

Thanks so much @alexarchambault! Looks like argonaut is quite easy to use as well :)

I am going to merge it momentarily.

@wisechengyi

This comment has been minimized.

Show comment
Hide comment
@wisechengyi

wisechengyi Dec 26, 2017

Collaborator

I'm not sure I can disable that via the UI if Travis (I can't find the option in it).

Building master and PR means off for "Build branch updates" and on for "Build pull request updates".

Currently the way it is setup is fine, but say I want to iterate the changes on https://travis-ci.org/wisechengyi/coursier/ instead of using the ci resources on https://travis-ci.org/coursier/coursier/, then I'd have to remove the master only line in .travis.yml.

I left .travis.yml unchanged, so this is just for future reference. It is more useful when the # of contributors increase and the ci resources are still limited, so everyone can iterate on their own fork instead of waiting for the queue on coursier/coursier until their PR is ready.

Collaborator

wisechengyi commented Dec 26, 2017

I'm not sure I can disable that via the UI if Travis (I can't find the option in it).

Building master and PR means off for "Build branch updates" and on for "Build pull request updates".

Currently the way it is setup is fine, but say I want to iterate the changes on https://travis-ci.org/wisechengyi/coursier/ instead of using the ci resources on https://travis-ci.org/coursier/coursier/, then I'd have to remove the master only line in .travis.yml.

I left .travis.yml unchanged, so this is just for future reference. It is more useful when the # of contributors increase and the ci resources are still limited, so everyone can iterate on their own fork instead of waiting for the queue on coursier/coursier until their PR is ready.

@wisechengyi wisechengyi merged commit a4258f4 into coursier:master Dec 26, 2017

2 checks passed

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

@wisechengyi wisechengyi deleted the wisechengyi:659 branch Dec 29, 2017

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