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

Endpoint: Trigger SSA #188

Closed
wants to merge 1 commit into from

Conversation

Filip-L
Copy link
Collaborator

@Filip-L Filip-L commented May 17, 2024

Endpoint: application/trigger_ssa

Description:
The application/trigger_ssa endpoint checks, based on the data received (TriggerSSAInfo), the current state of the application. If the conditions are met, it calls the refill function.

It will be used by filplus-registry to provide a manual way to trigger SSA flow in case the SSA bot fails. It's basically the /application/refill endpoint, but with some additional checks (see Usage Conditions) to make sure we don't trigger it when we shouldn't.

Usage Conditions:
To execute this endpoint, the following conditions must be met:

  1. The application must be in the Granted state.
  2. The Last active allocation ID must not be active.
  3. The total allocated amount can't be greater than or equal to the total requested amount.

Impact on Application Lifecycle:
It will add a comment on the relevant GitHub issue and change the label to refill.

Deployment Considerations:
No special actions are required.

Example TriggerSSAInfo:

{
  "id": "client_address",
  "owner": "owner_name",
  "repo": "repo_name",
  "amount": "1",
  "amount_type": "PiB"
}

LDNError::Load("Can not parse total requested amount to bytes".into()),
)?;

if requested_so_far >= total_requested {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if requested_so_far >= total_requested {
if requested_so_far + ssa_amount >= total_requested {

Where ssa_amount is info.amount converted to bytes.

@kacperzuk-neti
Copy link
Collaborator

Superseded by #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants