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 #189

Merged
merged 1 commit into from
May 20, 2024
Merged

Endpoint: Trigger SSA #189

merged 1 commit into from
May 20, 2024

Conversation

kacperzuk-neti
Copy link
Collaborator

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"
}

@kacperzuk-neti kacperzuk-neti changed the title SSA button Endpoint: Trigger SSA May 20, 2024
LDNError::Load("Can not parse total requested amount to bytes".into()),
)?;

if requested_so_far >= total_requested {
Copy link
Collaborator Author

@kacperzuk-neti kacperzuk-neti May 20, 2024

Choose a reason for hiding this comment

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

@Filip-L

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.

@willscott willscott merged commit cf07fda into main May 20, 2024
1 of 2 checks passed
@kacperzuk-neti kacperzuk-neti deleted the SSA-button branch May 20, 2024 17:20
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.

None yet

3 participants