Repository navigation
Demo - #26
Demo#26
Conversation
chore: update workflow to include `demo` branch in deployment checks
Fix demo url
…fest-build-plugin-demo
…ild-plugin-demo # Conflicts: # bun.lock # dist/plugin/index.js
…demo' into codex/fix/manifest-build-plugin-demo
…in-demo fix: sync manifest workflow metadata for issue 27
…gration chore: point workflow to ubiquity-os action branch (issue #320)
📝 WalkthroughWalkthroughThis PR updates configurations, dependencies, and source code across the project. Knip analysis is narrowed to TypeScript files under Possibly related PRs
🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
tests/main.test.ts (1)
50-50: Consider why this test needs 2.5x the default timeout.Default
testTimeoutin jest.config.ts is 20s. A 50s override suggests potential slow operations or flaky behavior. If consistently needed, consider increasing the global timeout instead.package.json (1)
26-27: Redundant scripts:jest:testandtestare identical.Both run
jest --coverage. Consider keeping onlytestor documenting why both exist.src/index.ts (1)
26-36: Consider adding type annotation for better error context.The function implicitly returns
Promise<any>from the Octokit response. Adding explicit return type improves readability.♻️ Add explicit return type
-async function getGitHubUser(context: Context) { +async function getGitHubUser(context: Context): Promise<{ login: string }> {jest.config.ts (1)
16-16: EmptytransformIgnorePatternstransforms all node_modules, impacting test performance.Excluding node_modules (except specific ESM packages) is a standard Jest optimization. Found 2 ESM packages in node_modules:
knipandeslint-plugin-check-file.Suggested pattern to transform only `@ubiquity-os` ESM packages
- transformIgnorePatterns: [], + transformIgnorePatterns: [ + "node_modules/(?!(`@ubiquity-os`)/)" + ],
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 83c3cef8-23bb-47ad-9738-0fd3937a234b
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (8)
.github/knip.ts.github/workflows/jest-testing.yml.github/workflows/update-configuration.ymljest.config.tspackage.jsonsrc/index.tssrc/types/typeguards.tstests/main.test.ts
💤 Files with no reviewable changes (1)
- src/types/typeguards.ts
| } catch (err) { | ||
| throw context.logger.error(BAD_CREDENTIALS_MESSAGE, { err }); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what logger.error returns in `@ubiquity-os/ubiquity-os-logger`
ast-grep --pattern 'error($$$) {
$$$
return $_;
}'Repository: ubiquity-os/command-demo
Length of output: 50
🌐 Web query:
Does @ubiquity-os/ubiquity-os-logger error method return an Error object?
💡 Result:
No, the @ubiquity-os/ubiquity-os-logger error method does not return an Error object. Evidence from Ubiquity OS plugin SDK documentation and usage shows the logger provides methods like logger.ok("Done"), which are used for logging messages, not throwing or returning Error instances. In error contexts from GitHub issues (e.g., command-start-stop #136), errors are standard JavaScript Error objects ("name": "Error") passed to logging, indicating the logger.error likely logs the error rather than returning one. No sources explicitly state or demonstrate the error method returning an Error object; it aligns with standard logger patterns where log methods return void or log metadata.
Citations:
- 1: Broken Errors Posting on Wrong Threads ubiquity-os-marketplace/command-start-stop#136
- 2: https://github.com/ubiquity-os/plugin-sdk
🏁 Script executed:
# Find references to context.logger.error to understand how it's used
rg "logger\.error" -A 2 -B 2 --max-count 5Repository: ubiquity-os/command-demo
Length of output: 715
🏁 Script executed:
# Check if there's a logger configuration or type definitions in the repo
fd -t f "logger" --max-one-result | head -20Repository: ubiquity-os/command-demo
Length of output: 301
🏁 Script executed:
# Check package.json for the `@ubiquity-os/ubiquity-os-logger` dependency
cat package.json | grep -A 2 -B 2 "ubiquity-os-logger"Repository: ubiquity-os/command-demo
Length of output: 220
Fix throwing logger.error() calls — logger.error() returns void, not Error.
The code at lines 33-35 throws context.logger.error(), but this method returns void (confirmed via package documentation). Throwing undefined breaks exception handling and loses stack traces. This pattern also appears in src/handlers/run-demo.ts.
Instead, log first then throw a proper Error:
Example fix
} catch (err) {
context.logger.error(BAD_CREDENTIALS_MESSAGE, { err });
throw new Error(BAD_CREDENTIALS_MESSAGE);
}
Resolves #