website icon indicating copy to clipboard operation
website copied to clipboard

Review of Bump @octokit/rest from 20.1.1 to 21.0.0

Open t-will-gillis opened this issue 1 year ago • 1 comments

Overview

The Dependabot-generated PR #7041 is a notification the package octokit/rest, used by the "Schedule Daily" workflow, has an update from v20.1.1 to v21.0.0. The new version use ES Modules (ESM) and no longer supports Common JS modules, which necessitates minor changes to the "Schedule Daily" workflow.

Details

The main difference between ESM and Common JS modules is that modules need to be dynamically imported, and require() is not supported.

Action Items

This issue involves testing GitHub Actions, and you will need to have a testing environment and Projects Beta set up in your repo. See "Resources/Instructions" below. [^1] [^2]

Starting from PR #7041 [^3] copy the branch as if you are reviewing the PR, therefore:

  • [ ] Update package-lock.json per the PR
  • [ ] In package.json line 10, replace the existing octokit version number and update to:
    "@octokit/rest": "^21.0.0",  
    

From the recommendations provide in the Pure ESM Package [^4]:

  • In package.json:
    • [ ] At line 5, replace:
      "main": "./github-actions/get-project-data.js",
      
      with:
      "exports": "./github-actions/get-project-data.js",
      "type":"module",
      "engines": {
        "node": ">=18"
      },
      
    • [ ] On line 3, since we are making significant changes update the version number:
      "version": "3.0.0",
      
  • [ ] In get-project-data.js:
    • [ ] Delete line 1: @actions/core is not being used
    • [ ] For the next four lines, replace:
      const fs = require("fs");
      const { Octokit } = require("@octokit/rest");
      const trueContributorsMixin = require("true-github-contributors");
      const _ = require('lodash');
      
      with:
      // @octokit/rest revised from v20.0.1 to v21.0.0 suggested
      // by dependabot. *** Package v21.0.0 is now ESM ***
      import fs from "fs";
      import { Octokit } from "@octokit/rest";
      import trueContributorsMixin from "true-github-contributors";
      import _ from 'lodash';
      
  • [ ] Confirm that "Schedule Daily" workflow runs as expected in your repo.

Resources/Instructions

[^1]: Hack for LA's GitHub Actions [^2]: "Schedule Daily 1100" wiki [^3]: #7041 [^4]: Pure ESM Package for moving from CommonJS to ESM

t-will-gillis avatar Jul 01 '24 18:07 t-will-gillis

Hi @t-will-gillis, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

github-actions[bot] avatar Jul 01 '24 19:07 github-actions[bot]

Hi @mrodz, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

HackforLABot avatar Jul 15 '24 22:07 HackforLABot

Apologies, I jumped the gun and assigned myself to this issue while having an outstanding PR. I would like to work on it once I am freed!

mrodz avatar Jul 15 '24 22:07 mrodz

Hello @mrodz, we appreciate you taking on this issue, however it looks like you're already working on another issue at this time. Please wait until your current issue is merged before taking on another issue. :)

We are going to unassign you from this issue so you can focus on your current issue.

Hfla appreciates you! :)

HackforLABot avatar Jul 16 '24 00:07 HackforLABot

Hi @mrodz, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:- i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?) ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

HackforLABot avatar Jul 16 '24 22:07 HackforLABot

Availability: Weekdays from 9am-9pm ETA: EOD 7/16/2024

mrodz avatar Jul 16 '24 22:07 mrodz