Skip to content
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

JSON output for nextflow info #657

Closed
1 of 6 tasks
ewels opened this issue Apr 16, 2018 · 6 comments
Closed
1 of 6 tasks

JSON output for nextflow info #657

ewels opened this issue Apr 16, 2018 · 6 comments
Milestone

Comments

@ewels
Copy link
Member

ewels commented Apr 16, 2018

It would be great if nextflow list command showed some additional information about each pipeline that is in the nextflow cache.

Most useful info would be (in order of preference):

  • Name
  • Commit hash
  • Full remote name
  • Active git branch
  • Date of the last pull if possible? (eg. as here).
  • Path to cloned pipeline? (maybe not desirable to advertise this?)

I guess that if you go the full distance and print all of this it will be a bit much to show. Perhaps it could have a verbose mode? Or cli arguments for which fields to show?

@ewels
Copy link
Member Author

ewels commented Apr 16, 2018

Apologies, I should really RTFM before creating issues!

nextflow info does basically everything I want 👍

@ewels ewels closed this as completed Apr 16, 2018
@ewels
Copy link
Member Author

ewels commented Apr 16, 2018

Ok - I will modify this request a little then.. Please could we have an option for JSON output? 😁

@ewels ewels reopened this Apr 16, 2018
@ewels ewels changed the title Extra info with nextflow list JSON output for nextflow info Apr 16, 2018
@ewels
Copy link
Member Author

ewels commented Apr 16, 2018

Also, having all of this information with a single call to nextflow list would also be very nice :)

But these are both very minor requests really, so feel free to ignore and close if you would rather!

@pditommaso
Copy link
Member

I think it makes more sense to extend the list command adding a -o flag (output) to support both json and yaml format with the extra information you are proposing.

@pditommaso
Copy link
Member

Added -o json|ymal option, eg:

$ nextflow info hello -o yaml
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}
$ nextflow info nextflow-io/hello -o json 
{
    "projectName": "nextflow-io/hello",
    "repository": "https://github.com/nextflow-io/hello",
    "localPath": "https://github.com/nextflow-io/hello",
    "manifest": {
        "mainScript": "main.nf",
        "nextflowVersion": null,
        "author": null,
        "defaultBranch": "master",
        "description": null,
        "gitmodules": null,
        "homePage": null,
        "version": null
    },
    "revisions": {
        "current": "master",
        "master": "master",
        "branches": [
            {
                "name": "master",
                "commitId": "c9b0ec72860c378a214402225fcec2e8bbf23878"
            },
            {
                "name": "mybranch",
                "commitId": "1c3e9e7404127514d69369cd87f8036830f5cf64"
            },
            {
                "name": "testing",
                "commitId": "c36085ebd8a031464c7580910e714bf122903cc1"
            }
        ],
        "tags": [
            {
                "name": "v1.1",
                "commitId": "baba3959d7527e0205738ebeb81373858c775a39"
            },
            {
                "name": "v1.2",
                "commitId": "0ec2ecd0ac13bc7e32594c0258ebce55e383d241"
            }
        ]
    }
}

Moreover I demoted the check for remote changes as optional with the -u option because it takes too long.

$  nextflow info hello -o yaml -u
projectName: nextflow-io/hello
repository: https://github.com/nextflow-io/hello
localPath: https://github.com/nextflow-io/hello
manifest: {mainScript: main.nf, nextflowVersion: null, author: null, defaultBranch: master,
  description: null, gitmodules: null, homePage: null, version: null}
revisions:
  current: master
  master: master
  branches:
  - {name: master, latestId: a9012339ce857d6ec7a078281813d8a93645a3e7, commitId: c9b0ec72860c378a214402225fcec2e8bbf23878}
  - {name: mybranch, commitId: 1c3e9e7404127514d69369cd87f8036830f5cf64}
  - {name: testing, commitId: c36085ebd8a031464c7580910e714bf122903cc1}
  tags:
  - {name: v1.1, commitId: baba3959d7527e0205738ebeb81373858c775a39}
  - {name: v1.2, commitId: 0ec2ecd0ac13bc7e32594c0258ebce55e383d241}

pditommaso added a commit that referenced this issue Dec 1, 2018
This commit adds the -o option to the command info that allows the
user to print pipeline information as json or yaml format other
that the text format.

Moreover it adds the -u option to include the remote update info
in the printed output.
@pditommaso pditommaso added this to the v19.1.0 milestone Dec 18, 2018
@pditommaso
Copy link
Member

Included in version 18.12.0-edge.

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

No branches or pull requests

2 participants