Keeping up with Google Cloud releases

Alistair Grew
Appsbroker CTS Google Cloud Tech Blog
4 min readJan 24, 2023

With BigQuery, Cloud Functions, and Google Chat Webhooks

Source: https://github.com/priyankavergadia/google-cloud-4-words/blob/master/DarkPoster-lowres.png

The cloud is constantly changing with new features being released daily and Google Cloud is no exception. Trying to keep up to date with these changes and developments is something we at CTS endeavor to do to bring our customers the best solutions for their needs.

For a long time, the way I received these updates was via email from the Google Cloud Platform Release notes Google group though they are also available on the corresponding web page, or finally via a public BigQuery dataset though I will get onto this shortly. The reality though was that I hardly ever read the emails I believe for two main reasons:

  • I, like most people, tend to prioritise my inbox and automated emails tend to get lumped into the ‘not important’ pile.
  • The emails typically arrived outside of UK working hours and I so could get lost amongst other emails I received.

Most of the conversation at CTS as Google Workspace organisation occurs on Google Chat. I really wanted to get this release information somewhere I might actually look at it, namely Chat.

Hot on the heels of my earlier experiments looking at Google Chat webhooks I knew I could get the data provided I could programmatically retrieve it. I thought there must be an RSS/XML feed somewhere I can poll using a Cloud Function, and yes there is specifically: https://cloud.google.com/feeds/gcp-release-notes.xml

I initially set up a prototype using this but straightaway encountered problems with the formatting, specifically parsing the HTML that Google includes in the feed:

Source: https://cloud.google.com/feeds/gcp-release-notes.xml

After many attempts with regex (to which I don’t claim to be an expert), I eventually started looking for alternative solutions. After a time I stumbled across the public dataset Google publishes releases notes to, specifically: bigquery-public-data.google_cloud_release_notes.release_notes.

Retrieving release information from this dataset is as straightforward as a SQL statement and the results thankfully had no HTML to parse which at this point I considered being a major plus.

The next challenge I had was that I needed to maintain a level of state somewhere for the function. This is because the ‘published_at’ column is only tied to a specific date and I want to ensure that I only publish entries I have not published previously (the function runs hourly between 9–5). To provide this functionality I opted to use BigQuery again mainly because I was already using it, and being serverless by default it is normally inexpensive for low-volume jobs like this. One final quirk I found was that posting the release description for some BigQuery releases inadvertently SQL injected my code in true Bobby Tables style:

Source: https://xkcd.com/327/

My quick fix for this as I am only interested in the uniqueness of a release note, not the content itself was to hash the description using sha224 before inserting it into my dataset. The final thing I then did was send the release to different webhooks depending on the type (which in my case I directed to different channels) in all my code looks like this:

<**RELEASE STATE TABLE**> and <**WEBHOOK**> are placeholders that contain values in the live code

The requirements.txt for reference only contains:
httplib2==0.20.4
google-cloud-bigquery==3.0.1

To deploy the function I use some fairly straightforward Terraform code which also creates the BigQuery dataset and table I refer to from the function and defines the IAM permissions.

So after all that code, the result is Google Cloud releases dropping into Google chat spaces. One nice side effect we have found is that people are increasingly discussing the releases and highlighting them for specific customers.

Source: Screenshot of specific CloudSQL release and some following discussion.

I think that brings today's post round to a nice conclusion, hopefully, this code is useful for you or a starting point to building a solution of your own. Anyway, until next time keep it Googley ;)

About CTS

CTS is the largest dedicated Google Cloud practice in Europe and one of the world’s leading Google Cloud experts, winning 2020 Google Partner of the Year Awards for both Workspace and GCP.

We offer a unique full stack Google Cloud solution for businesses, encompassing cloud migration and infrastructure modernisation. Our data practice focuses on analysis and visualisation, providing industry specific solutions for; Retail, Financial Services, Media and Entertainment.

We’re building talented teams ready to change the world using Google technologies. So if you’re passionate, curious and keen to get stuck in — take a look at our Careers Page and join us for the ride!

--

--

Alistair Grew
Appsbroker CTS Google Cloud Tech Blog

GCP Architect based in the Manchester (UK) area. Thoughts here are my own and don’t necessarily represent my employer.