Skip to content

Tool: Retire.js (Static Analysis - Security)#127

Closed
maxwelljhuang wants to merge 68 commits into
mainfrom
tool-testing-retirejs
Closed

Tool: Retire.js (Static Analysis - Security)#127
maxwelljhuang wants to merge 68 commits into
mainfrom
tool-testing-retirejs

Conversation

@maxwelljhuang

Copy link
Copy Markdown

Overview
Retire.js scans JS projects for dependencies with known vulnerabilities and checks node_modules against a maintained db of CVEs (common vulnerabilities and exposures).

Installation
npm install retire
Screenshot 2026-03-11 at 6 18 14 PM

Running the tool on the repo
Screenshot 2026-03-11 at 6 48 32 PM

The tool successfully scanned the project and reported no known vulnerabilities in our dependencies

Pros

  • very easy to setup; a single npm install command was sufficient
  • ease of use, npx retire --path scans the entire project
  • CI-friendly, can easily be added to GitHub actions workflow
  • multiple output formats: JSON, text, etc.
  • Modern JS compatible, works on Node.js without parser issues

Cons

  • quite a limited scope, only detects known CVE's in third-party dependencies
  • No fix suggestions, only flags vulnerabilities
  • DB dependent, can only catch vulnerabilities added to its db
  • Minimal output on clean cans
  • overlapping functionality with npm audit

Bryanzzy1 and others added 30 commits February 5, 2026 20:17
Updated require statements in test/topic-resolution.js to use '../src/' instead of '../' to correctly resolve module imports for database, topics, posts, privileges, user, and categories modules.
- Add PUT /api/v3/topics/:tid/resolve endpoint (admin/mod only) to mark
  topics as resolved, with idempotent behavior to preserve timestamps
- Add DELETE /api/v3/topics/:tid/resolve endpoint (admin/mod only) to
  mark topics as unresolved, clearing resolution metadata
- Add ?resolved=true/false query parameter to category topic listings
  for filtering by resolution status
- Resolution metadata (isResolved, resolvedAt, resolvedBy) is returned
  in GET /api/v3/topics/:tid responses via existing topic data fields
- Add comprehensive tests covering endpoint auth, resolve/unresolve
  behavior, metadata in GET responses, and category filtering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add PUT/DELETE /api/v3/topics/:tid/resolve endpoints for marking
  topics as resolved/unresolved (admin/mod only, with idempotent resolve)
- Add ?resolved=true/false query parameter to category topic listings
- Add isResolved, resolvedAt, resolvedBy to OpenAPI TopicObject schema
  to fix test/api.js schema validation
- Add tests for endpoint auth, resolve/unresolve, metadata in GET
  responses, and category filtering
- Add PUT/DELETE /api/v3/topics/:tid/resolve endpoints for marking
  topics as resolved/unresolved (admin/mod only, with idempotent resolve)
- Add ?resolved=true/false query parameter to category topic listings
- Add isResolved, resolvedAt, resolvedBy to OpenAPI TopicObject schema
  to fix test/api.js schema validation
- Fix test setup: use groups.join for admin, 'moderate' privilege for mod
- Add tests for endpoint auth, resolve/unresolve, metadata in GET
  responses, and category filtering
resolvedAt is listed in intFields (src/topics/data.js), so
db.parseIntFields converts null values to 0. Updated 4 assertions
in test/topic-resolution.js to match this behavior.
- Add missing resolve.yaml write endpoint spec to prevent
  test/api.js "not defined in schema docs" failure
- Register resolve path in write.yaml
- Fix resolvedBy test to use value assertion instead of
  hasOwnProperty (string fields absent from hash until set)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Redis db.setObject silently drops null values, so setting
resolvedAt: null and resolvedBy: null had no effect. Use
db.deleteObjectFields to properly remove the fields instead.
Add REST API endpoints for topic resolution and category filtering
ascharpf28 and others added 29 commits February 10, 2026 23:05
receives a popup notification and
refactored the reply notification code in create
- Create assignment_tags table with id, name, color, category
- Create post_tags junction table for post-tag relationships
- Add indexes for performance and foreign key constraints with cascade delete
- Implement tag CRUD operations with PostgreSQL
- Add post-tag relationship management
- Restrict modifications to instructors/admins
- Posts accept optional tags array on creation
- Post responses include assignmentTags field
- Category topics filterable by ?assignmentTags query param
- Admin page for creating/editing/deleting tags with color picker
- Reusable tag selector module for post composer
- Tag display module with colored badges
- Add tag chips display on posts with colored badges and hover effects
- Make tag chips clickable to filter topic lists by selected tags
- Add multi-select dropdown filter in category/topic list views
- Auto-load assignment tags module on relevant pages (category, topic, recent, etc.)
- Include responsive styles for mobile devices
- Support clearing filters to show all posts
Testing:
- Create comprehensive test suite (600+ lines) covering:
  * Tag CRUD operations with authorization guards
  * Tag assignment and removal on posts
  * Single and multiple tag filtering with pagination
  * Full integration workflow tests
  * Edge cases: cascade deletes, invalid IDs, concurrent operations
- Test file: test/assignment-tags.js
- All tests verify instructor/admin permissions correctly

Documentation:
- API documentation with request/response schemas (docs/assignment-tags-api.md)
  * 15+ endpoints fully documented
  * TypeScript-style data models
  * Error codes and examples
  * Rate limiting information

- Database schema documentation (docs/assignment-tags-database-schema.md)
  * ER diagrams using Mermaid
  * Table schemas with indexes
  * Common query patterns
  * Performance optimization tips
  * Backup/restore procedures

- User guide for instructors (docs/assignment-tags-user-guide.md)
  * Step-by-step instructions
  * Best practices and examples
  * Troubleshooting guide
  * Quick reference card

- Developer onboarding guide (docs/assignment-tags-developer-guide.md)
  * Architecture overview with diagrams
  * Complete file structure walkthrough
  * Development setup and debugging
  * Extension patterns and examples
  * Contributing guidelines

CHANGELOG:
- Add v1.20.0 entry documenting all features, tests, and documentation
… support

Replace raw PostgreSQL queries with NodeBB's database abstraction layer
(db.setObject, db.sortedSetAdd, etc.) so assignment tags work on any
supported database (MongoDB, Redis, PostgreSQL).

Also add assignment-tags route to admin privilege map to fix Access Denied
on
Add filter:composer.submit hook to send selected assignment tags with
post creation. Add Edit Assignment Tags modal in post tools menu.
Fix module loading by requiring forum/assignment-tags from app.load()
instead of dead loader IIFE. Fix route ordering, hook name
(composer.enhanced not composer.enhance), and field name
(data.assignmentTags not data.tags) in posts/create.js
- Remove unused  variable in admin assignment-tags
- Replace undefined  with jQuery  API
- Remove unused  import in modules/assignment-tags
- Fix function-paren-newline style violation in categories/topics
- Remove unused  function in posts/data
- Replace await-in-loop with single Promise.all in topic resolution upgrade
- Remove unused currentEditingId variable in admin assignment-tags
- Replace undefined bootstrap.Modal with jQuery .modal() API
- Remove unused alerts import in modules/assignment-tags
- Fix function-paren-newline style violation in categories/topics
- Remove unused addAssignmentTagsToPost function in posts/data
- Replace await-in-loop with single Promise.all in topic resolution upgrade
- Add assignmentTags field to PostDataObject OpenAPI schema
- Remove unused currentEditingId variable in admin assignment-tags
- Replace undefined bootstrap.Modal with jQuery .modal() API
- Remove unused alerts import in modules/assignment-tags
- Fix function-paren-newline style violation in categories/topics
- Remove unused addAssignmentTagsToPost function in posts/data
- Replace await-in-loop with single Promise.all in topic resolution upgrade
- Add assignmentTags to PostDataObject, TopicObject, and replies schemas
… docs for assignment-tags routes

- Remove unused currentEditingId variable in admin assignment-tags
- Replace undefined bootstrap.Modal with jQuery .modal() API
- Remove unused alerts import in modules/assignment-tags
- Fix function-paren-newline style violation in categories/topics
- Remove unused addAssignmentTagsToPost function in posts/data
- Replace await-in-loop with single Promise.all in topic resolution upgrade
- Add assignmentTags field to PostDataObject, TopicObject, replies, and category schemas
- Add OpenAPI schema definitions for all assignment-tags write API routes
Assignment tag system for organizing course posts
Implemented popup notifications when someone responds to your message

Code Review(completed by Alexandra)-Popup Notifications Feature

I think this was a very well implemented feature and adds a lot of value to the platform.

Done well:
Correct trigger point: notification logic runs after post save and only for replies
Self-reply prevention: explicit isSelfReply check before emitting.
Clickable popup: includes topicId + postId so the client can navigate to the exact reply.

Suggestions:
Avoid using the global alert()
In public/src/sockets.js, alerts.alert(params) is called and then call alert({ ... }) again. I’d recommend using NodeBB’s alerts module for consistency or one or the other.
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.

4 participants