chore: upgrade octokit to v5 and probot to v14#484
Conversation
|
note: this should be run locally to confirm everything is working |
| repository: Repository | ||
| }>(getBranchProtectionRulesetGQL, { | ||
| owner: context.payload.repository.owner.login, | ||
| owner: context.payload.repository.owner!.login, |
There was a problem hiding this comment.
This case isn't just logging, so may need better error handling unless we're strongly confident this will always be defined
There was a problem hiding this comment.
Could potentially make a utility function that handles the value being undefined and reuse that across the uses in the file
There was a problem hiding this comment.
updated this -- can you take a look?
| branch: pattern, | ||
| enforce_admins: true, | ||
| owner: context.payload.repository.owner.login, | ||
| owner: context.payload.repository.owner!.login, |
There was a problem hiding this comment.
updated -- can you take a look?
| @@ -0,0 +1,12 @@ | |||
| { | |||
| "extends": "./tsconfig.json", | |||
There was a problem hiding this comment.
Is separate tsconfig needed? As part of #435 I updated tsconfig to include tests. Build only needs a separate tsconfig to adjust the default settings, but does test also need that? If not, I would revert this change.
riley-kohler
left a comment
There was a problem hiding this comment.
I'm still doing further testing but ran into some initial issues that were causing the application to break that I suggested fixes for.
Co-authored-by: Riley Kohler <code@rileykohler.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Riley Kohler <code@rileykohler.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Riley Kohler <code@rileykohler.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Riley Kohler <code@rileykohler.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Riley Kohler <code@rileykohler.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
0948a0e to
d654302
Compare
Co-authored-by: Will Slattum <wrslatz@gmail.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Will Slattum <wrslatz@gmail.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
Co-authored-by: Will Slattum <wrslatz@gmail.com> Signed-off-by: Mio Diaz <themio@themioshow.com>
- rules.ts: replace owner\!.login with owner?.login in log calls; add explicit undefined guard + throw in createBranchProtectionRuleset and createBranchProtectionREST where undefined would cause a runtime error - webhooks.ts: remove tslog custom logger; Probot v14 uses pino internally and is incompatible with tslog custom log adapters - controller.ts: replace @ts-expect-error suppressed custom-property calls with the correctly-typed octokit 5 method names (customPropertiesForReposGetRepositoryValues, customPropertiesForReposGetOrganizationDefinitions, customPropertiesForReposCreateOrUpdateOrganizationDefinition) Co-Authored-By: Claude Code
- listMirrorsHandler: return { mirrors, mirrorDeletionEnabled } shape
added in upstream main
- deleteMirrorHandler: add DISABLE_MIRROR_DELETION early guard added
in upstream main
Co-Authored-By: Claude Code
…nflicts Co-Authored-By: Claude Code
- Update .gitignore to use tsconfig.tsbuildinfo instead of *.tsbuildinfo - Add mirrorDeletionEnabled flag and Tooltip to fork page delete action - Remove as any casts from DataTable in page.tsx Co-Authored-By: Claude Code
|
Found Error: src/app/[organizationId]/forks/[forkId]/page.tsx:571
Type 'unknown[]' is not assignable to type 'UniqueRow[]'Cause: Fix: type SearchRepo = Awaited<ReturnType<Octokit['rest']['search']['repos']>>['data']['items'][number]
// ...
(response: { data: SearchRepo[] }) => response.data, |
wrslatz
left a comment
There was a problem hiding this comment.
🚢, assuming manual testing looks good
| }, | ||
| }), | ||
| // Probot v14 requires a pino logger so custom logging has been removed | ||
| // In the future it is worth considering replacing tslog with pino entirely |
There was a problem hiding this comment.
Yeah, we should file an issue to track this
Pull Request
This PR will update
OctokitandProbotalong with updating any files based on the various majors we are updating to.Closes #329
fixed merge conflicts from #477
Proposed Changes
Upgrades
Probot 13 → 14.3.2andOctokit 3 → 5,aligning the entire@octokit/coredependency tree to a single dedupedv7.0.6.Key changes:
Type workarounds
Why:
@primer/react's DataTable component usesObjectPaths<Data>for the field prop type. UndermoduleResolution: "bundler"(from @tsconfig/next), the generic Data parameter isn't inferred from the data prop and falls back to UniqueRow, which only exposes "id" as a valid field. This is a known issue with@primer/react's draft DataTable generics.When to remove: When
@primer/reactupdates DataTable to support moduleResolution: "bundler", or when DataTable moves out of drafts with fixed generic inference.Why:
rest.orgs.getAllCustomProperties()andrest.orgs.createOrUpdateCustomProperty()exist in the GitHub API and work at runtime, but octokit 5's bundled REST types (@octokit/plugin-rest-endpoint-methods) have not yet added these endpoints to their type definitions.When to remove: When
@octokit/plugin-rest-endpoint-methodsadds the custom properties endpoints tracked upstream | tracked locally in #485Why: The visibility parameter for repos.createInOrg only types "private" | "public" in octokit 5, but "internal" is a valid value for GitHub Enterprise/GHEC orgs.
When to remove: When octokit's REST types add "internal" to the visibility union.
PR #477 Follow-ups
useForks.tsx:19—satisfiesoverasforks/[forkId]/page.tsx:570—satisfiesoverascontroller.ts:37— tracking issuetsconfig.test.json— is it needed?Readiness Checklist
Author/Contributor
npm run formatand fix any formatting issues that have been introducednpm run lintand fix any linting issues that have been introducednpm run testand run tests