Skip to content

Conversation

@stalniy
Copy link
Contributor

@stalniy stalniy commented Jan 26, 2026

Why

in order to use the GH_TOKEN to fetch files content because direct fetch API call timeouts sometimes

Summary by CodeRabbit

  • Chores

    • Updated @octokit/rest dependency to v22.0.1 for enhanced compatibility
    • Optimized internal template fetching service configuration
  • Tests

    • Refactored test suite to align with updated dependencies and improved internal handling

✏️ Tip: You can customize this high-level summary in your review settings.

@stalniy stalniy requested a review from a team as a code owner January 26, 2026 23:06
"@cosmjs/tendermint-rpc": "~0.36.1",
"@dotenvx/dotenvx": "^1.9.0",
"@hono/node-server": "1.13.7",
"@hono/otel": "~0.4.0",
Copy link
Contributor

@github-actions github-actions bot Jan 26, 2026

Choose a reason for hiding this comment

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

🔄 Carefully review the package-lock.json diff

Resolve the comment if everything is ok

* node_modules/@octokit/auth-token                                                         2.5.0 -> 6.0.0
* node_modules/@octokit/endpoint                                                           6.0.12 -> 11.0.2
* node_modules/@octokit/graphql                                                            4.8.0 -> 9.0.3
* node_modules/@octokit/openapi-types                                                      12.11.0 -> 27.0.0
* node_modules/@octokit/plugin-paginate-rest                                               2.21.3 -> 14.0.0
* node_modules/@octokit/plugin-request-log                                                 1.0.4 -> 6.0.0
* node_modules/@octokit/plugin-rest-endpoint-methods                                       5.16.2 -> 17.0.0
* node_modules/@octokit/request-error                                                      2.1.0 -> 7.1.0
* node_modules/@octokit/request                                                            5.6.3 -> 10.0.7
* node_modules/@octokit/rest                                                               18.12.0 -> 22.0.1
* node_modules/@octokit/types                                                              6.41.0 -> 16.0.0
+ node_modules/@octokit/core/node_modules/before-after-hook                                4.0.0   
+ node_modules/@octokit/request/node_modules/universal-user-agent                          7.0.3   
+ node_modules/fast-content-type-parse                                                     3.0.0   
- apps/api/node_modules/@swc/helpers                                                       0.5.18  
- node_modules/git-semver-tags/node_modules/conventional-commits-filter                    5.0.0   
- node_modules/git-semver-tags/node_modules/conventional-commits-parser                    6.2.1   
- node_modules/tsup/node_modules/yaml                                                      2.8.2   

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

The PR upgrades @octokit/rest to ^22.0.1 and refactors TemplateFetcherService to remove external fetch dependency, replacing it with octokit-based content retrieval. Jest configuration is updated to selectively transform specific packages during testing.

Changes

Cohort / File(s) Summary
Jest Configuration
apps/api/jest.config.js
Added transformIgnorePatterns to selectively transform specific npm packages (@octokit, universal-user-agent, before-after-hook) while ignoring other node_modules during Jest test execution.
Dependency Update
apps/api/package.json
Updated @octokit/rest from ^18.12.0 to ^22.0.1.
Service Implementation
apps/api/src/template/services/template-fetcher/template-fetcher.service.ts
Removed fetch parameter from constructor; internalized content fetching through new private fetchFileContent method using Octokit REST calls; introduced templateSource parameter to internal methods for repository context.
Service Consumer
apps/api/src/template/services/template-gallery/template-gallery.service.ts
Updated TemplateFetcherService constructor invocation to remove fetch argument, passing only templateProcessor, logger, and octokit.
Test Updates
apps/api/src/template/services/template-fetcher/template-fetcher.service.spec.ts
Removed fetch-mock dependency; refactored test setup to pass only templateProcessor, logger, and octokit to TemplateFetcherService constructor; consolidated mocking to use path-based content simulation and octokit-driven responses.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • baktun14

Poem

🐰 Hop-hop, dependencies align,
Fetch is gone, octokit will shine,
Tests now dance with paths so clear,
Cleaner code brings cheer-cheer-cheer! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main change: replacing direct fetch API calls with octokit.getContent for fetching file contents. This is a concise and clear summary of the primary modification across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 26, 2026

❌ 17 Tests Failed:

Tests completed Failed Passed Skipped
2084 17 2067 1
View the top 3 failed test(s) by shortest run time
TemplateGalleryService buildTemplateGalleryCache builds cache from template gallery and writes to file
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:160:52)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getCachedTemplateGallery throws error when cache file not found
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:133:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateById caches parsed template in memory
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:208:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateById returns null and logs error when template content is invalid JSON
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:225:43)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateById returns null when template ID not found in cache
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:193:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateById returns template when found in cache
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:177:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery returns cached templates from filesystem when cache file exists
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:49:52)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery throws error when fetch fails
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:34:52)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery throws error when github request for latest commit sha fails and no cached files exist
Stack Traces | 0s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:102:52)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getCachedTemplateGallery caches result in memory on subsequent calls
Stack Traces | 0.001s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:141:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getCachedTemplateGallery returns cached gallery from file
Stack Traces | 0.001s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:116:35)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery fetches templates from all repositories and merges them
Stack Traces | 0.001s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:18:44)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery handles concurrent calls by sharing the same promise
Stack Traces | 0.001s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:64:44)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
TemplateGalleryService getTemplateGallery returns cached gallery on filesystem if github request for latest commit sha fails
Stack Traces | 0.001s run time
TypeError: beforeAfterHook.Collection is not a constructor
    at new Octokit (.../console/console/node_modules/@.../core/dist-node/index.js:52:18)
    at new OctokitWithDefaults (.../console/console/node_modules/@.../core/dist-node/index.js:147:9)
    at getOctokit (.../services/template-gallery/template-gallery.service.ts:257:10)
    at new getOctokit (.../services/template-gallery/template-gallery.service.ts:36:74)
    at setup (.../services/template-gallery/template-gallery.service.spec.ts:257:21)
    at Object.<anonymous> (.../services/template-gallery/template-gallery.service.spec.ts:79:60)
    at Promise.then.completed (.../console/console/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../console/console/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (.../console/console/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at _runTest (.../console/console/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../console/console/node_modules/jest-circus/build/run.js:121:9)
    at run (.../console/console/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../console/console/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../console/console/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../console/console/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../console/console/node_modules/jest-runner/build/testWorker.js:106:12)
Addresses API GET /v1/addresses/{address}/deployments/{skip}/{limit} returns 400 when skip is not a number
Stack Traces | 0.055s run time
Error: 
    at Query.run (.../dialects/postgres/query.js:76:25)
    at .../sequelize/src/sequelize.js:650:28
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at PostgresQueryInterface.insert (.../dialects/abstract/query-interface.js:795:21)
    at Lease.save (.../sequelize/src/model.js:4154:35)
    at lease.create (.../sequelize/src/model.js:2305:12)
    at createLease (.../test/seeders/lease.seeder.ts:6:10)
    at async Promise.all (index 1)
    at setup (.../test/functional/addresses.spec.ts:357:5)
    at Object.<anonymous> (.../test/functional/addresses.spec.ts:191:27)
Addresses API GET /v1/addresses/{address}/deployments/{skip}/{limit} returns 400 when address is not a valid akash address
Stack Traces | 0.058s run time
Error: 
    at Query.run (.../dialects/postgres/query.js:76:25)
    at .../sequelize/src/sequelize.js:650:28
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at PostgresQueryInterface.insert (.../dialects/abstract/query-interface.js:795:21)
    at Lease.save (.../sequelize/src/model.js:4154:35)
    at lease.create (.../sequelize/src/model.js:2305:12)
    at createLease (.../test/seeders/lease.seeder.ts:6:10)
    at async Promise.all (index 1)
    at setup (.../test/functional/addresses.spec.ts:357:5)
    at Object.<anonymous> (.../test/functional/addresses.spec.ts:183:7)
Addresses API GET /v1/addresses/{address}/transactions/{skip}/{limit} returns 400 when limit is not a number
Stack Traces | 0.143s run time
Error: 
    at Query.run (.../dialects/postgres/query.js:76:25)
    at .../sequelize/src/sequelize.js:650:28
    at processTicksAndRejections (node:internal/process/task_queues:103:5)
    at PostgresQueryInterface.insert (.../dialects/abstract/query-interface.js:795:21)
    at Lease.save (.../sequelize/src/model.js:4154:35)
    at lease.create (.../sequelize/src/model.js:2305:12)
    at createLease (.../test/seeders/lease.seeder.ts:6:10)
    at async Promise.all (index 1)
    at setup (.../test/functional/addresses.spec.ts:357:5)
    at Object.<anonymous> (.../test/functional/addresses.spec.ts:156:27)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

baktun14
baktun14 previously approved these changes Jan 26, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/api/src/template/services/template-fetcher/template-fetcher.service.ts (1)

83-101: Add type guard for response.data in fetchFileContent

mediaType.format="raw" is the correct way to fetch raw content in Octokit v22, but String(response.data) can mask errors if the response unexpectedly returns a non-string value. Add a type check before returning, matching the pattern used in fetchDirectoryContent:

Suggested change
-    if (response.status !== 200) {
-      throw new Error(`Failed to fetch content from ${owner}/${repo}/${path}`);
-    }
-
-    return String(response.data);
+    if (response.status !== 200 || typeof response.data !== "string") {
+      throw new Error(`Failed to fetch content from ${owner}/${repo}/${path}`);
+    }
+
+    return response.data;
🤖 Fix all issues with AI agents
In `@apps/api/package.json`:
- Line 66: The dependency bump to "@octokit/rest": "^22.0.1" requires Node.js
≥20 and ESM-first imports; verify the runtime and code accordingly by ensuring
the project's Node target is >=20 (update runtime config/CI), convert any
CommonJS requires of "@octokit/rest" to ESM-style imports (e.g., replace
require(...) with import { Octokit } from "@octokit/rest" where used), and if
this is a TypeScript project update tsconfig.json (adjust "module" and
"moduleResolution" to "node16" or "nodenext" as appropriate) so TypeScript
resolves the package's conditional exports; check all usages of Octokit and
build/CI settings to prevent runtime import/resolution failures.

"@hono/swagger-ui": "0.4.1",
"@hono/zod-openapi": "0.18.4",
"@octokit/rest": "^18.12.0",
"@octokit/rest": "^22.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

@octokit/rest v22 breaking changes Node.js requirements

💡 Result:

@octokit/rest v22 effectively raises the minimum Node.js version to 20+ (i.e., Node 18 is no longer supported), because the v22 line updates to the latest Octokit monorepo major, which pulls in dependencies like @octokit/core@7 that declare engines: { node: ">= 20" }. [1][2]

Other practical “breaking” upgrade notes you’re likely to hit moving to v22:

  • ESM import usage is the documented/default usage (import { Octokit } from "@octokit/rest";), not require(...). [3]
  • Because the package uses conditional exports, TypeScript projects may need tsconfig.json updates ("moduleResolution": "node16" and "module": "node16"). [4]

Sources:
[1] https://app.unpkg.com/%40octokit/core%407.0.5/files/package.json
[2] https://github.com/octokit/rest.js/releases/tag/v22.0.1
[3] https://octokit.github.io/rest.js/v22/
[4] https://github.com/octokit/rest.js/


Verify Node.js 20+ requirement and ESM compatibility before merging

v22 is a breaking change:

  • Minimum Node.js version: Raises requirement from 18 to 20+ (v22 depends on @octokit/core@7 which requires Node ≥ 20)
  • Module system: ESM imports (import { Octokit } from "@octokit/rest") are now the default; CommonJS require() usage is not the documented path
  • TypeScript projects: May need tsconfig.json updates ("moduleResolution": "node16" and "module": "node16") due to conditional exports

Confirm the app's Node.js target version supports 20+, verify ESM imports are correct, and update TypeScript config if needed.

🤖 Prompt for AI Agents
In `@apps/api/package.json` at line 66, The dependency bump to "@octokit/rest":
"^22.0.1" requires Node.js ≥20 and ESM-first imports; verify the runtime and
code accordingly by ensuring the project's Node target is >=20 (update runtime
config/CI), convert any CommonJS requires of "@octokit/rest" to ESM-style
imports (e.g., replace require(...) with import { Octokit } from "@octokit/rest"
where used), and if this is a TypeScript project update tsconfig.json (adjust
"module" and "moduleResolution" to "node16" or "nodenext" as appropriate) so
TypeScript resolves the package's conditional exports; check all usages of
Octokit and build/CI settings to prevent runtime import/resolution failures.

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​dotenvx/​dotenvx@​1.14.09710010095100

View full report

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.

3 participants