Skip to content

Commit

Permalink
Remove Google Sheets integration for progression updates
Browse files Browse the repository at this point in the history
  • Loading branch information
petterhj committed Apr 5, 2024
1 parent 25eb4a6 commit aba119a
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 737 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format

## [UNRELEASED]

### Removed

- The Google Sheets integration have been completely removed, both for key
results and measurements. Please refer to our API documentation for
instructions on how to update progression programmatically, e.g. by using
Google Apps Script for Google Sheets.

### Security

- Updated dependencies.
Expand Down
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
- [Create Google Cloud API Gateway](#create-google-cloud-api-gateway)
- [Build and deploy](#build-and-deploy)
- [Lint and fix](#lint-and-fix)
- [Google Sheets integration](#google-sheets-integration)
- [Import production data from Cloud Firestore to local Firestore](#import-production-data-from-cloud-firestore-to-local-firestore)
- [Requirements](#requirements)
- [Export production data](#export-production-data)
Expand Down Expand Up @@ -72,13 +71,10 @@ Follow this guide to set up a new clean instance of the OKR-tracker. Please read
- From the **Project Overview**, select **Service accounts**
- Click **Generate new private key**

This key is used for fetching data from Google Sheets (for automatically updating key results). In order to fetch data from Google Sheets, you must set up environment variables for Firebase Functions:

```bash
firebase functions:config:set
service_account="<service account private key json-file>"
storage.bucket="<your-storage-bucket-name>"
sheets.impersonator="email-address" (optional)
```

Cat the whole service account private key json file into the environment key `service_account`.
Expand Down Expand Up @@ -124,7 +120,6 @@ Get your Firebase SDK snippet from your [Firebase Console](https://console.fireb
| `VITE_STORAGE_BUCKET` | _from SDK snippet_ |
| `VITE_MESSAGING_SENDER_ID` | _from SDK snippet_ |
| `VITE_APP_ID` | _from SDK snippet_ |
| `VITE_SHEETS_SERVICE_ACCOUNT` | \<service account email\> |
| `VITE_I18N_LOCALE` | `nb-NO OR en-US` |
| `VITE_REGION` | `europe-west2` |
| `VITE_LOGIN_PROVIDERS` | login providers allowed separated with hyphen - only implemented google, email. Ex: `google-email` |
Expand Down Expand Up @@ -276,12 +271,6 @@ npm run lint:style # Run style linter
npm run lint:style:fix # Fix lint issues found in styles
```

## Google Sheets integration

If you want to use Google Sheets API for automatic key results or automatic KPIs, you will need to enable the Google Sheets API in Google Cloud Console.

If you are using Team Drives with domain-policy (only specific domains have access) then you need to turn on domain-wide delegation on your service accounts and then give that service account access through G Suite Admin. Read more about it [here](https://developers.google.com/identity/protocols/oauth2/service-account#delegatingauthority)

## Import production data from Cloud Firestore to local Firestore

Based on [this tutorial](https://medium.com/firebase-developers/how-to-import-production-data-from-cloud-firestore-to-the-local-emulator-e82ae1c6ed8) with a few differences for our use case.
Expand Down
82 changes: 0 additions & 82 deletions functions/automatedKeyResults.js

This file was deleted.

2 changes: 0 additions & 2 deletions functions/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export default {
region: 'europe-west2',
autoKpiFetchFrequency: '45 6,18 * * *',
autoKeyResFetchFrequency: '35 7 * * *',
backupFrequency: '45 2 * * *',
runtimeOpts: {
timeoutSeconds: 300,
Expand Down
10 changes: 0 additions & 10 deletions functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,7 @@ initializeApp({
// */
export { automatedBackups } from './backupAndRestore.js';
export { automatedRestore } from './backupAndRestore.js';
/**
* Scheduled function that automatically updates the progress for all key results
* with the `auto` property set to true, getting the data from the provided
* google sheets details.
*/
export { fetchAutomatedKeyResOnSchedule } from './automatedKeyResults.js';
export { triggerScheduledFunction } from './automatedKeyResults.js';

export { fetchKpiDataOnCreate } from './kpi/index.js';
export { fetchKpiDataOnSchedule } from './kpi/index.js';
export { fetchKpiDataTrigger } from './kpi/index.js';
export { handleKpiProgress };
export { handleKpiGoals };

Expand Down
41 changes: 0 additions & 41 deletions functions/kpi/fetchKpiData.js

This file was deleted.

43 changes: 0 additions & 43 deletions functions/kpi/index.js

This file was deleted.

57 changes: 0 additions & 57 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"firebase-admin": "^11.4.1",
"firebase-functions": "^3.24.1",
"google-auth-library": "^7.11.0",
"googleapis": "^92.0.0",
"morgan": "^1.10.0"
},
"devDependencies": {
Expand Down
18 changes: 0 additions & 18 deletions functions/tests/unit/util.test.js

This file was deleted.

Loading

0 comments on commit aba119a

Please sign in to comment.