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

feat: add initial Toggl Track integration #13

Merged
merged 4 commits into from
Oct 15, 2021
Merged

Conversation

gabor-boros
Copy link
Owner

Description

This PR resolves #3 by implementing the initial Toggl Track integration.

Supporting information

The integration uses the reports API.

No precise start and end date filtering is accepted by Toggl Track report API that is used for this source, therefore only ISO 8601 (YYYY-MM-DD) date format can be used. In Go, it is translated to 2006-01-02 when setting date-format in config or flags.

Dependencies

N/A

Screenshots

N/A

Testing instructions

  1. Configure Toggl Track as a source
  2. Start a synchronization process

Other information

This PR includes some refactoring around splitting entries by tags -- entry splitting is now unified.

Checklist

  • Documentation is updated
  • Pull request is rebased onto main
  • Commit history is clean

@gabor-boros gabor-boros added the enhancement New feature or request label Oct 15, 2021
@gabor-boros gabor-boros added this to the v0.1.0 milestone Oct 15, 2021
@gabor-boros gabor-boros self-assigned this Oct 15, 2021
return entries, nil
}

func (c *togglClient) FetchEntries(ctx context.Context, opts *client.FetchOpts) ([]worklog.Entry, error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method togglClient.FetchEntries has 6 return statements (exceeds 4 allowed).

UnbillableDuration: unbillableDuration,
}

if c.opts.TagsAsTasks && len(fetchedEntry.Tags) > 0 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@codeclimate
Copy link

codeclimate bot commented Oct 15, 2021

Code Climate has analyzed commit c647b7f and detected 4 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 2

The test coverage on the diff in this pull request is 89.1% (75% is the threshold).

This pull request will bring the total coverage in the repository to 78.8% (2.2% change).

View more on Code Climate.

@gabor-boros gabor-boros merged commit 59c2a17 into main Oct 15, 2021
@gabor-boros gabor-boros deleted the gabor/add-toggl-source branch October 15, 2021 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] Implement Toggl Track as as source
1 participant