-
Notifications
You must be signed in to change notification settings - Fork 768
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
Migrate Discourse integration to the new framework #1778
Conversation
Great work. Quick question: When will the docs be updated so anyone can add new integrations? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments
} from '../types' | ||
import { IProcessStreamContext } from '../../../types' | ||
|
||
const serializeArrayToQueryString = (params: object) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can call this serializeObjecttoQueryString instead, what do u think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ctx.log.info({ | ||
message: 'Fetching categories from Discourse', | ||
forumHostName: params.forumHostname, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can update this logging, it's same as getCategories
// wait 5 mins | ||
throw new RateLimitError(5 * 60, 'discourse/gettopics') | ||
} | ||
ctx.log.error({ err, params }, 'Error while getting Discourse categories') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's update this also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// this methods returns ids of posts in a topic | ||
// then we need to parse each topic individually (can be batched) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's either delete or update the comment, it's from getPostsFromTopic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
) | ||
}) | ||
|
||
// we aslo need to trigger nextPageStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Changes proposed ✍️
What
🤖 Generated by Copilot at 35081c1
Refactored the discourse integration logic to use the new service SQS queue and the integrations library. Removed the old node worker SQS queue and the
DiscourseIntegrationService
class. Added new functions and files to handle the discourse API calls, stream generation, data processing, and webhook processing. Commented out the discourse webhook endpoint temporarily.
🤖 Generated by Copilot at 35081c1
Why
How
🤖 Generated by Copilot at 35081c1
Checklist ✅
Feature
,Improvement
, orBug
.