-
-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create wiki page "Hfla Google Apps Script Development/Review Process" #4134
Comments
This comment was marked as resolved.
This comment was marked as resolved.
@roslynwythe Hi Roslyn! I just requested access to the WINS admin guide in order to help me complete this issue. |
Hi Jakob, these are notes I've created that describe the basics. If you find this useful I can post more notes to detail the parts 2 and 3 that I reference below. There are two environments that comprise a Google Apps Script Development environment:
In the local environment you will be retrieving code from the repo using ‘git’, pushing/pulling code to/from Google Drive using ‘clasp’, and editing using an IDE or text editor. All code files have the filename ‘code.js’ and are located in separate folders under the google-apps-scripts folder, which can be found in the root of the website repository. Currently we have two Google Apps Scripts projects, each associated with a subfolder: folder structure: To get started, you will have to install node.js and npm if they are not already installed. You should also update your local gh-pages with upstream changes, then checkout a new issue branch. From a google-apps-script subfolder, execute the command The recommended process is to edit code locally, however testing must be done in the Google Drive IDE. After making local edits, to test your code, run clasp push to push it to Google Drive for testing, where is the script id. If you make any code changes in the GD IDE, use ‘clasp pull’ to bring it down locally for adding/committing to the repository. When testing is complete, code files are added/committed to gh-pages and a PR created in the usual manner. Part 3 of this document will describe the Pull Request and Merge processes for Google Apps Script projects. |
@roslynwythe I am currently trying to get clasp login to work on my local matchine but I am having some issues. Steps I took as of now:
Things I tried to solve this:
|
Hi @shavinski - you have to be in one of the subfolders of google-apps-scripts to install and run clasp. I suggest testing in google-apps-script/wins-form-responses. I apologize if that was unclear from my instructions. Please improve and reorganize the instructions as you see fit. Please include screenshots. For the purpose of writing this set of instructions, let us suppose that you are going to work on an issue that will update the script wins-form-responses but that in order to test wins-form-responses, you will require the gh-requests library. I followed the instructions under the heading "How to share files with developers working on an issue" p 10 -12 (through item 8) in the Wins Admin Guide, and so you can start with item 9 on pg 12. Thanks! |
Hi @roslynwythe! So I was running the npm install clasp command in the subfolder wins-form-responses like you said and was still getting that command not found error. I was able to figure it out finally, I went to the documentation for clasp and ran this command Let me know if that is ok! Thanks! |
Wins Google Apps Script Development Process (Draft)@ For Developers1. Creating an issue brancha. Open your local command line/terminal and navigate to where you have the Hack for LA project located 2. Installation of npm modulesa. If not already installed, download and install node.js and npm
c. The next step is to install clasp and the associated npm packages. This must be done in each subdirectory corresponding to an Apps Script project that you will be modifying. For a local install use 3. Preparation of test environment on developer's personal Google Drivea. The developer will need to select (or create) a google account to use for testing. In the testing process it will be necessary to authorize script access to your Google Drive, so you may choose to use (or create) an account separate from your personal google account. Authorization problems can occur if you are logged into multiple Google accounts, so we suggest that you log out of all google accounts then log in using the account you have selected for testing. This needs to happen anytime you want to work with the App Script on the files.
d. The following must be done to prepare the test docs for test
4. Login to Google Drive with clasp login
5. Cloning Google Apps Script using clasp6. Editing code7. Testinga. Perform testing and demonstration as required by your issue. 8. Completing an issuea. Following a successful demonstration, changes may be required before committing the Apps Script code. If you are following instructions in "Testing WINS in a test repository", you need to revert or reverse the changes you made to target the test repository or test Project Board. It may be helpful to refer to the output of the **For Reviewers (Merge Team) ** |
There are some formatting issues regarding line breaks where there should not be. I felt confident writing about the For Developers section and got less confident as I went from For Pull Request Reviewers to Merge Members. This task: Google Apps Script: Migrate Wins Data - Delete AF file #2148 I wasn't able to checkmark it on this issue because on the issue linked the format is a bullet point versus a checkbox. I also had a question about the dependencies, I had to npm install a different dependency, I had to Let me know if there are any necessary changes! |
@shavinski I have been puzzled by the statement in the Wins Admin Guide, that when setting up a development environment, the developer should create a Personal Access Token, because the guide does not explain how or where that token would be used. Presumably the token would be used so that in the process of testing, the google apps scripts could create issues and/or push wins data to the contributor's fork of the repository instead of to hackforla/website, but in order to accomplish that, it appears that there would have to be code changes in gh-requests. I don't see those code changes described so perhaps that work still has to be done. That would enlarge the scope of this issue and would require the dev to setup a test environment, do testing and more documentation. If you are interested in doing that, I can add to the Action Items of this issue and make this into a |
@roslynwythe Ya I was a little confused about the token portion as well. I can give the Large issue a shot! I will just need to research the best way to set up a test environment and familiarize myself with the Access Token. |
That sounds good @shavinski . I'm not certain but my guess is that you should follow the instructions starting at #8 on pg 7 of the WINS Admin Guide, for generating the token, except do it from your GitHub account, then in gh-requests, change every reference to your repository. Please document the steps and add instructions above as you go. For testing to make sure that the test setup process is correct, I would like to see that you can run main() in order to push the wins-data.json to a PR in your repo, and that you could submit a wins form which would create a new "review" issue in your repository. So in your test environment, you will need a copy of the wins form, which must be connected to your copy of the wins-form (Response) spreadsheet, and then also a copy of gh-requests. Try to follow the instructions for setting up the environment so make sure they are complete. On Slack please let me know which files I still need to share with you. |
@shavinski I am closing this issue as completed so that you receive credit for your work, and I will create a new issue to create the extra documentation "Testing Wins in a test repository". Thank you. |
Recreating Triggers for testing in Wins-form (Responses)When
|
Dependency
Overview
The Google Apps Script development process now includes source control in the Hfla website repository, and the use of the clasp CLI to transfer code between the local workstation and Google Drive, enabling local editing and committing of code. We require a wiki page to guide developers, reviewers, and merge team members how to work with Google Apps Script.
Action Items
For Developers, include:
clasp login
clasp clone <ID>
where<ID>
is from the developer's copy of the project.Code.js
in gh-pages.clasp pull
to update the local code file.Code.js
and the manifest fileappsscript.json
(if any changes were made).gh-pages
, then create PR in the usual manner. In the PR, describe the test setup/strategy, including relevant triggers.For Pull Request Reviewers (testing in their own Google Drive):
clasp login
clasp clone <ID>
where<ID>
is from the developer's copy of the project.clasp push
to copy code to Google Drive.Merge Instructions:
Code.gs
that will be updated. Retain the backups until testing is complete.clasp clone <ID>
where is the production project,clasp push
to copy code to Google Drive for final testing. Make any change to Triggers that were specified in the PR. If something goes wrong, restore the previous state of the script by copying/pasting from the local backup copy and clicking Save.After completion, update the following issues with references to the wiki and release any dependencies on this issue, then move issues to New Issue Approval with "ready for dev lead" label:
Resources
The text was updated successfully, but these errors were encountered: