Skip to content

feat: make number of FF tickets and hour allocations configurable [BB-6396]

Kaustav Banerjee requested to merge kaustav/configurable_ticket_count_hours into master

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

  1. git checkout kaustav/configurable_ticket_count_hours
  2. Create Service account credentials for your Google Workspace account
  3. Make a copy of this spreadsheet into your account drive
  4. Open the copied spreadsheet and click on Share on the top right corner.
  5. Add the Client Email/Account Email of the service account created in step 2
  6. 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")
  1. 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
  1. Build sprintcraft:
docker-compose -f local.yml build
  1. Start sprintcraft:
docker-compose -f local.yml up -d
  1. Enter django container shell:
docker-compose -f local.yml exec django bash
  1. Enter python shell:
python manage.py shell
  1. Run the following script:
from sprintcraft.dashboard.tasks import get_tasks
get_tasks("Bebop", 278)
get_tasks("Falcon", 279)
  1. Ensure the correct role, sprint part, assignee name and rotation allocation hours are being printed

Merge request reports