Lab 2. Time

Lost time is never found again.
– Benjamin Franklin

Learning Objectives

1 Setup Clockify

1.1 Login with UCSB Account

Visit clockify.me and click on GO TO TRACKER in upper right. Login with your UCSB Google account.

1.2 Create Project, Tasks (lead only)

Choose a team leader to enter a new Project with Tasks you previously entered in the detailed Schedule from Lab 1. Proposal. Be sure to have only a single project member enter this once to avoid duplication of projects (with different identifiers but possibly the same name) once you subsequently invite team members.

Create a project on the Project page per Managing projects and clients – Clockify Help. Set the billable rate to $100 per hour.

1.2.1 Add Tasks with Hourly Estimates

Use the hours you estimated per Deliverable from the first lab to enter for the Estimate per Task. You’ll first need to go to your Project Settings and set the Time estimate to be Task based. Then under the TASKS tab, you can ADD the tasks and Set the time for each.

1.3 Invite Team Members (lead only)

Add Team Members using UCSB emails, per Inviting and managing users – Clockify Help.

1.4 Install Extra Software

Install the Desktop app, Browser Extension and optionally Mobile app from clockify.me/apps.

2 Enter Time

2.1 Manually (past) and with Timer (present) per Project Task

Now that you have Clockify setup for you and your Project, you’re ready to track time. Use the website or installed apps to track time by creating entries with Descriptions that include the letters #testing (so we can filter out these bogus entries later):

3 Create Summary Report

By User (lead only)

Now create a Summary Report per Team Member for October & November, per Summary report – Clockify Help.

Be sure to share the report publicly, per Sharing reports – Clockify Help. All team members will submit this URL for the lab.

4 Create Personal Time Tracking Website

4.1 Create Personal Github Repo

Create a Github repository called time in your Github user space (e.g. github.com/bbest/time for me), per Create a repo - GitHub Docs.

4.2 Clone to Desktop

From RStudio, clone the GitHub repository to your computer as a new Project, per Chapter 12 Connect RStudio to Git and GitHub | Happy Git and GitHub for the useR.

4.3 Save Clockify API Key outside Repo

Visit your Profile settings (clockify.me/user/settings) and record your private API key into a text file on your computer (e.g. ~/private/clockify_api-key.txt), but outside your publicly accessible Github repository.

4.4 Create index.Rmd

Include the following R chunk:

show
# get libraries
if (!require(librarian)){
  install.packages("librarian")
  library(librarian)
}
librarian::shelf(
  clockify, dplyr, DT, glue, lubridate, readr)

# CHANGE THESE VARIABLES!
api_txt <- "~/private/clockify_api-key.txt"
api_txt <- "~/My Drive (ben@ecoquants.com)/private/clockify-api-key_ben@ecoquants.com.txt"
project_name <- "ohi-science"

# use API key to authenticate
CLOCKIFY_API_KEY <- readLines(api_txt)
set_api_key(CLOCKIFY_API_KEY)

# get data
d_projects <- projects() %>% 
      select(project_id, project_name)
d_users <- users() %>% 
      select(user_id, user_name)
d_times <- time_entries(concise = F) %>% 
  left_join(
    d_projects, by = "project_id") %>% 
  left_join(
    d_users, by = "user_id")

# show table
d_times %>% 
  filter(
    project_name == !!project_name) %>% 
  select(
    user_name, project_name, 
    time_start, duration, description) %>% 
  arrange(user_name, project_name, time_start) %>% 
  datatable() %>%
  formatRound(columns=c('duration'), digits=3)

Knit the document to create index.html, the default web page served for any given folder. The rendered output table should look something like this:

4.5 Setup Github Pages for your Repo

Setup your Github repo to serve the newly generated index.html choosing the root folder, per Configuring a publishing source for your GitHub Pages site - GitHub Docs.

Copy the published website URL and paste into the Repository’s About settings after clicking the Gear icon in upper right of your main Github repo website.

5 Continue Tracking Time on your Project

Continue tracking time as you work on your Remote Sensing group projects. Be sure to choose a Task. Later we’ll subdivide your initial Tasks into Github Issues and track time specific to those.

Next lab we’ll start into using Github by creating a Github organization where you’ll report time for the whole project. We’ll also setup a Github Action to generate a table and charts on a regular basis, such as daily or weekly.

6 Submit Lab via Form

Please submit the link to the Clockify project report and your personal time tracking website on Github via the following Google Form using your UCSB email:

References