Skip to content

feat(tags): add stream tags/labels for organization (#727) - #908

Open
Chekuyermu wants to merge 1 commit into
ritik4ever:mainfrom
Chekuyermu:fix/727-stream-tags
Open

feat(tags): add stream tags/labels for organization (#727)#908
Chekuyermu wants to merge 1 commit into
ritik4ever:mainfrom
Chekuyermu:fix/727-stream-tags

Conversation

@Chekuyermu

Copy link
Copy Markdown

Overview

This PR adds a tags/labels system for streams, allowing creators to assign up to 5 descriptive tags (e.g., payroll, vesting, grant) for organization and filtering.

Related Issue

Closes #727

Changes

[ADD] backend/migrations/005_add_stream_tags.sql

  • Adds tags TEXT column to streams and stream_archive tables

[ADD] backend/migrations/005_add_stream_tags.down.sql

  • Rollback script for the tags migration

[MODIFY] backend/src/services/streamStore.ts

  • Added tags field to StreamInput, StreamRecord, and StreamRow interfaces
  • Updated rowToRecord() to parse tags from JSON
  • Updated upsertStream() to store tags as JSON
  • Updated createStream() to pass tags from input to record
  • Updated archiveOldStreams() to persist tags in stream_archive

[MODIFY] backend/src/validation/schemas.ts

  • Added tagsSchema: array of strings, max 5 tags, max 50 chars each
  • Added optional tags field to createStreamPayloadSchema

[MODIFY] backend/src/index.ts

  • Added tag query parameter to listStreamsQuerySchema
  • Added tag-based filtering to all 5 stream listing endpoints:
    • GET /api/streams?tag=payroll
    • GET /api/streams/sender/:address
    • GET /api/streams/recipient/:address
    • GET /api/recipients/:accountId/streams
    • GET /api/senders/:accountId/streams

[MODIFY] backend/src/services/migrations.test.ts

  • Added tags to expected streams columns
  • Updated rollback test to account for migration 5

Verification Results

✅ Migrations test: 4/4 passed
✅ Swagger test: 2/2 passed
✅ Validation tests: 40/41 passed (1 pre-existing failure unrelated to this change)
✅ TypeScript: no new errors (pre-existing errors unchanged)
✅ All tags feature tests pass

Acceptance Criteria

Criteria Status
Creator can set up to 5 tags on a stream ✅ Max 5 enforced via Zod validation
GET /api/streams?tag=payroll filters by tag ✅ Case-insensitive filter applied
Tags stored in SQLite array column ✅ JSON array in TEXT column
Tag filter works with other filters ✅ Applies after all other filters
Max 5 tags enforced ✅ Zod max(5) constraint
Tags returned in stream response ✅ Parsed from DB in rowToRecord

Closes ritik4ever#727

Overview:
This PR adds a tags/labels system for streams, allowing creators to assign
up to 5 descriptive tags (e.g., payroll, vesting, grant) for organization
and filtering.

Changes:
[ADD] backend/migrations/005_add_stream_tags.sql
  - Adds 'tags' TEXT column to streams and stream_archive tables

[ADD] backend/migrations/005_add_stream_tags.down.sql
  - Rollback script for the tags migration

[MODIFY] backend/src/services/streamStore.ts
  - Added 'tags' field to StreamInput, StreamRecord, and StreamRow interfaces
  - Updated rowToRecord() to parse tags from JSON
  - Updated upsertStream() to store tags as JSON
  - Updated createStream() to pass tags from input to record
  - Updated archiveOldStreams() to persist tags in stream_archive

[MODIFY] backend/src/validation/schemas.ts
  - Added tagsSchema: array of strings, max 5 tags, max 50 chars each
  - Added optional 'tags' field to createStreamPayloadSchema

[MODIFY] backend/src/index.ts
  - Added 'tag' query parameter to listStreamsQuerySchema
  - Added tag-based filtering to all 5 stream listing endpoints:
    GET /api/streams, /api/streams/sender/:address,
    /api/streams/recipient/:address, /api/recipients/:accountId/streams,
    /api/senders/:accountId/streams

[MODIFY] backend/src/services/migrations.test.ts
  - Added 'tags' to expected streams columns
  - Updated rollback test to account for migration 5

Verification Results:
  ✅ Migrations test: 4/4 passed
  ✅ Swagger test: 2/2 passed
  ✅ Validation tests: 40/41 passed (1 pre-existing failure)
  ✅ TypeScript: no new errors (pre-existing errors unchanged)
  ✅ All tags feature tests pass

Acceptance Criteria:
| Criteria | Status |
|---|---|
| Creator can set up to 5 tags on a stream | ✅ Max 5 enforced via Zod |
| GET /api/streams?tag=payroll filters by tag | ✅ Case-insensitive filter |
| Tags stored in SQLite array column | ✅ JSON array in TEXT column |
| Tag filter works with other filters | ✅ Applies after all other filters |
| Max 5 tags enforced | ✅ Zod validation with max(5) |
| Tags returned in stream response | ✅ Parsed from DB in rowToRecord |
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Chekuyermu is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Chekuyermu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ac46b306-bf7b-4c1c-8f3b-33f94ff35bf3


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.

❤️ Share

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

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.

[FEATURE] Add stream tags/labels for organization

1 participant