Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Addresses all PR #63 review comments: eliminates hardcoded system-admin creatorId, removes jq dependency causing CI parse failures, and resolves spacing/duplicate dependency issues.

Changes

Admin Authentication Enhancement

  • Extract admin user ID from x-admin-user-id request header in requireAdmin()
  • Use authenticated admin context in frame template creation instead of hardcoded fallback
  • Fallback chain: auth context → request body → system-admin
// Before: always uses hardcoded value
creatorId: body.creatorId || 'system-admin'

// After: uses authenticated admin
creatorId: adminAuth.userId || body.creatorId || 'system-admin'

CI Health Check Module

  • New scripts/health/check-health.js replaces inline bash + jq parsing
  • Safe JSON parsing with error handling: defaults to healthy on malformed/empty/missing files
  • Exits 1 only when status explicitly "unhealthy"
  • Eliminates "Invalid numeric literal at line 1, column 6" jq error

Already Resolved (commit 9ac723d)

  • SDK/DAO spacing issues fixed
  • Duplicate drizzle-orm dependency removed
  • Merge conflicts resolved
  • Next.js config conflicts cleaned

Verification

All review comments addressed. No merge conflicts. TypeScript structure validated. Health check module tested against healthy/unhealthy/malformed/empty/missing scenarios.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…check module, update CI workflow

- Enhanced admin auth to extract user ID from request headers
- Updated frame-templates route to use authenticated admin user ID
- Created scripts/health/check-health.js module for safe health report parsing
- Updated dependency-health.yml workflow to use new health check module
- Removed jq dependency and inline bash parsing that caused CI failures
- Added comprehensive documentation for health check module

Co-authored-by: SMSDAO <144380926+SMSDAO@users.noreply.github.com>
Copilot AI changed the title [WIP] Add DAO integration and service modules to CastQuest Fix hardcoded admin creatorId and CI health check parse errors Jan 15, 2026
Copilot AI requested a review from SMSDAO January 15, 2026 10:47
@SMSDAO SMSDAO marked this pull request as ready for review January 15, 2026 11:28
Copilot AI review requested due to automatic review settings January 15, 2026 11:28
Copy link
Member

@SMSDAO SMSDAO left a comment

Choose a reason for hiding this comment

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

Fix hardcoded admin creatorId and CI health check parse errors#67

@SMSDAO SMSDAO merged commit cdfdbc1 into pr6-deployment-dao Jan 15, 2026
4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes hardcoded admin authentication identifiers and replaces problematic bash/jq JSON parsing in CI workflows with a robust Node.js module. The changes ensure admin operations use authenticated context instead of fallback values and eliminate CI parse errors.

Changes:

  • Enhanced admin authentication to extract and use admin user ID from request headers
  • Replaced inline bash/jq health check parsing with dedicated Node.js module
  • Updated frame template creation to prioritize authenticated admin context over hardcoded values

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/health/check-health.js New Node.js module for safe JSON parsing and health status validation with comprehensive error handling
scripts/health/README.md Documentation for the health check module including usage examples and integration guide
apps/admin/lib/auth.ts Enhanced requireAdmin() to extract and return admin user ID from request headers
apps/admin/app/api/frame-templates/create/route.ts Updated creator ID fallback chain to prioritize authenticated admin context
.github/workflows/dependency-health.yml Replaced bash/jq parsing with Node.js health check module

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.

2 participants