Skip to content

marcrohlfs/tyme2mite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tyme to Mite

Read time entries from Tyme and send them to mite.

Please note: I'm new to Go and thus not yet familiar with how to write good Go code. To get the initial version of the tyme2mite command running as fast as possible, I put all the code into one single function. I'll now start to improve things little by little - when I find some time besides my professional work. See Objectives for (slight) information about further implementation plans.

Installation

Should be described on the Go Documentation page ...

Dependencies

This package depends on some non-bundled packages:

  • github.com/everdev/mack
  • github.com/jimlawless/cfg

They should normally be installed automatically - depending on who the user installs this package.

Configuration

The tyme2mite command requires a configuration file named tyme2mite.cfg in the users' home directory. It must contain the following configuration entries:

  • mite_base_url: The base URL of the mite service. Example: https://DEMO.mite.yo.lk (DEMO should be substituted with the name of Your company/organisation account).
  • mite_api_key: The API key for user authentication. It has to be activated and displayed in the user settings https://DEMO.mite.yo.lk/myself.
  • mite_import_active: Entries will only be sent to mite if this configuration parameter is defined and its value is explicitly set to true. This should prevent unwanted imports to productive mite during test phase.

Program Arguments

The tyme2mite command can be executed with two program arguments:

  1. The start date of the Tyme entries to be transferred to mite.
  2. The end date of the Tyme entries to be transferred to mite.

If the second argument is omitted, the current date will be used as end date. If both arguments are omitted, all entries for yesterday and today will be transferred.

The format of the date arguments is yyyy-mm-dd.

Data Mapping between Tyme and Mite

As customers, projects and services are expected to be changed regularly - either in mite or Tyme - tyme2mite doesn't work with any mapping description file. Instead, the names of projects and tasks in Tyme must match a pattern that allows to resolve the regarding customers, projects and services in mite by their names:

  • The pattern for project names is [CUSTOMER_NAME] | [PROJECT_NAME].
  • There are two patterns for task names: [SERVICE_NAME] and [CUSTOM_TASK_NAME] | [SERVICE_NAME]. In latter case, the custom taks name will be prepended before the note.

Time entries with the same date, customer, project, service and custom task name will merged into one entry before they're sent to mite.

Objectives

  • Instead of requiring name patterns in Tyme, tags may be assigned to projects and tasks. These tags would describe which customers, projects and services should be mapped in mite. They could look like follows:
    • mite:customer-name=The Customer (assigned to a project)
    • mite:project-name=The Poject (assigned to a project)
    • mite:service-name=A Service (assigned to tasks)
  • Extract Go library for mite
  • Extract Go library for Tyme
  • Implement mappings for other tools

References

API references used for implementation:

Contributions

Contributions are highly appreciated.

Please be sure to use the develop branch as parent for Your feature branches and as target for Your pull requests!

About

Transfer time entries from Tyme to mite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages