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

fix: use octokit.rest interface for github #32

Merged
merged 1 commit into from
May 29, 2024

Conversation

erikburt
Copy link
Contributor

@erikburt erikburt commented May 28, 2024

I broke this with the node20 upgrade in #31. The octokit.pulls, octokit.checks objects are now nested inside octokit.rest, which broke existing usages. This was not uncovered with unit tests because the jest mocking covered this.

This PR:

  1. switches all github calls to use octokit.rest
  2. updates the unit tests accordingly

Testing

Tested locally this time by running things like:

DEBUG="true" INPUT_TOKEN="github_pat_<pat>" GITHUB_REPOSITORY="adRise/update-pr-branch" INPUT_REQUIRE_AUTO_MERGE_ENABLED="false" INPUT_REQUIRE_PASSED_CHECKS="false" INPUT_BASE="master" INPUT_REQUIRED_APPROVAL_COUNT="0" node dest/index.js 

Example of errors before this fix:

TypeError: Cannot read properties of undefined (reading 'list')
TypeError: Cannot read properties of undefined (reading 'updateBranch') 
TypeError: Cannot read properties of undefined (reading 'checks')

@erikburt
Copy link
Contributor Author

@zhiyelee Sorry for breaking it.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 9274075280

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9249736164: 0.0%
Covered Lines: 98
Relevant Lines: 98

💛 - Coveralls

@zhiyelee
Copy link
Collaborator

@erikburt Thanks for the report and fix. No worries. Will take a look and release a new patch release soon

@clww clww merged commit 5d27394 into adRise:master May 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants