Skip to content

Commit fedf9a1

Browse files
committed
docs: how-to guides for time management
1 parent 3f7c9bd commit fedf9a1

File tree

6 files changed

+277
-0
lines changed

6 files changed

+277
-0
lines changed

docs/guides/time/convert.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# How to Convert Time Reports
2+
3+
!!! seealso "Full Command Reference"
4+
5+
For a complete reference of all options, see the [`compiler-admin time convert` reference section](../../reference/cli/time.md#compiler-admin-time-convert).
6+
7+
This guide explains how to use the `compiler-admin time convert` command to convert a time report from one format (like Toggl) to another (like Harvest or Justworks).
8+
9+
## Basic Usage
10+
11+
The `convert` command reads from an input source, which defaults to `toggl` format, and writes to an output source, which defaults to `harvest` format.
12+
13+
The simplest usage reads from standard input and writes to standard output:
14+
15+
```bash
16+
cat toggl-report.csv | compiler-admin time convert > harvest-report.csv
17+
```
18+
19+
## Specifying Input and Output Files
20+
21+
For clarity, it's often better to use the `--input` and `--output` flags.
22+
23+
```bash
24+
compiler-admin time convert --input toggl-report.csv --output harvest-report.csv
25+
```
26+
27+
## Specifying Conversion Formats
28+
29+
You can explicitly define the source and destination formats using the `--from` and `--to` flags.
30+
31+
### Convert from Toggl to Harvest
32+
33+
```bash
34+
compiler-admin time convert \
35+
--from toggl \
36+
--to harvest \
37+
--input toggl-export.csv \
38+
--output harvest-import.csv
39+
```
40+
41+
### Convert from Harvest to Toggl
42+
43+
```bash
44+
compiler-admin time convert \
45+
--from harvest \
46+
--to toggl \
47+
--input harvest-export.csv \
48+
--output toggl-import.csv
49+
```
50+
51+
### Convert from Toggl to Justworks
52+
53+
```bash
54+
compiler-admin time convert \
55+
--from toggl \
56+
--to justworks \
57+
--input toggl-export.csv \
58+
--output justworks-import.csv
59+
```
60+
61+
## Setting a Client Name
62+
63+
When converting, you may need to specify a client name for the destination format. Use the `--client` option for this.
64+
65+
```bash
66+
compiler-admin time convert \
67+
--input toggl.csv \
68+
--output harvest.csv \
69+
--client "Specific Client Name"
70+
```

docs/guides/time/download.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# How to Download a Toggl Time Report
2+
3+
!!! seealso "Full Command Reference"
4+
5+
For a complete reference of all options, see the [`compiler-admin time download` reference section](../../reference/cli/time.md#compiler-admin-time-download).
6+
7+
This guide explains how to use the `compiler-admin time download` command to download a detailed time report from Toggl in CSV format.
8+
9+
## Basic Usage
10+
11+
To download a report for the previous calendar month (the default behavior):
12+
13+
```bash
14+
compiler-admin time download
15+
```
16+
17+
This will create a CSV file in the current directory named `Toggl_time_entries_[start-date]_[end-date].csv`.
18+
19+
## Specifying a Date Range
20+
21+
You can specify a custom date range using the `--start` and `--end` options. The date format is `YYYY-MM-DD`.
22+
23+
```bash
24+
compiler-admin time download --start 2025-01-01 --end 2025-01-31
25+
```
26+
27+
## Specifying an Output File
28+
29+
To save the report to a specific file path, use the `--output` option.
30+
31+
```bash
32+
compiler-admin time download --output /path/to/my-report.csv
33+
```
34+
35+
## Filtering the Report
36+
37+
The command provides several options for filtering the time entries included in the report:
38+
39+
- `--all`: Include all time entries, not just billable ones.
40+
- `-c, --client CLIENT_ID`: Filter by a specific Toggl client ID.
41+
- `-p, --project PROJECT_ID`: Filter by a specific Toggl project ID.
42+
- `-t, --task TASK_ID`: Filter by a specific Toggl task ID.
43+
- `-u, --user USER_ID`: Filter by a specific Toggl user ID.
44+
45+
You can use these options multiple times to include multiple IDs.
46+
47+
### Example
48+
49+
To download all billable time entries for Project ID `12345` and `67890` for the prior month:
50+
51+
```bash
52+
compiler-admin time download -p 12345 -p 67890
53+
```

docs/guides/time/lock.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# How to Lock Time Entries in Toggl
2+
3+
!!! seealso "Full Command Reference"
4+
5+
For a complete reference of all options, see the [`compiler-admin time lock` reference section](../../reference/cli/time.md#compiler-admin-time-lock).
6+
7+
This guide explains how to use the `compiler-admin time lock` command to lock time entries in Toggl, preventing them from being edited.
8+
9+
This is typically the first step before downloading and preparing time reports.
10+
11+
You can see the current lock date at <https://track.toggl.com/${TOGGL_WORKSPACE_ID}/settings/general>.
12+
13+
## Basic Usage
14+
15+
To lock time entries up to the last day of the previous calendar month (the default behavior), run the command without any options:
16+
17+
```bash
18+
compiler-admin time lock
19+
```
20+
21+
The command will print the date it is locking entries up to and ask for confirmation before proceeding.
22+
23+
## Specifying a Lock Date
24+
25+
You can lock entries up to any specific date using the `--date` option. The date format is `YYYY-MM-DD`.
26+
27+
For example, to lock all entries on or before January 31, 2025:
28+
29+
```bash
30+
compiler-admin time lock --date 2025-01-31
31+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# How to Run the Monthly Time Reporting GitHub Actions Workflow
2+
3+
This guide explains how to manually trigger and monitor the `Monthly Time Reporting` GitHub Actions workflow, which automates the process of downloading, converting, verifying, and posting monthly time reports.
4+
5+
## Overview
6+
7+
The workflow performs the following automated steps:
8+
9+
- **Lock Toggl time entries**: Locks time entries in Toggl up to the specified `end-date` (or end of prior month).
10+
- **Download Toggl time entries**: Downloads a detailed CSV report from Toggl.
11+
- **Convert Toggl entries to Harvest format**: Converts the downloaded report into a Harvest-compatible CSV.
12+
- **Verify time entries**: Compares the downloaded and converted files to ensure data integrity, and generates a summary.
13+
- **Post to Slack**: Sends the summary and the converted Harvest CSV to a designated Slack channel.
14+
15+
This workflow ensures that monthly time reporting is consistent and automated.
16+
17+
## Prerequisites
18+
19+
To run this workflow, you must have:
20+
21+
- Write access to the GitHub repository.
22+
- The necessary GitHub Secrets configured in the repository settings. These secrets include API tokens and configuration for Toggl, Harvest, Google Workspace (GAM), and Slack. Without these, the workflow will fail.
23+
24+
## Locating the Workflow
25+
26+
The workflow definition file is located at:
27+
[`./.github/workflows/time-reporting.yml`](https://github.com/compilerla/compiler-admin/blob/main/.github/workflows/time-reporting.yml)
28+
29+
## Manually Triggering the Workflow
30+
31+
To manually trigger the workflow:
32+
33+
1. Navigate to the [**Actions**](https://github.com/compilerla/compiler-admin/actions) tab in the GitHub repository.
34+
2. In the left sidebar, click on the **Monthly Time Reporting** workflow.
35+
3. On the workflow page, click the **Run workflow** dropdown button.
36+
4. Leave the `Branch: main` selection as-is.
37+
5. You will see optional input fields for `start-date` and `end-date`.
38+
- If left blank, the workflow will default to the previous calendar month.
39+
- Enter dates in `YYYY-MM-DD` format if you need to process a specific period.
40+
6. Click the green **Run workflow** button to start the execution.
41+
42+
## Monitoring a Workflow Run
43+
44+
After triggering, you will be redirected to the workflow run page (you may need to refresh).
45+
46+
1. Click on the active workflow run to view its progress.
47+
2. You can expand each job step (e.g., "Lock Toggl time entries", "Download Toggl time entries", "Verify time entries") to see its detailed output.
48+
3. The final step, "Post to Slack", will send a summary of the time report to the configured Slack channel and upload the converted Harvest CSV file.

docs/guides/time/verify.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# How to Verify Time Reports
2+
3+
!!! seealso "Full Command Reference"
4+
5+
For a complete reference of all options, see the [`compiler-admin time verify` reference section](../../reference/cli/time.md#compiler-admin-time-verify).
6+
7+
This guide explains how to use the `compiler-admin time verify` command to check the contents of time report CSV files.
8+
9+
You can use this command in two ways:
10+
11+
1. To get a summary of a single time report.
12+
2. To compare two different time reports (e.g., a Toggl export and a converted Harvest file) to ensure they match.
13+
14+
## Summarizing a Single Report
15+
16+
To see a summary of a single CSV file, provide its path to the command:
17+
18+
```bash
19+
compiler-admin time verify toggl-report.csv
20+
```
21+
22+
The output will show you a summary of the data in that file, including:
23+
24+
- Date range
25+
- Total number of entries
26+
- Total hours
27+
- Hours broken down by project
28+
- Hours broken down by user and project
29+
30+
```text
31+
Summary for: toggl-report.csv
32+
Date range: 2025-09-01 - 2025-09-30
33+
34+
Total entries: 150
35+
Total hours: 160.0
36+
Project A: 80.0
37+
Project B: 50.0
38+
Project C: 30.0
39+
40+
user1@example.com:
41+
Project A: 40.0
42+
Project B: 20.0
43+
user2@example.com:
44+
Project A: 40.0
45+
Project B: 30.0
46+
Project C: 30.0
47+
```
48+
49+
## Comparing Two Reports
50+
51+
To verify that a conversion was successful, you can provide two file paths. The command will compare their summaries.
52+
53+
The tool automatically detects the file format (Toggl or Harvest) and normalizes the data so that a meaningful comparison can be made.
54+
55+
```bash
56+
compiler-admin time verify toggl-report.csv harvest-report.csv
57+
```
58+
59+
If the reports match, the command will output "Summaries match." and exit successfully.
60+
61+
If there are differences in total hours, projects, or other details, the command will print a list of the discrepancies and exit with an error.
62+
63+
```text
64+
Summaries do not match:
65+
- Total hours: 160.0 vs 155.0
66+
Project 'Project B' hours: 50.0 vs 45.0
67+
User 'user1@example.com', Project 'Project B' hours: 20.0 vs 15.0
68+
```

mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ nav:
1010
- Monthly Time Reporting: tutorials/monthly-time-reporting.md
1111
- Onboarding a User: tutorials/onboarding-a-user.md
1212
- Offboarding a User: tutorials/offboarding-a-user.md
13+
- How-to Guides:
14+
- Time Management:
15+
- Download a Toggl Report: guides/time/download.md
16+
- Convert Time Reports: guides/time/convert.md
17+
- Lock Time Entries: guides/time/lock.md
18+
- Verify Time Reports: guides/time/verify.md
19+
- Run GitHub Actions Workflow: guides/time/run-github-workflow.md
1320
- Reference:
1421
- Configuration: reference/configuration.md
1522
- CLI Reference:

0 commit comments

Comments
 (0)