Southclaws / storyden

With a fresh new take on traditional bulletin board forum software, Storyden is a modern, secure and extensible platform for building communities.
https://www.storyden.org/
Mozilla Public License 2.0
93 stars 11 forks source link

implement a fill rule for links->nodes #305

Closed Southclaws closed 2 days ago

Southclaws commented 2 days ago
vercel[bot] commented 2 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **storyden** | ⬜️ Ignored ([Inspect](https://vercel.com/southclaws-projects/storyden/9DbLWvjNQtXqe9ZzfAbtqS4GopmT)) | [Visit Preview](https://storyden-git-node-fill-via-link-southclaws-projects.vercel.app) | | Nov 22, 2024 9:11pm | | **storyden-homepage** | ⬜️ Ignored ([Inspect](https://vercel.com/southclaws-projects/storyden-homepage/CS7vZXiwCQ3DfsiwhN8rWWJ333Nc)) | [Visit Preview](https://storyden-homepage-git-node-fill-via-link-southclaws-projects.vercel.app) | | Nov 22, 2024 9:11pm |
coderabbitai[bot] commented 2 days ago

[!CAUTION]

Review failed

The pull request is closed.

📝 Walkthrough
📝 Walkthrough ## Walkthrough The changes in this pull request involve multiple modifications across various files, primarily focusing on enhancing the handling of content fill rules, media extraction, and asset downloading. Key updates include the introduction of new constants and fields, adjustments to function signatures, and the addition of error handling mechanisms. Notably, the `ContentFillRule` enumeration has been modified, and new functionalities have been added to the `Content` struct for media references. Additionally, the `analyseConsumer` struct has undergone significant changes to accommodate new dependencies and functionalities related to asset processing. ## Changes | File Path | Change Summary | |---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | app/resources/asset/asset_enum_gen.go | Removed `ContentFillRuleEnumNone`, added `ContentFillRuleCreate`, updated `NewContentFillRule` function. | | app/resources/asset/fillrule.go | Removed `contentFillRuleEnumNone`, added `contentFillRuleCreate`. | | app/resources/datagraph/content.go | Added `media []string` field and `Media()` method to `Content` struct, updated `NewRichTextFromReader` and `extractReferences` functions to handle media. | | app/resources/datagraph/content_test.go | Updated tests to include assertions for the `media` field and added new test cases for media extraction. | | app/resources/mq/message_types.go | Updated `IndexNode` struct to include `SummariseContent` and `AutoTag`, added `DownloadAsset` struct. | | app/services/asset/analyse_job/analyse.go | Updated `analyseConsumer` struct to remove `queue`, added `uploader` and `nodeWriter` fields, modified constructor accordingly. | | app/services/asset/analyse_job/download.go | Introduced `downloadAsset` function for downloading assets from a URL and handling uploads. | | app/services/asset/analyse_job/job.go | Renamed `queue` parameter to `analyseQueue`, added `downloadQueue` parameter, updated subscription logic for both queues. | | app/services/asset/analyse_job/provider.go | Added provision for `queue.New[mq.DownloadAsset]`. | | app/services/library/library.go | Added import for `node_fill`, modified `Build` function to include `node_fill.New`. | | app/services/library/node_fill/filler.go | Introduced `Filler` struct with `FillContentFromLink` method for processing content from links. | | app/services/library/node_mutate/create.go | Updated `Create` method to include `fetcher.Options{}` in `Fetch` method call. | | app/services/library/node_mutate/mutate.go | Added `ContentSummarise opt.Optional[bool]` field to `Partial` struct. | | app/services/library/node_mutate/update.go | Updated `Update` method to include new `fetcher.Options{}` parameter in `Fetch` method call. | | app/services/library/node_semdex/indexer.go | Updated `index` method to include `summarise` and `autotag` parameters, added `getSummary` and `generateTags` methods. | | app/services/library/node_semdex/node_semdex.go | Added `summariser` and `tagWriter` fields to `semdexer` struct, updated `newSemdexer` function to include new parameters. | | app/services/link/fetcher/fetcher.go | Updated `Fetch` and `ScrapeAndStore` methods to include new parameters and return types. | | app/services/link/scrape/postprocess.go | Modified image URL assignment to use `withBaseURL` function. | | app/services/link/scrape_job/scrape.go | Updated handling of return values from `ScrapeAndStore` method. | | app/services/semdex/semdexer/weaviate_semdexer/summarise.go | Introduced `SummarisePrompt` variable and updated `Summarise` method to use dynamic prompts for summarization. | | app/services/thread/create.go | Updated `Create` method to include `fetcher.Options{}` in `Fetch` method call. | | app/services/thread/update.go | Enhanced `Update` method to process URLs from `partial` parameter. | | app/transports/http/bindings/links.go | Updated `LinkCreate` method to include `ContentFill` options in `Fetch` method call. | | web/src/api/openapi-client/links.ts | Updated `linkCreate` and related functions to accept optional `params` for additional parameters during link creation. | | web/src/api/openapi-schema/contentFillRule.ts | Added `create` property to `ContentFillRule` constant object. | | web/src/api/openapi-schema/index.ts | Added export for `linkCreateParams`. | | web/src/api/openapi-schema/linkCreateParams.ts | Introduced `LinkCreateParams` type for link creation parameters. | | web/src/api/openapi-schema/nodeContentFillRuleQueryParameter.ts | Added `create` property to `NodeContentFillRuleQueryParameter`. | | web/src/api/openapi-server/links.ts | Updated functions to include optional `params` for link creation and retrieval. | ## Poem > 🐇 In the meadow where changes bloom, > New rules for filling, dispelling gloom. > Media now dances, extracted with care, > Assets are downloaded, a breeze in the air. > With options aplenty, our links now take flight, > Hopping through code, oh what a delight! 🌼

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.