Skip to content

Google Apps Script: Migrate Wins Data - Stop generation of AF file #2147

@Aveline-art

Description

@Aveline-art

Dependency

Overview

As a developer, to turn the wins card into a reusable component, we must first be able to generate a wins-data.json file of a more specific format. This issue is part of a series that aims to migrate us to the more specific format. The file _wins-data.json now implements the new data format, and so the file wins-data.json can be removed.

Action Items

  • Follow sections 1-3 in the Wins Apps Script Development Process1. Note that in this issue you will be modifying both Apps Scripts wins-form-responses and gh-requests so setup will be required in both /google-apps-script/wins-form-responses and /google-apps-script/gh-requests
  • As described in section 3a and 3b, you will provide a dev lead with the google account you wish to use for testing, and request the dev lead to:
    • do not modify folder level access
    • share the Wins Form Admin Guide2 as VIEWER
    • share the Wins-form (Response)3 sheet as VIEWER
    • share the gh-requests doc as VIEWER
  • Continue following instructions in 3c and d. As described in 3d, you will have to make modifications to certain documents in the test folder.
    • It will not be necessary to restore any triggers, because you can execute main() in debug mode.
    • Since you will be running main() for testing, you must follow instructions in Testing WINS in a test repository
  • Continue following instructions through section 6 "Editing". As described in this section, editing can be done locally in an IDE or in the Google Drive cloud editor, and the clasp utility can be used to transfer code back and forth between the local worksation and the Google Drive as needed.
  • Go to the Google Apps Script which generates both the KVF and AF file.
  • Change any settings or code such that the AF version is no longer generated.
  • Refer to Section 7 "Testing" in the Hfla Google Apps Script Development Process Guide[^4] , Test the code by running main() in debug mode. A new pull request "Update wins-data.json via Google Apps Script" should be appear in your test repository. Examine the json data and if it looks good, merge into your repository test branch, bring that branch down to your local workstation and and use Docker to examine the resulting Wins page, which should remain unchanged.
  • Refer to Section 8 "Completing an Issue" in the Hfla Google Apps Script Development Process Guide[^4] , for information about commiting Code.js and creating a pull request.
  • In the pull request, provide links to the "Update wins-data.json via Google Apps Script" Pull Request and also the Wins page (both in your repository), for the convenience of reviewers.
  • Release dependency on Google Apps Script: Migrate Wins Data - Delete AF file  #2148

Resources/Instructions

wins-page

KVF = is an array of objects
AF = is an array of arrays

Currently we have two json files for wins: _wins-data.json and wins-data.json. The former will henceforth be called KVF (for key-value file) and AF (for array file). AF is generated daily from a script on google while KVF appears to be an older, dysfunc version. The format in the KVF version, however, is much friendlier to formatting in liquid syntax. Therefore, we need to incrementally port our codebase to use the KVF version of the data and remove the AF version we currently use. This will be done in multiple steps:

  1. Have the apps script generate both AF and KVF version.
  2. Migrate all uses of AF to KVF.
  3. Have the apps script stop generating the AF version.
  4. Delete the AF version from our repo since it is now unused.

For this issue, we are doing step 3.

Footnotes

  1. Wins Apps Script Development Process

  2. Wins Form Admin Guide

  3. Wins-form (Response) Sheet

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions