Git, Jira, Outlook importers and separate way to categorize/aggregate events into activities

Hi all. Want to share my almost-2-years and not-completed-yet project based on ActivityWatch - https://github.com/AlexanderMakarov/activitywatch-ets

You may read the main idea in README.md but due to it doesn’t work yet I want to share now 3 importers of events:

  • Git events (due to we can’t catch start then each “commit” action is counted as event end, with start at either previous commit or at the start of the date).
  • Jira events (due to we can’t catch start then each “change” action is counted as event end, with start at either previous “change” or at the start of the date).
  • Outlook events (Microsoft/OWA365) which uses shared Firefox profile and Selenium to overpass MFA and other authentication issues.

All them are 3 scripts with similar CLI interface and the similar idea - run at the end of the current day OR for the “previous” day to populate new events for “day to process”.

3 Likes

This is sweet!!! Have you considered trying to use the browser metric or active window metric for determining start and end times for commits? Or does that seem too flaky?

It is expected to be a main goal of my repo - support “one bucket events” by “other buckets events” :grin:

RE Git: it is very hard to heuristically track when user started to work on a commit. Even fact of making commit (actually adding files and writing message, which is IMHO quite useless duration to track) may happen not only in console but in various IDE-s or git clients.

RE Jira: I was thinking about matching Jira activity with browser but realized that it may be viable only for some “documenting” activities like any CRUD on tickets. Usually the main part of “working on XXX ticket” activity is completely separate actions like writing code in IDE, communication somewhere, testing/investigating in any other application and so on.

RE Git: it is very hard to heuristically track when user started to work on a commit. Even fact of making commit (actually adding files and writing message, which is IMHO quite useless duration to track) may happen not only in console but in various IDE-s or git clients.

Yes I can see this. For making the commit, does your pre-commit hook cover multiple IDEs, terminal, etc?

RE Jira: I was thinking about matching Jira activity with browser but realized that it may be viable only for some “documenting” activities like any CRUD on tickets. Usually the main part of “working on XXX ticket” activity is completely separate actions like writing code in IDE, communication somewhere, testing/investigating in any other application and so on.

I think if I could get to the point of “creating / reading / documenting issue X” → “create branch, implementing issue X” → “reviewing issue X” → “merged issue X” as four separate spans / events, that would be pretty good. Since I think it could be rolled up either with an LLM or even a basic tag system (all actions tagged with ISSUE-XXXX).

RE: git - I’m iterating through git repos and calling git CLI for “get commits of this user for this day”. It is not a hook :wink:

RE: Jira - it is hard to separate such activities in Jira, at least without installing specific plugins. And even with extra information about created merge requests and some reporting tools integrated with Jira - flow to work with Jira is different between companies and projects. So I use JQL query with default operands and meaning “get me activity of this user in these projects for this day”.

Please note that these are importers, not watchers!

1 Like

Interesting!

I am trying to do a similar heuristic categorization but based on the tmux watcher which I found is quite a hard problem. Since I do everything from the terminal the idea is to log the current git repository and to do some heuristics to also count time in the browser etc.

The goal is to get a “time per repository” and “time per branch” metric. Time per commit would be sweet but I have not yet figured that out. I guess it would be possible to also watch the current commit number.

BTW: it looks like I may share from the same repo “move data for one day from one computer to another” functionality as well - see What is the process for embedding or sharing my bucket data visually? - #2 by 4ellendger

BTW added get_google_calendar_events.py to import Google Calendar events.

However going to rework it a little to use other type of credentials because some Google Workspace accounts are quite restrictive and

  1. Doesn’t allow to create Service Account-s.
  2. Doesn’t allow to share all details of Google Calendar events for “external” Service Account-s.