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

feat(satp-hermes): implement API1 endpoints #3605

Merged

Conversation

AndreAugusto11
Copy link
Contributor

Implemented the following endpoints, with some initial tests:

  • healthcheck: responds if SATP Hermes is on
  • get status: retrieve the status of a SATP session
  • get integrations: retrieves data about each supported network, or other external system

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

Looking good in general but I left a few suggestions for generic code quality improvement

throw error;
} else {
logger.error(`${fnTag}, Unexpected error: ${error.message}`);
throw new Error("An unexpected error occurred while obtaining status.");
Copy link
Contributor

Choose a reason for hiding this comment

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

@AndreAugusto11 Very very new thing but on the main branch (as of 4 days ago) now you can use these constructs for chaining errors with their causes:
#3593

I'm not sure if the current base branch you are sending this PR against is up to date with main that recently, but just for at least future reference wanted to make note that you could soon (or maybe already) use the cause property of the Error built-in type as shown in the PR description of the PR linked above.
Just raising awareness.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a neat feature

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RafaelAPB could you please confirm that this branch is not rebased with main? In that case, I woud defer this change to a future PR when merging/rebasing with main

Copy link
Contributor

@RafaelAPB RafaelAPB left a comment

Choose a reason for hiding this comment

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

LGTM apart from a few minor issues. Please make sure to incorporate @petermetz 's feedback as well

@RafaelAPB
Copy link
Contributor

@AndreAugusto11 can you please solve conflicts?

Implemented the following endpoints, with some initial tests:
* healthcheck: responds if SATP Hermes is on
* get status: retrieve the status of a SATP session
* get integrations: retrieves data about each supported network,
or other external system

Signed-off-by: André Augusto <[email protected]>
@AndreAugusto11
Copy link
Contributor Author

@RafaelAPB @petermetz thanks a lot for the comments and suggestions. I have applied them and updated the PR. The main changes were related to passing the log Level instead of the Logger itself and creating an Enum for the gateway status. Also, updated the open API specification to be consistent with the new Enum

@RafaelAPB RafaelAPB merged commit e377d8d into hyperledger-cacti:satp-dev Nov 15, 2024
8 checks passed
@RafaelAPB
Copy link
Contributor

Thank you very much, great work

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.

4 participants