Skip to content
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

Add support for Rex style of callback for milestone import #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thescouser89
Copy link
Contributor

Rex

Rex specifies 2 endpoints to send results:

  • positiveCallback for positive results
  • negativeCallback for failed / error results

Changes

This commit adds support for the /import/product/milestone endpoint to accept in the DTO:

  • callback Request object (as before)
  • positiveCallback Request object
  • negativeCallback Request object

For good result, if:

  • positiveCallback is specified: use it to send callback result
  • otherwise use the callback Request object

For bad result, if:

  • negativeCallback is specified: use it to send callback result
  • otherwise use the callback Request object

If positiveCallback and negativeCallback objects are not specified in the request, we'll default to the current behaviour of sending the callback result to the callback Request object. This maintains backwards compatibility.

We also refuse the request to this endpoint if:

  • both positiveCallback and callback objects are null
  • both negativeCallback and callback objects are null

since there'll be no way to send back the result.

Checklist:

  • Have you added unit tests for your change?

Rex
===
Rex specifies 2 endpoints to send results:
- `positiveCallback` for positive results
- `negativeCallback` for failed / error results

Changes
=======
This commit adds support for the `/import/product/milestone` endpoint to
accept in the DTO:
- `callback` Request object (as before)
- `positiveCallback` Request object
- `negativeCallback` Request object

For good result, if:
- `positiveCallback` is specified: use it to send callback result
- otherwise use the `callback` Request object

For bad result, if:
- `negativeCallback` is specified: use it to send callback result
- otherwise use the `callback` Request object

If `positiveCallback` and `negativeCallback` objects are not specified
in the request, we'll default to the current behaviour of sending the
callback result to the `callback` Request object. This maintains
backwards compatibility.

We also refuse the request to this endpoint if:
- both `positiveCallback` and `callback` objects are null
- both `negativeCallback` and `callback` objects are null

since there'll be no way to send back the result.
@thescouser89
Copy link
Contributor Author

thescouser89 commented Nov 14, 2023

@michalovjan This is what I'm thinking of doing for brew push process:

graph TD
    orch(Milestone Close process triggered from Orch) --> bpm(BPM Replacement)
    bpm --> |Creates tasks| rex(Rex)
    rex -->|StartRequest| adapterService(Adapter Service for Causeway::Stateless)
   adapterService -->|MilestoneReleaseRequest| causeway(Causeway)
   causeway -->|positiveCallback or negativeCallback| rex
Loading

Let me know what you think!

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