Skip to content

Attachments: edit to use proper plugin - #2883

Open
renejeglinsky wants to merge 1 commit into
mainfrom
rjegl/edit-attachments
Open

renejeglinsky wants to merge 1 commit into
mainfrom
rjegl/edit-attachments

Conversation

@renejeglinsky

Copy link
Copy Markdown
Contributor

No description provided.

@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

👋 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

  • Summarize your pull request changes
  • Review code for quality, correctness, and reliability
  • Suggest fixes when a pipeline job fails

Key commands

Command Description
/review [--all] Trigger a code review. Add --all to include files excluded by excluded_paths.
/summarize Generate a PR summary
/ask <question> Ask about the current changes
/help See all available commands

*This introduction message will be shown to you only once, you will not see it in future PRs.

@hyperspace-pr-bot

hyperspace-pr-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Control Panel

Hi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
To interact with me, just use the following actions:

  • 📝 Summarize PR
  • 🔍 Review
  • 🗑️ Delete all bot comments and reviews

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

# 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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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

Comment on lines +37 to +38
entity Incidents as projection on my.Incidents;
annotate Incidents with @odata.draft.enabled;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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

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.

1 participant