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: Add OpenRPC API docs and associated JSON Schemas #534

Merged
merged 78 commits into from
Feb 13, 2024

Conversation

bgins
Copy link
Contributor

@bgins bgins commented Jan 26, 2024

Description

This pull request includes the following features:

  • Add OpenRPC API document and JSON schema generator
    • Generate schemas in CI
  • Add OpenRPC API document
    • Add document
    • Add rpc.discover endpoint for service discovery
  • Add JSON Schemas
    • Workflow schema
    • Receipt schema
    • Receipt notification schema
    • Health check schema
    • Node info schema
    • Metrics schema
    • Network notifications
  • Refactor network notifications with structs to better support JSON Schemas
  • Add rendezvous and mDNS network notifications
    • Update discovery tests to use notifications instead of timeouts
  • Convert event cache to async implementation
  • Update pre-commit hook to allow no newline at the end of JSON files
  • Add subscribe_network_events test utility
  • Update dependabot_pr GitHub action check for modified files

Link to issue

Closes #449

Type of change

  • New feature (non-breaking change that adds functionality)
  • Refactor (non-breaking change that updates existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (document the OpenRPC API, API discovery endpoint, and schemas in README)
  • Comments have been added/updated

The network notifications and node info response contain breaking changes for Control Panel.

Test plan (required)

The following test suites were added or updated:

  • Refactored network notification tests
  • OpenRPC discover endpoint test
  • Separated out node info test
  • Refactored Rendezvous, mDNS, and connection tests to rely on new notifications
  • Consolidated rendezvous connect and disconnect tests
  • Consolidated mDNS connect and disconnect tests
  • Consolidated connection and disconnection tests

@bgins bgins added the dx Developer experience applications and improvements label Jan 26, 2024
@bgins bgins marked this pull request as ready for review February 9, 2024 00:40
@bgins bgins requested a review from a team as a code owner February 9, 2024 00:40
Cargo.toml Outdated Show resolved Hide resolved
homestar-invocation/src/authority/issuer.rs Show resolved Hide resolved
homestar-invocation/src/authority/issuer.rs Outdated Show resolved Hide resolved
homestar-invocation/src/receipt.rs Show resolved Hide resolved
homestar-invocation/src/task/config.rs Show resolved Hide resolved
homestar-runtime/src/event_handler/notification/network.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@zeeshanlakhani zeeshanlakhani left a comment

Choose a reason for hiding this comment

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

One small comment out there for a quick fix, then let's get this in. @bgins don't forget to open up that follow-up issue. Otherwise, great, great work.

@bgins bgins merged commit a82d01d into main Feb 13, 2024
33 checks passed
@bgins bgins deleted the bgins/schemas-and-api-docs branch February 13, 2024 18:04
@release-plz-ipvm-wg release-plz-ipvm-wg bot mentioned this pull request Feb 8, 2024
zeeshanlakhani pushed a commit that referenced this pull request Feb 21, 2024
## 🤖 New release
* `homestar-runtime`: 0.1.1 -> 0.2.0 (⚠️ API breaking changes)
* `homestar-invocation`: 0.1.1 -> 0.2.0 (✓ API compatible changes)
* `homestar-wasm`: 0.1.1 -> 0.2.0 (✓ API compatible changes)
* `homestar-workflow`: 0.1.1 -> 0.2.0 (✓ API compatible changes)

### ⚠️ `homestar-runtime` breaking changes

```
--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.28.0/src/lints/enum_variant_added.ron

Failed in:
  variant Command:Node in /tmp/.tmp7PLiiL/homestar/homestar-runtime/src/cli.rs:149
  variant Command:Info in /tmp/.tmp7PLiiL/homestar/homestar-runtime/src/cli.rs:155
```

<details><summary><i><b>Changelog</b></i></summary><p>

## `homestar-runtime`
<blockquote>

##
[0.2.0](homestar-runtime-v0.1.1...homestar-runtime-v0.2.0)
- 2024-02-20

### Added
- Add OpenRPC API docs and associated JSON Schemas
([#534](#534))
- redial `node_addresses` at an interval on connection close
([#529](#529))

### Fixed
- add handling of dns multiaddrs + bootstrapping + CLI / Conn changes
([#547](#547))

### Other
- deps + flake cleanup
([#581](#581))
- Allow dead code default timeout
([#577](#577))
- Update homestar-functions to use cargo component
([#576](#576))
- fix transport order for wss possibility
([#563](#563))
- small comment, sorry
([#561](#561))
- move away from deadlines dealing w/ the runner and wasi-preview 2
wasmtime ([#560](#560))
- docker updates with info command and rpc host update
([#558](#558))
- just test conn ([#544](#544))
- handle this evil workflow_info test
([#543](#543))
- remove unnecessary deps and add tooling for those checks
([#541](#541))
- [chore(cargo)](deps): bump puffin from 0.18.1 to 0.19.0
([#537](#537))
- updates/flaky kills on ci
([#540](#540))
- release docs and cp readmes
([#530](#530))
- port selection and test config generation macro
([#528](#528))
- [chore(cargo)](deps): bump serde_with from 3.4.0 to 3.5.0
([#524](#524))
- [chore(cargo)](deps): bump moka from 0.12.3 to 0.12.4
([#525](#525))
</blockquote>

## `homestar-invocation`
<blockquote>

##
[0.2.0](homestar-invocation-v0.1.1...homestar-invocation-v0.2.0)
- 2024-02-20

### Added
- Add OpenRPC API docs and associated JSON Schemas
([#534](#534))

### Other
- deps + flake cleanup
([#581](#581))
- Update homestar-functions to use cargo component
([#576](#576))
- move away from deadlines dealing w/ the runner and wasi-preview 2
wasmtime ([#560](#560))
- remove unnecessary deps and add tooling for those checks
([#541](#541))
- release docs and cp readmes
([#530](#530))
</blockquote>

## `homestar-wasm`
<blockquote>

##
[0.2.0](homestar-wasm-v0.1.1...homestar-wasm-v0.2.0)
- 2024-02-20

### Other
- deps + flake cleanup
([#581](#581))
- Update homestar-functions to use cargo component
([#576](#576))
- move away from deadlines dealing w/ the runner and wasi-preview 2
wasmtime ([#560](#560))
- remove unnecessary deps and add tooling for those checks
([#541](#541))
- release docs and cp readmes
([#530](#530))
</blockquote>

## `homestar-workflow`
<blockquote>

##
[0.2.0](homestar-workflow-v0.1.1...homestar-workflow-v0.2.0)
- 2024-02-20

### Added
- Add OpenRPC API docs and associated JSON Schemas
([#534](#534))

### Other
- deps + flake cleanup
([#581](#581))
- remove unnecessary deps and add tooling for those checks
([#541](#541))
- release docs and cp readmes
([#530](#530))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

Signed-off-by: release-plz-ipvm-wg[bot] <144082651+release-plz-ipvm-wg[bot]@users.noreply.github.com>
Co-authored-by: release-plz-ipvm-wg[bot] <144082651+release-plz-ipvm-wg[bot]@users.noreply.github.com>
@release-plz-ipvm-wg release-plz-ipvm-wg bot mentioned this pull request Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer experience applications and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON Schema/OpenRPC documentation for JSON RPC API
2 participants