wakatime / WakaTime.novaextension

Nova plugin for automatic time tracking and metrics generated from your programming activity.
https://wakatime.com/nova
5 stars 3 forks source link

Remote projects are being logged under Unknown Project #11

Closed daveyjones closed 2 years ago

daveyjones commented 3 years ago

I see some related issues (#1 and #2), but they were both marked as resolved several months ago and I'm on the latest version (2.0.3). I'm also seeing slightly different behavior, so I thought I'd open a new issue.

It appears that all of my work on remote projects is being logged under Unknown Project.

Screen Shot 2021-05-24 at 6 30 37 PM

I'm also seeing an awful lot of errors like the one below in my WakaTime logs—probably one for every heartbeat, each with a different file not found, depending on what file I was editing at the time:

{"now": "2021/05/24 08:47:37 -0700", "version": "13.0.7", "plugin": "nova/6.2 nova-wakatime/2.0.3", "time": 1621871256.8993149, "level": "ERROR", "message": "Traceback (most recent call last):\n File \"wakatime/main.py\", line 64, in execute\n File \"wakatime/heartbeat.py\", line 119, in __init__\n File \"wakatime/stats.py\", line 61, in get_file_stats\n File \"wakatime/stats.py\", line 85, in guess_lexer\n File \"wakatime/stats.py\", line 189, in get_language_from_extension\n File \"wakatime/stats.py\", line 393, in extensions_in_same_folder\nFileNotFoundError: [Errno 2] No such file or directory: '/private/var/www/production/templates/admin'\n"}

Here's that error message in a slightly more readable format:

Traceback (most recent call last):
File "wakatime/main.py", line 64, in execute
File "wakatime/heartbeat.py", line 119, in __init__
File "wakatime/stats.py", line 61, in get_file_stats
File "wakatime/stats.py", line 85, in guess_lexer
File "wakatime/stats.py", line 189, in get_language_from_extension
File "wakatime/stats.py", line 393, in extensions_in_same_folder
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/www/production/templates/admin'

I'd love to get this resolved. Let me know if there's anything I can do to help!

daveyjones commented 3 years ago

@alanhamlett On a related note, since Nova has been assigning all of my remote work to Unknown Project, I'm going to need to go through all the files for the month of May and manually assign them to a project so I can create invoices for the right amounts. Is there an interface for manually assigning files to projects (similar to code delete tool, but for assigning projects rather than deleting files)? Setting rules isn't going to work because I can't constrain rules by timeframe.

alanhamlett commented 3 years ago

Are you using Git for your projects?

daveyjones commented 3 years ago

I use git for local projects (no issues there), but not for remote projects. I believe the extension is supposed to use the Nova project name as the WakaTime project name in these cases, but that doesn't seem to be happening.

Below you can see an example of a local project and a remote project side-by-side. Note that the file for the remote project is located in /private and has not been assigned a project.

Screen Shot 2021-05-26 at 9 23 44 AM
jdbuendia commented 3 years ago

Hi, has anyone gotten it to work in nova? All remote projects are classified as Unknown Project. I have read the issues but nothing works.

daveyjones commented 2 years ago

@alanhamlett This is starting to make WakaTime unusable for me, as Nova is my primary editor.

alanhamlett commented 2 years ago

Does your remote project have a .git folder? Does Nova have the concept of a project or workspace folder? It's not detecting the project for remote files because wakatime-cli only has access to the local tmp file instead of the whole project, so it can't find any .git folder.

Related: a recent release of wakatime-cli added support for reading remote files.