Skip to content

Conversation

ben-kalmus
Copy link
Contributor

@ben-kalmus ben-kalmus commented Aug 28, 2025

🧭 What and Why

🎟 JIRA Ticket:

Changes included:

  • Add PUT and DELETE actions to /1/compositions/{compositionID}/ for Compositions
  • Add PUT and DELETE actions to /1/compositions/{compositionID}/rules/{ruleID} for Composition Rules

🧪 Test

CI

@algolia-bot
Copy link
Collaborator

algolia-bot commented Aug 28, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 73b584e5e8d7b7788d7bdde2018aa70aa0ce6098
🍃 Generated commit fe2e35dced16ec99188a8b8550ce357e8b94d2f7
🌲 Generated branch generated/benk/compositions/rest-api-endpoints
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 1779
javascript 1627
php 1471
csharp 1458
python 1100
java 1014
ruby 827
swift 573
scala 23

@ben-kalmus ben-kalmus changed the title feat(compositions): add put and delete API for compositions and rules feat(specs): add put and delete API for compositions and rules Aug 28, 2025
@ben-kalmus ben-kalmus force-pushed the benk/compositions/rest-api-endpoints branch 5 times, most recently from bffbc7c to 72ff44d Compare August 29, 2025 09:28
@ben-kalmus ben-kalmus marked this pull request as ready for review August 29, 2025 10:01
@ben-kalmus ben-kalmus requested a review from a team as a code owner August 29, 2025 10:01
@ben-kalmus ben-kalmus requested review from morganleroi, Fluf22 and a team August 29, 2025 10:01
shortcuts
shortcuts previously approved these changes Aug 29, 2025
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

looks great! feel free to ping me when I can merge

@ClaraMuller ClaraMuller requested a review from a team August 29, 2025 11:56
@ben-kalmus ben-kalmus force-pushed the benk/compositions/rest-api-endpoints branch from ad30527 to b2d864a Compare August 29, 2025 15:58
ClaraMuller
ClaraMuller previously approved these changes Aug 29, 2025
Copy link
Contributor

@ClaraMuller ClaraMuller left a comment

Choose a reason for hiding this comment

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

Nice !
Thanks 👍

@ClaraMuller ClaraMuller requested a review from shortcuts August 29, 2025 16:36
@ben-kalmus
Copy link
Contributor Author

looks great! feel free to ping me when I can merge

Ready to merge :)

Comment on lines 88 to 89
'404':
$ref: '../../../common/responses/CompositionNotFound.yml'
Copy link
Contributor

@gavinwade12 gavinwade12 Aug 29, 2025

Choose a reason for hiding this comment

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

Suggested change
'404':
$ref: '../../../common/responses/CompositionNotFound.yml'

Same as for Composition Rules, we don't actually check the Composition exists and always just send the jobs to delete it 🤷
https://github.com/algolia/metis/blob/7ef740ee88b0cea24d2ac51045b8c77060025cd8/modules/services/api/internal/compositions/management.go#L198-L227

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks

ClaraMuller
ClaraMuller previously approved these changes Sep 1, 2025
@ben-kalmus
Copy link
Contributor Author

looks great! feel free to ping me when I can merge

This is ready again, thanks for your patience :)

Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

thanks ! I have a comment about the return type of the delete endpoint, sorry this is beyond the scope of the api client

content:
application/json:
schema:
$ref: '../../../common/responses/common.yml#/taskID'
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this endpoint return the taskID directly ? what do you think about wrapping the response in a object like {"taskID": number} ? This way it's more future proof IMO, if you need to add a deletedAt or something else.
All the other endpoint returning a taskID wrap it in a object btw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this, indeed the response is {"taskID": <int>}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rebased and pushed up fix

@ben-kalmus ben-kalmus force-pushed the benk/compositions/rest-api-endpoints branch from d9ce2b3 to 3ece02d Compare September 1, 2025 15:50
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

looks good !

@millotp millotp merged commit aa340dc into main Sep 1, 2025
29 checks passed
@millotp millotp deleted the benk/compositions/rest-api-endpoints branch September 1, 2025 16:22
algolia-bot added a commit that referenced this pull request Sep 1, 2025
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Sep 1, 2025
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.

6 participants