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

Prune Grunt tasks #1461

Closed
samreid opened this issue Sep 13, 2024 · 10 comments
Closed

Prune Grunt tasks #1461

samreid opened this issue Sep 13, 2024 · 10 comments

Comments

@samreid
Copy link
Member

samreid commented Sep 13, 2024

Discovered in #1459, there are many tasks in chipper's Gruntfile.js or perennial's Gruntfile.js that:

  • appear unused
  • are unrelated to the other grunt responsibilities

@zepumph and I recommend reviewing each grunt task to see if it can be deleted or moved to a separately executable script. Things that should remain are: simulation lifecycle events like grunt --brands=phet grunt dev grunt rc grunt lint and their dependencies. And for tasks that must remain stable, well-supported, and backward-compatible for maintenance tasks.

This work will help us modularize & limit our usage of grunt, which we would like to "abandon" #1436

It will also free us up to use other runtimes (such as deno or tsx) or TypeScript as desired.

I will tag suspicious grunt tasks, then bring to Monday's developer meeting. I will make annotations in perennial/main and chipper's typescript_chipper_1459_b branch. (and they can (mostly?) be seen below)

@zepumph
Copy link
Member

zepumph commented Oct 10, 2024

Much of this issue should probably wait until we finish discussing phetsims/perennial#370.

zepumph added a commit to phetsims/perennial that referenced this issue Oct 10, 2024
zepumph added a commit to phetsims/perennial that referenced this issue Oct 10, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 11, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 11, 2024
samreid added a commit to phetsims/phet-core that referenced this issue Oct 14, 2024
samreid added a commit to phetsims/wave-interference that referenced this issue Oct 14, 2024
samreid added a commit to phetsims/phet-lib that referenced this issue Oct 14, 2024
@zepumph
Copy link
Member

zepumph commented Nov 7, 2024

Good work for this issue is being done over in phetsims/perennial#370.

Take this issue off hold once that issue is closed.

zepumph added a commit to phetsims/perennial that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
zepumph added a commit to phetsims/perennial that referenced this issue Nov 8, 2024
zepumph added a commit that referenced this issue Nov 8, 2024
@zepumph
Copy link
Member

zepumph commented Nov 8, 2024

Ready to focus on the TODOs for this issue.

@samreid samreid self-assigned this Nov 8, 2024
@zepumph
Copy link
Member

zepumph commented Nov 8, 2024

Most of these are now just the "ASK DEVS" TODOs.

@zepumph
Copy link
Member

zepumph commented Nov 20, 2024

I made a form to ask devs about the items we have marked with TODOs. I'll send it out now.

https://docs.google.com/forms/d/1IXJCC33lyDIfDly0rFVsPAIWADkpKztM0NWH4umgfXg/edit

https://forms.gle/M2yfQrauAPeXcRrw5

zepumph added a commit to phetsims/perennial that referenced this issue Nov 20, 2024
@zepumph
Copy link
Member

zepumph commented Nov 27, 2024

Alright. With 8 responses, here are the results:

KEEP:
perennial/bin/print-missing-repos.sh
perennial/bin/checkout-branch.sh -> check in with @jbphet
grunt clone-missing-repos

DELETE:
perennial/bin/print-shas.sh -> let @pixelzoom know so he can use it privately
perennial/bin/grunt-all.sh
perennial/bin/lodash-find.sh
perennial/bin/print-all-licenses.sh
grunt cherry-pick
grunt maintenance-check-branch-status
grunt maintenance-create-patch
grunt maintenance-list
grunt npm-update
grunt sha-check

@zepumph
Copy link
Member

zepumph commented Nov 27, 2024

print-shas.sh
#!/bin/bash
#=======================================================================================
#
# Prints shas for all repos in the working directory.
#
# Author: Chris Malley (PixelZoom, Inc.)
#
#=======================================================================================

binDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
workingDir=${binDir}/../..
cd ${workingDir}

for repo in `ls -1`
do
  # Strip newline from end of repo
  repo=`echo ${repo}`

  # if it's a Git repository...
  if [ -d ${repo}/.git ]; then
    cd ${repo} > /dev/null

    # format is "{{repo}} {{sha}}"
    echo "${repo} `git rev-parse HEAD`"
    cd .. > /dev/null
  fi
done

zepumph added a commit to phetsims/perennial that referenced this issue Nov 27, 2024
zepumph added a commit to phetsims/perennial that referenced this issue Nov 27, 2024
@zepumph
Copy link
Member

zepumph commented Nov 27, 2024

Alright I think we are pretty close here. From the survey, a couple things to check in on:

  1. @pixelzoom asked to be mentioned if we delete print-shas. We deleted it because he was the only one that used it but said he was Okay to delete it. I posted the script in the above comment.
  2. @jbphet mentioned that he uses checkout-branch. I'm happy to keep it around, but wanted to note that we have grunt checkout-main-all, and an option for it called grunt checkout-main-all --branch={{BRANCH_NAME}}. The grunt task runs in parallel and is likely 5x or more faster. If that seems like your use case and you'd like to use that instead, let me know. Otherwise, we should keep it around.

@jbphet please feel free to close this issue if you just want to keep checkout-branch.sh.

@jbphet
Copy link
Contributor

jbphet commented Dec 6, 2024

@zepumph - I'm all for keeping things tidy, so please go ahead and delete checkout-branch.sh. I'll make a note and will use the grunt tasks you mention above when the need next arises.

@jbphet jbphet assigned zepumph and unassigned jbphet Dec 6, 2024
zepumph added a commit to phetsims/perennial that referenced this issue Dec 6, 2024
@zepumph
Copy link
Member

zepumph commented Dec 6, 2024

Excellent, and thank you for your flexibility. Last TODO removed above. Closing

@zepumph zepumph closed this as completed Dec 6, 2024
jessegreenberg pushed a commit to phetsims/perennial that referenced this issue Dec 10, 2024
jessegreenberg pushed a commit to phetsims/perennial that referenced this issue Dec 10, 2024
jessegreenberg pushed a commit to phetsims/perennial that referenced this issue Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants