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

Refactor GatewayNode Checks #311

Open
whizzzkid opened this issue Oct 12, 2022 · 2 comments
Open

Refactor GatewayNode Checks #311

whizzzkid opened this issue Oct 12, 2022 · 2 comments
Assignees
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked

Comments

@whizzzkid
Copy link
Contributor

Discussion: #310 (comment)

Since all of the checks implement the same interface, we can simplify the checks to be run the same way.

AC:

  • The check can be standalone, i.e. contain all meta information like the check name and check type.
  • We can then dynamically run all checks using the same interface.

e.g.:

//...,
this.origin.check().then(() => log.debug(this.gateway, 'Origin success')).then(this.onSuccessfulCheck.bind(this)),
...

can be refactored as:

const allChecks = [..., OriginCheck, TrustlessCheck, ...];

await Promise.all(async allChecks.map(check => {
    try {
        await check.check();
        log.debug(this.gateway, `${check.name} success`);
        this.onSuccessfulCheck();
    } catch (err) {
        log.error(err);
        throw err;
    }
}));
@whizzzkid whizzzkid added the need/triage Needs initial labeling and prioritization label Oct 12, 2022
@welcome
Copy link

welcome bot commented Oct 12, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@SgtPooki
Copy link
Member

awesome, yessir. that’s the direction I was hoping to head toward with the update to typescript. Keep in mind that we will eventually want to update this repo to something more UI friendly (react) while also supporting nodejs based checks. i.e. Business logic (actual checks) are runnable via nodeJS/CLI & in browsers, and UI components can easily wrap and represent those checks visually.

@SgtPooki SgtPooki added kind/enhancement A net-new feature or improvement to an existing feature exp/beginner Can be confidently tackled by newcomers effort/hours Estimated to take one or several hours status/ready Ready to be worked P3 Low: Not priority right now and removed need/triage Needs initial labeling and prioritization labels Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked
Projects
No open projects
Status: Planned / Backlog
Development

No branches or pull requests

2 participants