Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade: update dependencies and use Node 20 #508

Merged
merged 9 commits into from
Mar 14, 2025

Conversation

paulRbr
Copy link
Member

@paulRbr paulRbr commented Dec 17, 2024

  • Automatic unit tests are all passing
Logs of unit tests
$ npm run test
> bump-github-action@1.1.11 test
> NODE_OPTIONS=--experimental-vm-modules NODE_NO_WARNINGS=1 npx jest

PASS tests/common.test.ts
  ✓ shaDigest function (9 ms)
  ✓ fsExists function (3 ms)
  ✓ extractBumpDigest function (2 ms)

PASS tests/diff.test.ts
  diff.ts
    ✓ test github diff run process (24 ms)
    ✓ test github diff with no structural change (16 ms)
    ✓ test github diff with breaking changes (9 ms)
    ✓ test github diff without public url (5 ms)

PASS tests/github.test.ts
  github.ts
    getBasefile function
      ✓ Executes git operations on the current repo (22 ms)
    createOrUpdateComment function
      When comment doesn't exist
        ✓ Calls octokit to create an issue comment (55 ms)
      When comment with same digest already exists
        ✓ Calls octokit to update the issue comment (19 ms)
    constructor with empty GITHUB_TOKEN
      ✓ throws an error (18 ms)

PASS tests/main.test.ts (5.213 s)
  main.ts
    deploy command
      ✓ test action run deploy entire directory in hub correctly (6 ms)
      ✓ test action run deploy correctly (1 ms)
      ✓ test action run deploy a specific doc inside a hub correctly
      ✓ test action run deploy with branch name correctly
      ✓ test action run dry-run correctly (1 ms)
    preview command
      ✓ test action run preview correctly
    diff command
      ✓ test action run diff correctly (7 ms)
      ✓ test action run diff on existing documentation correctly (2 ms)
      ✓ test action run diff with Branch correctly (2 ms)
      ✓ test action run diff on PR correctly (2 ms)
      ✓ test action run with breaking change diff (13 ms)
      ✓ test action run diff with internal exception (3 ms)
      ✓ test action run diff with no change (2 ms)

-----------|---------|----------|---------|---------|-------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-----------|---------|----------|---------|---------|-------------------
All files  |   89.92 |    89.47 |    90.9 |   89.85 |                   
 common.ts |    92.3 |      100 |     100 |   91.66 | 32                
 diff.ts   |     100 |      100 |     100 |     100 |                   
 github.ts |   80.39 |       75 |   77.77 |   80.39 | 72,99-100,153-162 
 index.ts  |       0 |      100 |     100 |       0 | 7                 
 main.ts   |   96.22 |       92 |     100 |   96.22 | 95,103            
-----------|---------|----------|---------|---------|-------------------
Test Suites: 4 passed, 4 total
Tests:       24 passed, 24 total
Snapshots:   0 total
Time:        7.588 s
Ran all test suites.
  • Local action manual testing
Logs of running the action with `local-action` package
$ BUMP_HOST=http://localhost:3000 npm run local-action

> bump-github-action@1.1.11 local-action
> npx local-action . src/main.ts .env

     _        _   _               ____       _                                 
    / \   ___| |_(_) ___  _ __   |  _ \  ___| |__  _   _  __ _  __ _  ___ _ __ 
   / _ \ / __| __| |/ _ \| '_ \  | | | |/ _ \ '_ \| | | |/ _` |/ _` |/ _ \ '__|
  / ___ \ (__| |_| | (_) | | | | | |_| |  __/ |_) | |_| | (_| | (_| |  __/ |   
 /_/   \_\___|\__|_|\___/|_| |_| |____/ \___|_.__/ \__,_|\__, |\__, |\___|_|   
                                                         |___/ |___/           
================================================================================
                                 Configuration
================================================================================

┌─────────┬────────────────────┬──────────────────────────────────────────────────────┐
│ (index) │ Field              │ Value                                                │
├─────────┼────────────────────┼──────────────────────────────────────────────────────┤
│ 0       │ 'Action Path''/home/paul/devel/bump-sh/github-action'
│ 1       │ 'Entrypoint''/home/paul/devel/bump-sh/github-action/src/main.ts'
│ 2       │ 'Environment File''/home/paul/devel/bump-sh/github-action/.env'
└─────────┴────────────────────┴──────────────────────────────────────────────────────┘

================================================================================
                                Action Metadata
================================================================================

┌─────────┬────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ Input              │ Description                                                                                                                                                                 │
├─────────┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ 'file''Relative path to an API definition file (OpenAPI or AsyncAPI)'
│ 1       │ 'doc''Documentation slug or id. Can be found in the documentation settings on https://bump.sh'
│ 2       │ 'token''Api token. Can be found in the documentation or organization settings on https://bump.sh'
│ 3       │ 'hub''Hub slug or id. Needed when deploying to a documentation attached to a Hub. Can be found in the hub settings on https://bump.sh'
│ 4       │ 'branch''Branch name used during `deploy` or `diff` commands. This can be useful to maintain multiple API reference history and make it available in your API documentation.'
│ 5       │ 'command''Bump command: deploy|dry-run|preview|diff'
│ 6       │ 'expires''Specify a longer expiration date for public diffs (defaults to 1 day). Use iso8601 format to provide a date, or you can use `never` to keep the result live indefinitely.'
│ 7       │ 'fail_on_breaking''Mark the action as failed when a breaking change is detected with the diff command. This is only valid when `diff` is provided in the command input.'
└─────────┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

┌─────────┐
│ (index) │
├─────────┤
└─────────┘

================================================================================
                                 Running Action
================================================================================
::debug::Waiting for bump preview ...
::debug::16:49:13 GMT+0100 (heure normale d’Europe centrale)
* Let's render a preview on Bump.sh... ...in progress
* Let's render a preview on Bump.sh... ...done* Let's render a preview on Bump.sh... done
Your preview is visible at: http://localhost:3000/preview/6011d820-608f-4fc0-8b9a-29adf4855adf (Expires at 2025-01-28T17:19:14+01:00)
::debug::16:49:14 GMT+0100 (heure normale d’Europe centrale)
  • Full integration testing (using this branch as a github action)

@paulRbr paulRbr force-pushed the upgrade-dependencies branch 2 times, most recently from 5848ca9 to 29b1b5d Compare December 17, 2024 14:05
@paulRbr paulRbr force-pushed the upgrade-dependencies branch from 29b1b5d to 7f3b23e Compare December 17, 2024 14:06
@paulRbr paulRbr changed the title upgrade: update dependencies and use Node 20 upgrade: update dependencies, use Node 20 and transform package into ESM Dec 19, 2024
@paulRbr paulRbr force-pushed the upgrade-dependencies branch 5 times, most recently from 9a9000f to 0cce878 Compare January 28, 2025 15:28
@paulRbr paulRbr changed the title upgrade: update dependencies, use Node 20 and transform package into ESM upgrade: update dependencies and use Node 20 Jan 28, 2025
@paulRbr paulRbr marked this pull request as ready for review January 28, 2025 15:50
@paulRbr paulRbr self-assigned this Jan 28, 2025
@paulRbr paulRbr force-pushed the upgrade-dependencies branch 2 times, most recently from 3025e7a to f0fb677 Compare January 28, 2025 15:56
@paulRbr paulRbr force-pushed the upgrade-dependencies branch from f0fb677 to 9f32693 Compare January 30, 2025 15:41
Copy link
Contributor

@fbraure fbraure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks a lot for this huge work 🙏

@philsturgeon
Copy link
Contributor

@paulRbr is this one good to go? Would be amazing to see #509 get in.

@paulRbr
Copy link
Member Author

paulRbr commented Feb 27, 2025

Hi Phil, thanks for the ping. I indeed would love to be able to merge this in, but there's still an issue in the packaging with the new ESM mode which is driving me crazy 😅. I've had to leave it as is for now, but it's almost there. Luckily I should have some time to look at it and merge this ASAP (definitely will do in march.

Thanks for the heads up

paulRbr added a commit to paulRbr/cli that referenced this pull request Mar 13, 2025
The currently used `jsonpath` lib is pretty old and unmaintained (last
commits 4 years ago), and even more problematic it causes issues to
[upgrade our github action](bump-sh/github-action#508) as that lib has an inconsistant use of
'require' and doesn't seem to work well with the packaging
step (rollup) of the github action.

Hopefully this upgrade (and change of lib) should let us a clean
upgrade of the GH action to an ESM version 🤞
paulRbr added a commit to paulRbr/cli that referenced this pull request Mar 13, 2025
The currently used `jsonpath` lib is pretty old and unmaintained (last
commits 4 years ago), and even more problematic it causes issues to
[upgrade our github action](bump-sh/github-action#508) as that lib has an inconsistant use of
'require' and doesn't seem to work well with the packaging
step (rollup) of the github action.

Hopefully this upgrade (and change of lib) should let us a clean
upgrade of the GH action to an ESM version 🤞
paulRbr added a commit to paulRbr/cli that referenced this pull request Mar 13, 2025
The currently used `jsonpath` lib is pretty old and unmaintained (last
commits 4 years ago), and even more problematic it causes issues to
[upgrade our github action](bump-sh/github-action#508) as that lib has an inconsistant use of
'require' and doesn't seem to work well with the packaging
step (rollup) of the github action.

Hopefully this upgrade (and change of lib) should let us a clean
upgrade of the GH action to an ESM version 🤞
paulRbr added a commit to paulRbr/cli that referenced this pull request Mar 13, 2025
The currently used `jsonpath` lib is pretty old and unmaintained (last
commits 4 years ago), and even more problematic it causes issues to
[upgrade our github action](bump-sh/github-action#508) as that lib has an inconsistant use of
'require' and doesn't seem to work well with the packaging
step (rollup) of the github action.

Hopefully this upgrade (and change of lib) should let us a clean
upgrade of the GH action to an ESM version 🤞
paulRbr added a commit to paulRbr/cli that referenced this pull request Mar 13, 2025
The currently used `jsonpath` lib is pretty old and unmaintained (last
commits 4 years ago), and even more problematic it causes issues to
[upgrade our github action](bump-sh/github-action#508) as that lib has an inconsistant use of
'require' and doesn't seem to work well with the packaging
step (rollup) of the github action.

Hopefully this upgrade (and change of lib) should let us a clean
upgrade of the GH action to an ESM version 🤞
@paulRbr paulRbr force-pushed the upgrade-dependencies branch 3 times, most recently from a95208f to 70f9e88 Compare March 14, 2025 12:28
paulRbr added 5 commits March 14, 2025 13:30
Down the rabbit hole of ESM...
Instead of manually setting an extra env var for a custom user agent,
let's properly use oclif's configuration to be able to read the
current repos' package.json.

Thus the user agent sent by the github action will include the
package.json's `name` value.
@paulRbr paulRbr force-pushed the upgrade-dependencies branch from 70f9e88 to 22fe171 Compare March 14, 2025 12:31
@paulRbr paulRbr force-pushed the upgrade-dependencies branch from 22fe171 to 5d86869 Compare March 14, 2025 15:15
@paulRbr
Copy link
Member Author

paulRbr commented Mar 14, 2025

CI is green, and full integration testing of this branch seems to work fine 🎉 🎉 🎉 (😌 pfiou it was a much longer road than expected 😅)

@paulRbr paulRbr merged commit ae1fdf6 into bump-sh:master Mar 14, 2025
4 checks passed
@paulRbr paulRbr deleted the upgrade-dependencies branch March 17, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade bump-cli dependency to latest (at least 2.8.2) Upgrade to Node 20
4 participants