Git Product home page Git Product logo

issue-tracking's Introduction

Issue tracking

This command-line tool can be used to parse JSON files containg data from a GitHub repository issues and export it to csv. The purpose is to retrieve the data easily, pre-process it with the tool and then only keep valuable information. The information retrieved consists of an issue's ID, its creation date, last update date, state and title.

Example

Command:

$ issue-tracking teobiton/issue-tracking --get --output=example.csv --state=open

Output in example.csv:

ID,Created at,Last update,State,Comment
9,2023-06-01,2023-06-01,open,Create `build.rs` for installation
1,2023-05-15,2023-05-15,open,Move from StructOpt to App

Usage

The tool requires a JSON file containing GitHub issues, or a valid GitHub repository name. A valid JSON file can be retrieved either with a plugin from a browser or by accessing GitHub API for a repository with curl. This is the help message of the application:

issue-tracking 1.0.0
GitHub issues parser and exporter from JSON to csv

USAGE:
    issue-tracking [FLAGS] [OPTIONS] <json>

FLAGS:
    -g, --get             GET the JSON file from GitHub API.
    -h, --help            Prints help information
        --print-labels    Print all available labels in the repository.
    -V, --version         Prints version information

OPTIONS:
        --end-date <end-date>        Only consider issues updated before this date. Format: YYYY-MM-DD [default:
                                     (newest)]
    -l, --label <label>              Filter the issues based on a label. [default: (all)]
    -o, --output <output>            Specify a file to store the csv. [default: out.csv]
        --start-date <start-date>    Only consider issues updated after this date. Format: YYYY-MM-DD [default:
                                     (oldest)]
    -s, --state <state>              Only consider issues that have a particular state. [default: (any)]

ARGS:
    <json>    Required JSON file link (local or from GitHub API).

If you're looking for specific issues, you can specify a label to search for when parsing the JSON file. You can also constraint the output between two dates, or only look for closed/opened issues.

issue-tracking's People

Contributors

teobiton avatar

Stargazers

 avatar

Watchers

 avatar

issue-tracking's Issues

Install dependencies for offline use

There are two cases for usage of this project:

  • In an offline environment, users might pass as input a json file that was retrieved via an other method.
  • In an online environment, users might retrieve the json file directly from the GitHub API.

Either way, in case of an offline use, the dependencies should be installed in a folder dependencies/ so that people are able to use the tool in both cases.

Fix Clippy CI fails

The Clippy check (style lint) is failing in build fail. This must be fixed.

Improve error management

So far, we're leaving process on error "manually", by printing in stderr and calling process exit with code error 1.
There might be a better way to do it using either Err() or ExitFailure crates, or something else.

Request JSON from GitHub API

Currently, we are expecting JSON files as required arguments for issue-parser.

To make it more user-friendly, a new flag could be introduced so that users could pass a link to a GitHub repository instead of a JSON file. With this flag, the JSON file could be fetched directly from GitHub API, but this requires an internet access for usage.

If this is implemented, we should have a separate testlist for tests of this feature since some of them will require an internet access.

An example could be: -u or --url.

Introduce filtering capabilities

To enhance the application, data coming from the json file could be filtered based on the following criterias:

  • label: the issue is labelled with a particular label,
  • from-date: the issue was updated after the specified date,
  • until-date: the issue was updated before the specified date,
  • state: the issue is opened or closed

This could be done using structs and traits, based on the design pattern found here https://doc.rust-lang.org/stable/book/ch17-03-oo-design-patterns.html

Run `clippy` on project

The issue-tracking project could take advantage of some linting checks, cargo clippy could help with this.

Issues met during usage

While using the crate, two bugs where found:

  • State input has the wrong default value: should be "any", currently is ""
  • When building date filters, end_active boolean is true by default because the wrong input is checked (from_date instead of until_date)

Coverage of these two bugs by test should be added as well.

Change arguments default values

The default values displayed in the help message do not represent the actual values that are assigned in the end, for the output and for the label. This should be fixed.

Move from StructOpt to App

Rather than using crate StructOpt for arguments manaement, which forces us to use a lot of decorators, we could use the built-in Command/App crates for the application

Example: bat(1) on GitHub

Add option to display all labels

By parsing the serialized data, all labels used in a repository could be displayed to the user so that they could either check the spelling or see what is available for a certain repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.