google-apps-scriptgoogle-sheetscollaborationclasp

How to elegantly collaborate in Apps Script?


So I'm on a team of 2-3 developers who will be primarily working with Apps Script connected to Google Sheets.

I've looked into various tools/workflows but there seems to be no elegant way for two people to work on the same Apps Script file at the same time:

I'd be curious as to whether anyone has had experience working on a team environment with App Script and what workflows ended up being used. How do teams have 2+ people work on the same file while also allowing rapid iteration without the friction of needing to call clasp pull/push every iteration? Or is this unavoidable?


Solution

  • Long story short, you can't. There are many challenges and security issues. For example, if the script is tied to a trigger owned by an individual and uses certain copes like Gmail/Drive, you do not want to give others edit access to the script cause that will inadvertently give them access to the individuals other Google data (like Gmail/Drive).

    The current version of the online editor does not support collaboration like you're describing. There is a new version of the IDE coming but who knows when that will happen and if it'll address this functionality.

    You could use clasp run to run the code locally but that may not work elegantly with all use-cases. Plus, it still requires you to do clasp push first.

    You can have multiple folks edit/collaborate but not at the same time. :/ Not that I have seen. It's a huge struggle for me.