-
Notifications
You must be signed in to change notification settings - Fork 0
feat(cmd/qna-importer): add Discourse to Discord import tool #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Adds Exists() method to store.Interface that returns nil if the key exists, ErrNotFound if it does not exist. Implementation included for S3API store using HeadObject and for JSON[T] wrapper with prefix support. Also adds comprehensive table-driven tests for all store methods: - Exists (key existence checking) - Delete (key deletion) - Get (value retrieval) - Set (value storage) - List (prefix-based key listing) - JSON wrapper methods (Get, Set, Delete, List) Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
- Rename UsernameGenerator to UserGenerator - Add avatar generation using stable-diffusion.cpp - Add tigrisdata/storage-go dependency for avatar upload - Add AvatarGen with GenerateAndUpload method - Add FakeUser struct with AvatarKey field - Fix command name typo in main.go - Remove default sdcpp client globals Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Add ThreadCreationResponse struct and ParseThreadCreation function to handle Discord webhook thread creation responses. Also add ThreadName field to Webhook struct for specifying thread names when creating forum threads. Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Replace Discord bot API ForumThreadStartComplex with webhook-based thread creation. This approach: - Uses webhooks with thread_name parameter for thread creation - Adds deduplication tracking via discourseToDiscord mapping - Adds configurable rate limiting with post-delay flag - Improves error handling with per-thread loggers - Validates webhook responses Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Add logging.Nop{} to AWS config to suppress verbose SDK debug output
that clutters application logs.
Assisted-by: GLM 4.7 via Claude Code
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Add rule to summarize content longer than 1000 characters down to 1000 characters or less. This helps keep imported posts concise. Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
…te prefix Remove discord-forum-channel flag since webhook approach no longer needs it. Also change mapping prefix from "discord-thread-mapping-dev" to "discord-thread-mapping" for production use. Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Remove duplicate config import and use awsConfig alias consistently for WithLogger call. Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Include post-delay flag value in startup configuration log for better observability. Assisted-by: GLM 4.7 via Claude Code Signed-off-by: Xe Iaso <xe@tigrisdata.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
cmd/qna-importer, a new tool for importing Discourse forum content into Discord channels via webhooks. The tool includes:Changes
New packages
cmd/qna-importer- Main CLI tool with import pipelineweb/discourse- Discourse API client for scraping forum contentweb/sdcpp- Stable-diffusion.cpp client for AI image generationweb/answerflow- Answer Overflow API clientweb/useragent- User agent string generationStore enhancements
Exists()method tostore.InterfaceFeatures
Test plan
go test ./...)npm run format