Coder Social home page Coder Social logo

vajahath / auto-timesheet Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 329 KB

Add redmine timesheet automatically and periodically.

Home Page: https://www.npmjs.com/package/auto-timesheet

License: MIT License

JavaScript 100.00%
redmine timesheet timesheets auto-timesheet cli periodic-jobs periodic-tasks automatic

auto-timesheet's Introduction

auto-timesheet

Add redmine timesheet automatically and periodically.

Gitter chat

๐ŸŽˆ Auto-timesheet 2 has released - with Gitlab support! ๐Ÿ˜œ

โš ๏ธ Important: This package is pre-configured for Cubet Technolabs Policies. If you need to configure this app for your workstation, please rise an issue and I'll reach you back.

Created and maintained at free times for fun.

Why?

  • Because I keep forgetting to add stuffs to timesheet. ๐Ÿ˜ค
  • Adds activities to timesheet automatically and periodically.
  • Integrated with your Git repo. So activity messages are constructed from your commit messages.
  • Supports Github and Gitlab.

Install

npm i -g auto-timesheet

verify with auto-timesheet --version.

Configure

auto-timesheet conf

It opens up a config file. Alter it and save. Make sure you didn't made any syntax mistakes with the opened json file.

By default it will open the editor mentioned in the $EDITOR env_var. If none, be prepared for vi.

some important conf file properties

General configurations

  • projectId : The timesheet project id in which you are working on. You should find this by inspecting the web interface of timesheet. If you need any assistance, feel free to open an issue.
  • activityInterval : Interval in milliseconds.
  • defaultIssue : If auto-timesheet couldn't extract any issues from your commit messages, this issue will be used.
  • git-service: selected git service. Possible options: github and gitlab. Based on this value, corresponding git configuration is used.

Github specific

  • config.github.url: Github api url to fetch commits of your repo.
  • config.github.commitAuthorEmail : email of the committer. commit messages are extracted based on this email.
  • config.github.username: Github username.

Gitlab specific

  • config.gitlab.url: Gitlab api url to fetch commits of your repo. here is an example template:
http://<host(eg:192.168.1.55)>/api/v4/projects/<project_id(eg: 80. look this at the settings page of your repo OR ask repo owner)>/repository/commits?ref_name=<branch_name>

eg: http://192.168.1.55/api/v4/projects/80/repository/commits?ref_name=master

  • config.gitlab.commitAuthorEmail : email of the committer. commit messages are extracted based on this email.

Advanced configs

  • issueMatchingInsensitivity [Recommended 4] : For best results, this should be an integer in between 0 and 10. Lesser the value, it is more likely that the package will create new issues. Higher the value, the package will try to match the extracted issue with existing issues and if both are matching (the degree of matching is based on the issueMatchingInsensitivity value), the existing issue will be reused. In other words, accuracy of the matchness is based on this value. Lesser the value means more accurate and higher the value means less accurate.

Usage

modify your future commit messages:

use star-tags (*thisIsStarTag) to mention the timesheet-issue/issues you are addressing with this commit. An example commit message be like:

Improves *login security and updates *documentation 

Here login and documentation are timesheet issues. The package will choose one randomly and create/use that issue for this commit message.

start application

auto-timesheet start

Handy commands

run the following to see all available commands.

auto-timesheet help

will give you:

Usage: auto-timesheet [options] [command]


  Options:

    -V, --version  output the version number
    -h, --help     output usage information


  Commands:

    conf        configure stuff
    start       start application
    reset       reset this package [config will be deleted]
    migrate     migrate configuration file version to compatible version
                without loosing current configurations
    help [cmd]  display help for [cmd]

Found any issues/ need help?

Please report it at github issues

Licence

MIT ยฉ Vajahath Ahmed

auto-timesheet's People

Contributors

lakshmipriyamukundan avatar vajahath avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

auto-timesheet's Issues

max msg length 250 char

timesheet rejecting the content msg with more than 250 chars.

shrink down the msg and make it in between 120 and 250. ๐Ÿ˜ธ

start-time and end-time

We need the following things to create a new activity:

  • Project ID โœ… done
  • Issue ID โš ๏ธ pending
  • Start time ๐Ÿ‘ˆ current focus ๐ŸŽฏ
  • End time ๐Ÿ‘ˆ current focus ๐ŸŽฏ
  • date ๐Ÿ‘ˆ current focus ๐ŸŽฏ
  • Message โœ… done

track start, end times and dates..

add login functionality

now the credentials are hard-coded which is bad.
Let the user set their username and password as credentials so that the program should automatically log them in

change field in timesheet

in config file, change git to github
So that we can flawlessly determine b/w git services.
use also gitlab & bitbucket fields

persistant default configuration

User doesn't accidentally corrupt the default conf.
use Object.assign() to merge them.
If user's conf failed to load, use default conf

tag-extractor

Add ti# instead of #
handle 'failed to detect tags' case.

Detect issues from commit messages

Opening discussion on Issue tracking

Give feedbacks here

requirement

We need the following things to create a new activity:

  • Project ID โœ… done
  • Issue ID ๐Ÿ‘ˆ current focus ๐ŸŽฏ
  • Start time โš ๏ธ pending
  • End time โš ๏ธ pending
  • Message โœ… done

Currently auto-timesheet fetches git-commit-messages from Github and use it as the message for timesheet activity. We need to somehow extract the issue id from commit messages.

Proposal

Just a proposal to start thinking..

Lets use ti#tags with commit messages. While making a commit message, mention the timesheet issue with a hashtag like:

Adds extra details to fetch details api. ti#fetchDetails

(where fetchDetails is the timesheet issue corresponding to our commit)

We can extract that ti# tag and find that issue-id.

How to detect issue-id from extracted tags?

Looks like timesheet uses an api to fetch all issues (description and id) corresponding to a project. We call that api and get those data. Now we've to match our hashtag with the issue description to get the id.

Why ti# ?

Github uses hashtags to map stuffs made in Github itself (PR/issues). Prepending ti (stands for Timesheet Issue) with it resolve that conflict.

How to handling multiple ti# tags in a message ?

If a timesheet msg contains multiple ti# tags, let's choose one in random..

Export the entire app into a cli

  • make auto-timesheet command
  • auto-timesheet set-credentials to set credentials
  • auto-timesheet config for setting configuration
  • auto-timesheet start to start the application

GItlab integration

Make a study on how to integrate gitlab on it.
and do required stuff.

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.