Help

Script Management, Version Control, and GitHub

Solved
Jump to Solution
1110 7
cancel
Showing results for 
Search instead for 
Did you mean: 
mcordier
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello All,

I have a general question for the community.
How are you all managing code updates and version control for your custom scripts?

It seems very easy to overwrite custom automation scripts.
Does Airtable have a way to view/restore a previous version?

I am currently storing some of my automations scripts in GitHub Gists but I don't have a great workflow for keeping everything up to date.

What processes have worked for you?

Thanks!
Matt

1 Solution

Accepted Solutions
Ben_Young1
11 - Venus
11 - Venus

Hey @mcordier

This'll be a bit of a brain dump.

Over the past two years, the subject of Airtable's scripting automation runtime has started to become a regular occurrence in my discussions on the platform.

My current method isn't too far off from what you've described. Instead of leveraging GitHub Gists to store scripts, we lean towards storing Airtable scripts into individual repositories for our larger Airtable products.
Scripts aren't the only things you'll find in those repos. In addition to scripts, we store larger formulas and accompanying documentation about respective scripts, formulas, and the base schema overall.

Our more generic scripts are stored in a general purpose repository that functions as a pseudo-library.

It's not sustainable or scalable, but it's organized and it's serving its intended purpose, which is to provide a temporary solution until either (a.) Airtable implements a more robust metadata, schema, and automation version control solution that allows developers to interact with Airtable in a git-controlled environment or (b.) we are forced to externalize our automations into a microservice infrastructure.

I've already externalized many of my Airtable automations into microservices, but not at scale.
Airtable is vocal about the flashy, marketable updates it makes to the platform, but they don't publicize the updates being made to the Web API. Those changes and expansion of the API have made it easier to externalize services, albeit the process has been slow.

The need to do this is really punctuated by the lack of a secret management solution in Airtable's automation environment. There are a scary number of valid and hot credentials sitting forgotten in people's bases and automations.

Externalizing my automation infrastructure has also opened the door to being able to write my services in TypeScript, which has been immensely valuable to the overall readability and maintainability of what would otherwise be a massive and incredibly daunting scrollfest of JavaScript.
Naturally, doing this brings about a lot of challenges, the biggest one being how to authenticate requests invoked from Airtable, but there are a few crafty ways to do this.

See Solution in Thread

7 Replies 7
Ben_Young1
11 - Venus
11 - Venus

Hey @mcordier

This'll be a bit of a brain dump.

Over the past two years, the subject of Airtable's scripting automation runtime has started to become a regular occurrence in my discussions on the platform.

My current method isn't too far off from what you've described. Instead of leveraging GitHub Gists to store scripts, we lean towards storing Airtable scripts into individual repositories for our larger Airtable products.
Scripts aren't the only things you'll find in those repos. In addition to scripts, we store larger formulas and accompanying documentation about respective scripts, formulas, and the base schema overall.

Our more generic scripts are stored in a general purpose repository that functions as a pseudo-library.

It's not sustainable or scalable, but it's organized and it's serving its intended purpose, which is to provide a temporary solution until either (a.) Airtable implements a more robust metadata, schema, and automation version control solution that allows developers to interact with Airtable in a git-controlled environment or (b.) we are forced to externalize our automations into a microservice infrastructure.

I've already externalized many of my Airtable automations into microservices, but not at scale.
Airtable is vocal about the flashy, marketable updates it makes to the platform, but they don't publicize the updates being made to the Web API. Those changes and expansion of the API have made it easier to externalize services, albeit the process has been slow.

The need to do this is really punctuated by the lack of a secret management solution in Airtable's automation environment. There are a scary number of valid and hot credentials sitting forgotten in people's bases and automations.

Externalizing my automation infrastructure has also opened the door to being able to write my services in TypeScript, which has been immensely valuable to the overall readability and maintainability of what would otherwise be a massive and incredibly daunting scrollfest of JavaScript.
Naturally, doing this brings about a lot of challenges, the biggest one being how to authenticate requests invoked from Airtable, but there are a few crafty ways to do this.

Yes. It is far too easy to accidentally overwrite a custom script, both in scripting extension and automation scripts.

I keep scripts in a git repository. I use a regular repository, not gists.

If you do not store your scripts outside of Airtable, you can try restoring a snapshot of the base and get the version of the script as it existed at the time the snapshot was taken. If your script contains anything that looks like an Airtabld ID, be prepared for it to be “updated” to a new value in the script. I view this as a technique of last resort. It is far better to always store scripts outside of Airtable. 

I store scripts in a classic GitHub repo. I'm sometimes dreaming of auto-deploy for scripts from a Git repository! 😀

mcordier
5 - Automation Enthusiast
5 - Automation Enthusiast

Sounds like a regular repo is the way to go.

Thanks for the tip about using snapshots. Hopefully I'll never have to use it!

Thanks for the response! Very useful.
You've painted a clear picture for how I can start to wrangle the increasing number of Airtable automation scripts in my life. 
I like that you are pushing the boundaries and building out microservices. The company I'm working for is not ready for that tech investment. Someday...


opsCTRL
4 - Data Explorer
4 - Data Explorer

Here because I had two tabs open, closed the one I'd been working on for an hour and then accidentally went into the old tab which overwrote my script in airtable. Unfortunately, the snapshot isn't granular enough to restore the script I worked on. Airtable should have versioning enabled with the autosave functionality.

mcordier
5 - Automation Enthusiast
5 - Automation Enthusiast

@opsCTRL I've been there and feel your pain! 
I have mitigated some of that pain by using an editor like VS Code to write my script.
I then copy and paste into the Airtable interface. It is not perfect but has saved me a few times.