Attachments: edit to use proper plugin - #2883
renejeglinsky wants to merge 1 commit into
Conversation
|
👋 Hi — I'm PR Bot, your SAP code review assistant. I'll automatically review your pull requests for code quality, security, and SAP compliance. Get an overview of what I do → What I do
Key commands
*This introduction message will be shown to you only once, you will not see it in future PRs. |
Control PanelHi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
|
There was a problem hiding this comment.
I posted three inline comments covering clarity, copy-paste reliability of the CDS example, and missing production configuration for the attachments backend. Overall, the edit moves the guide in the right direction, but the affected snippets need a few fixes before the documentation is safe for readers to follow.
PR Bot Information
Version: 1.31.30
- LLM:
gpt-5.5 - Correlation ID:
9d33e920-b03b-11f1-953e-7c07348dc7a9 - Review Focus Files:
- Event Trigger:
issue_comment.edited - File Content Strategy: Full file content
| # Attachments | ||
|
|
||
| You can use the Attachment Service provided by SAP Business Technology Platform to manage file attachments in your CAP applications. This guide explains how to integrate the Attachment Service into your CAP application. | ||
| The [`@cap-js/attachments`](https://github.com/cap-js/attachments) plugin adds file storage and handling to CAP applications via a reusable `Attachments` aspect. In development it stores files in the local database; in production it uses an Object Store service (AWS S3, Azure Blob Storage, or GCP Cloud Storage). |
There was a problem hiding this comment.
[Clarity]: The introduction uses a semicolon and a long sentence
The style guide asks to avoid semicolons, and the current sentence combines development and production behavior in one line. Consider splitting it into shorter sentences and adding the comma after the introductory phrase.
| The [`@cap-js/attachments`](https://github.com/cap-js/attachments) plugin adds file storage and handling to CAP applications via a reusable `Attachments` aspect. In development it stores files in the local database; in production it uses an Object Store service (AWS S3, Azure Blob Storage, or GCP Cloud Storage). | |
| The [`@cap-js/attachments`](https://github.com/cap-js/attachments) plugin adds file storage and handling to CAP applications with a reusable `Attachments` aspect. In development, it stores files in the local database. In production, it uses an Object Store service (AWS S3, Azure Blob Storage, or GCP Cloud Storage). |
Double-check suggestion before committing. Edit this comment for amendments.
Please provide feedback on the review comment by checking the appropriate box:
- 🌟 Awesome comment, a human might have missed that.
- ✅ Helpful comment
- 🤷 Neutral
- ❌ This comment is not helpful
| entity Incidents as projection on my.Incidents; | ||
| annotate Incidents with @odata.draft.enabled; |
There was a problem hiding this comment.
[Clarity]: The draft annotation example is hard to follow
The annotation is indented as if it belongs to the projection, and my.Incidents is not introduced in the snippet, which can confuse readers who copy the example. Consider annotating the projection directly and keeping the model reference consistent with the previous snippet.
| entity Incidents as projection on my.Incidents; | |
| annotate Incidents with @odata.draft.enabled; | |
| @odata.draft.enabled | |
| entity Incidents as projection on Incidents; |
Double-check suggestion before committing. Edit this comment for amendments.
Please provide feedback on the review comment by checking the appropriate box:
- 🌟 Awesome comment, a human might have missed that.
- ✅ Helpful comment
- 🤷 Neutral
- ❌ This comment is not helpful
| ## Production Setup | ||
|
|
||
| 6. **Test Your Application**: Run your CAP application and test the attachment functionality to ensure everything is working as expected. | ||
| For Cloud Foundry, bind an Object Store service instance to your application and include it in your `mta.yaml`. The plugin picks up the binding and uses it as the storage backend. |
There was a problem hiding this comment.
[Bug]: The production setup omits the required attachments configuration
Binding the Object Store instance alone may not select the object-store backend; CAP examples configure cds.requires.attachments.kind as standard or a hyperscaler-specific kind. Consider adding the package configuration so readers can deploy the setup reliably.
| For Cloud Foundry, bind an Object Store service instance to your application and include it in your `mta.yaml`. The plugin picks up the binding and uses it as the storage backend. | |
| For Cloud Foundry, bind an Object Store service instance to your application and include it in your `mta.yaml`. Configure the attachments service in `package.json` so the plugin can use the binding as the storage backend: | |
| ```json | |
| { | |
| "cds": { | |
| "requires": { | |
| "attachments": { | |
| "kind": "standard" | |
| } | |
| } | |
| } | |
| } | |
| ``` |
Double-check suggestion before committing. Edit this comment for amendments.
Please provide feedback on the review comment by checking the appropriate box:
- 🌟 Awesome comment, a human might have missed that.
- ✅ Helpful comment
- 🤷 Neutral
- ❌ This comment is not helpful
No description provided.