Skip to content
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

Implemented check for changes in Wins-form (Responses) spreadsheet within Wins Data automation #7409

Open
wants to merge 21 commits into
base: gh-pages
Choose a base branch
from

Conversation

iancooperman
Copy link
Member

@iancooperman iancooperman commented Sep 7, 2024

Fixes #4154

What changes did you make?

  • Added a check that compares the current content of _wins-data.json to that of Wins-form (Responses) to see if any changes have been made (e.g. new win, hiding of win, etc.)

Why did you make the changes (we will use this info to test)?

  • To halt the creation of unnecessary pull requests when no significant changes have been made
  • To eliminate the need to examine daily commits for changes

Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)

  • No direct visual changes to the website

Copy link

github-actions bot commented Sep 7, 2024

Want to review this pull request? Take a look at this documentation for a step by step guide!


From your project repository, check out a new branch and test the changes.

git checkout -b iancooperman-update-gas-wins-data-on-change-4154 gh-pages
git pull https://github.com/iancooperman/hackforla-website.git update-gas-wins-data-on-change-4154

@github-actions github-actions bot added role: front end Tasks for front end developers role: back end/devOps Tasks for back-end developers Complexity: Medium P-Feature: Wins Page https://www.hackforla.org/wins/ Feature: Wiki ready for dev lead Issues that tech leads or merge team members need to follow up on size: 1pt Can be done in 4-6 hours labels Sep 7, 2024
google-apps-scripts/gh-requests/Code.js Dismissed Show resolved Hide resolved
google-apps-scripts/wins-form-responses/Code.js Dismissed Show dismissed Hide dismissed
@iancooperman
Copy link
Member Author

@roslynwythe roslynwythe self-requested a review September 9, 2024 07:58
Copy link
Member

@roslynwythe roslynwythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @iancooperman for your work on this complex issue. On the first line of the PR, the issue number (after "Fixes") is incorrect, Please correct that so the PR will be linked correctly to the issue. Thank you.

@codyyjxn codyyjxn self-requested a review September 9, 2024 22:15
Copy link
Member

@codyyjxn codyyjxn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iancooperman Thank you for taking on this issue. The branch name looks good only thing is that I am confused which issue you fixed please correct that if possible. Other than that everything seems to be concise.

@github-actions github-actions bot added Complexity: Large size: 2pt Can be done in 7-12 hours and removed role: front end Tasks for front end developers Complexity: Medium Feature: Wiki ready for dev lead Issues that tech leads or merge team members need to follow up on size: 1pt Can be done in 4-6 hours labels Sep 10, 2024
@iancooperman
Copy link
Member Author

iancooperman commented Sep 10, 2024

@codyyjxn There was a small typo in the linked issue number. Thanks for catching that. Let me know if anything else needs to be done.

codyyjxn
codyyjxn previously approved these changes Sep 12, 2024
Copy link
Member

@roslynwythe roslynwythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @iancooperman I'm still testing but I need to ask you to update line 62

@@ -51,7 +59,7 @@ function updateWinsFile(fileName, content, sha) {
function createPR() {
const payload = {
"title": "Update wins-data.json via Google Apps Script",
"head": "elizabethhonest:update-wins-data",
"head": "iancooperman:update-wins-data",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this back to elizabethhonest

const keyValueFile = "_wins-data.json"
const keyValueSha = ghrequests.getSHA(keyValueFile);
const [keyValueSha, keyValueContent] = ghrequests.getWins(keyValueFile);
if (keyValueSha === false) {
console.log('Ending script...')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the console log output message more descriptive

Copy link
Member

@roslynwythe roslynwythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @iancooperman so far the code looks great but
commit 003c436 includes changes to google-apps-scripts/gh-requests/Code.js, which we do not want included in the git repository.

console.log("Entry difference detected. Updating wins file...");
const writeResponse = ghrequests.updateWinsFile(keyValueFile, encodedKeyValueData, keyValueSha);
if (writeResponse === false) {
console.log('Ending script...')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make the console log output message more descriptive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roslynwythe Just to confirm, you're saying to remove the changes to appscript.json, right? Your initial comment says Code.js but the commit you linked is to appscript.json.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roslynwythe Just to confirm, you're saying to remove the changes to appscript.json, right? Your initial comment says Code.js but the commit you linked is to appscript.json.

I have assumed this is the case and reverted commit 003c436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Large P-Feature: Wins Page https://www.hackforla.org/wins/ role: back end/devOps Tasks for back-end developers size: 2pt Can be done in 7-12 hours
Projects
Status: test-pending-approval (Automated Column, do not place items here manually)
Development

Successfully merging this pull request may close these issues.

Update Google Apps Script to generate wins data feed only on Change
3 participants