feat: make number of FF tickets and hour allocations configurable [BB-6396]
Description
This MR makes the number of FF tickets and the FF hour allocations configurable by each cell individually as described in #53 (closed)
Testing instructions
git checkout kaustav/configurable_ticket_count_hours
- Create Service account credentials for your Google Workspace account
- Make a copy of this spreadsheet into your account drive
- Open the copied spreadsheet and click on
Share
on the top right corner. - Add the
Client Email
/Account Email
of the service account created in step 2 - Open
sprintcraft/dashboard/tasks.py
and add the following fuction temporarily:
def get_tasks(cell_name, sprint):
rotations = get_rotations_users(str(sprint), cell_name)
allocations = get_rotations_allocations(cell_name)
for role, users in rotations.items():
for sprint_part, user in enumerate(users):
sprint_part_letter = string.ascii_lowercase[sprint_part]
role_allocation = allocations.get(role, {}).get(sprint_part_letter, 0)
print(f"{role} : {sprint_part_letter} : {user} : {role_allocation}h")
- Add/Modify the
.env
file and atleast add the following details:
GOOGLE_API_PRIVATE_KEY=<PRIIVATE KEY OF SERVICE ACCOUNT>
GOOGLE_API_CLIENT_EMAIL=<CLIENT EMAIL OF SERVICE ACCOUNT>
GOOGLE_ROTATIONS_SPREADSHEET=<SPREAD SHEET ID OF THE COPIED SPREADSHEET>
GOOGLE_ROTATIONS_RANGE=Rotation Schedule
GOOGLE_ALLOCATION_RANGE=Rotation Hour Allocation
- Build sprintcraft:
docker-compose -f local.yml build
- Start sprintcraft:
docker-compose -f local.yml up -d
- Enter django container shell:
docker-compose -f local.yml exec django bash
- Enter python shell:
python manage.py shell
- Run the following script:
from sprintcraft.dashboard.tasks import get_tasks
get_tasks("Bebop", 278)
get_tasks("Falcon", 279)
- Ensure the correct role, sprint part, assignee name and rotation allocation hours are being printed