Skip to content

@danielridgebot Ops Wiki

Marcos Garcia edited this page Apr 16, 2024 · 6 revisions

@danielridgebot

Overview

Meet Daniel.

Daniel Ridge (@danielridgebot) is a bot, and its repo check-ghpages-versions' current function for hackforla/ops is to automatically check the dependencies for the Docker image created from ghpages-docker and used by Hack for LA. (For more details, see ghpages-docker's README & wiki).

Problem Being Solved

ghpages-docker is designed to mimic the GitHub Pages environment on a local server, and is thus pegged to the dependency versions used by GitHub Pages. When those change, the ghpages-docker Dockerfile needs to be updated, and a new image built from it and pushed to Docker Hub.

@danielridgebot's workflows in repo check-ghpages-versions periodically

  • check those dependencies and,
  • when GitHub Pages upgrades to a new version, open an issue in the hackforla/ops repo.

Specifically, there are two dependencies that need to be checked: Ruby and the github-pages Ruby gem*. There is one workflow for each, entitled check-ghpages-version.yml and check-ruby-version.yml, respectively. The code for both is nearly identical...

*A gem for Ruby is a package that provides a standard format for distributing Ruby programs and libraries. (References: RubyGems Wiki, What is a gem?)

Value Created from Solution

Having a bot @danielridgebot

  • automates the process of checking the dependencies (1) Ruby and (2) the github-pages Ruby gem and saves manual labor from engineers
  • ensures the ghpages-docker are up-to-date (in regards to the above 2 dependencies).

Solution (simplified explanation):

In Daniel's check-ghpages-versions/.github/workflows/ repo subdirectory link,

  • check-gh-pages-version.yml

    • workflow runs every day at 1200 UTC
    • reads the official GitHub Pages' current version** of github-pages gem
    • reads the version number currently being used by ghpages-docker, stored in release versions/github-pages-gem.txt
    • compares the 2 version numbers:
      • if there is a change, the workflow opens an issue in hackforla/ops notifying the Ops team that an update is required.
      • writes the new version number to github-pages-gem.txt and commits the change.***
    • added keepalive-workflow to keep workflow active if repository is inactive for more than 60 days
  • check-ruby-version.yml

    • workflow is triggered to run upon the completion of check-gh-pages-version workflow
    • reads the official GitHub Pages' current version** of Ruby
    • reads the version number currently being used by ghpages-docker, stored in release versions/ruby.txt
      • if there is a change, the workflow opens an issue in hackforla/ops notifying the Ops team that an update is required.
      • writes the new version number to ruby.txt and commits the change.***

**GitHub's dependency list with release versions: https://pages.github.com/versions.json

***Note that this means that by the time an issue is opened, the version number in the relevant text file already reflects the new version used by GitHub Pages, not the version currently used in ghpages-docker.

Stakeholders

Contributing

If you are interested in contributing, please reach out to @ericvennemeyer and/or @hackforla's Ops or Website project manager. Thank you for being interested in improving the package!

Technical Details

Installation

Current State

Future Development

Anticipated technical outcomes

Resources/Instructions

Language

YAML

Platform

Docker

Automation triggers

See above

Input required

No input is required, although the issues created by Daniel (Output) is currently expected to be closed manually by a human. Follow the steps here, How do you update ghpages-docker, for more details on to resolve issues opened by Daniel.

Output

The workflow opens an issue in hackforla/ops notifying the Ops team that an update of either github-pages-gem or Ruby is required.

API

Documentation

What's next