A Python script to track activity happening in the Blender orginization
Go to file
Alaska c4f4fd7d7a Remove Rocket Chat support
At the time of this commit, the Blender foundation plans to transition away
from Rocket Chat next week. So remove for it from the script now in preparation
for that.
2024-08-17 17:26:29 +12:00
sub_files Remove Rocket Chat support 2024-08-17 17:26:29 +12:00
.gitignore Change name of people_info.py 2024-04-27 14:22:18 +12:00
blender-activity-tracker.py Remove Rocket Chat support 2024-08-17 17:26:29 +12:00
example_people_info.py Remove Rocket Chat support 2024-08-17 17:26:29 +12:00
Extra info.txt Intial implementation 2024-04-24 20:28:07 +12:00
README.md Remove Rocket Chat support 2024-08-17 17:26:29 +12:00

Security warning:

To make use of some features of this tool, you will need to login to some of your accounts. These are entirely optional. However, if you do decide to use them, keep in mind that you will be storing the details to access these accounts on your computer. Which is a security risk. I have included encryption of these details so they aren't stored on your computer in plain text. But it's still a security risk.

What is this:

This is a Python tool that will track activity on https://projects.blender.org/org/blender/dashboard and will give updates to you. This is basically the same thing as https://blender.chat/channel/blender-status-activity, but you can filter which things to be updated on based on repo and labels.

To set this up, you will need to install a modern version of Python 3 (I'm using Python 3.9)

Then you must decide what details you want to track and how you want to be notified. The approach is as follows:

Decide what you want to track:

  1. Copy the file example_people_info.py to people_info.py.
  2. Inside the file people_info.py there is a action people.append({...
  3. Update this action with the information you want to track. Details about how to fill this out can be found in the code comments by it. If you would prefer a video tutorial on how to fill out this information, I have uploaded one here: https://youtu.be/4Bz4zxJOaUI (Accurate as of 3rd of May 2024)

Decide how you want to recieve the updates:

There are two ways you can recieve updates. Printing updates to the terminal, and sending emails.

Printing to the terminal is currently enabled for all users.

To send updates via email, then you will need to provide a email account to send from. At the moment only Gmail accounts can send emails. You will be prompted to fill out account credentials the first time you run the script if you have enabled email on one of your users (done by providing providing a email_address in the person details). You will also need to install the Cryptography Python library with pip install cryptography

The authentication details for your email are encrypted and saved to your computer in a file called account_info.json. If you forget your password to decrypt it. Just delete this file and re-run the script and you will be prompted to create a new password and fill out your credentials again.

A video tutorial for setting up Gmail messages can be found here: https://youtu.be/BwQcLfn_Ib4 (Accurate as of 3rd of May 2024) Note: The tutorial has a section for Blender chat. This was removed in August 2024 as the Blender foundation changed messing services.

Finally, you can run it with python blender-activity-tracker.py in a terminal


Extra notes:

I am using hyperlinks so you can click (or control + click) on a issue or pull request number and it will take you to that issue/pull request. This is not supported in some terminal applications (E.G. Default macOS terminal). You may want to modify the code in hyper_link_terminal in sub_files/send_messages.py if you have this issue.

You can add other ways to recieve updates. Find the function send_message in sub_files/send_messages.py and add an alternative method there. (Note: you may need to modify other parts of the code if you want to add an alternative method rather than just replace an existing one)

I am stil relatively inexperienced with programming and this is my first time working with the Gitea API. So some of this is messy or unnecessary, and the support I can provide is limited. In fact there is no garuntee that I will provide support.

There may be errors that you encounter. Sorry about that.

Known issues:

At the moment the script can't detect when a label is added to a issue/pull request. This is because this change doesn't get added to the activity on https://projects.blender.org/org/blender/dashboard

It also can't detect what project a issue or pull request is assigned too. I just couldn't find this information in the Gitea API.

The script is also unable to provide hyperlinks directly to a comment on a pull request because it seems to have a hard time picking out which comment corresponds to which action in https://projects.blender.org/org/blender/dashboard.

Changing email provider:

At the moment the script is setup to send emails from a Gmail account. If Gmail is not your provider, then you will need to modify the line email_server = smtplib.SMTP_SSL("smtp.gmail.com", 465) in sub_files/email_tools.py to user your provider.