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

[Feature Request]: store openrpc.json in releases #2611

Closed
jcstein opened this issue Aug 24, 2023 · 3 comments
Closed

[Feature Request]: store openrpc.json in releases #2611

jcstein opened this issue Aug 24, 2023 · 3 comments
Assignees
Labels
area:api Related to celestia-node API enhancement New feature or request external Issues created by non node team members

Comments

@jcstein
Copy link
Member

jcstein commented Aug 24, 2023

Implementation ideas

This is so that it is historically accessible, and so that storing past versions does not cause any risk of manual user error.

v0.11.0-rc8 would be available at:
https://raw.githubusercontent.com/celestiaorg/celestia-node/v0.11.0-rc8/openrpc.json

v0.11.0-rc9 would be available at:
https://raw.githubusercontent.com/celestiaorg/celestia-node/v0.11.0-rc9/openrpc.json

etc.

@jcstein jcstein added the enhancement New feature or request label Aug 24, 2023
@github-actions github-actions bot added the external Issues created by non node team members label Aug 24, 2023
@vgonkivs vgonkivs self-assigned this Aug 24, 2023
@jcstein jcstein added the area:api Related to celestia-node API label Oct 6, 2023
@ramin
Copy link
Contributor

ramin commented Nov 27, 2023

@jcstein can we do this now? we will have the rpc stuff in a branch right?

@jcstein
Copy link
Member Author

jcstein commented Nov 27, 2023

i've been manually generating the specs on tagged releases, but it would be ideal if they existed on the release itself with the binaries, mostly for verifiability and removing the manual step so it can be automated

ramin pushed a commit that referenced this issue Feb 9, 2024
<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->
# Summary

Open RPC spec generation errors, due to a missing sample value for
blob.GasPrice.

# Problem

Missing sample value in `api/docgen/examples.go`.

Logs from running on v0.13.0:

```json
--> Generating OpenRPC spec
failed to retrieve example value for type: blob.GasPrice on parent 'blob.GasPrice')
{
    "openrpc": "1.2.6",
    "info": {
        "title": "Celestia Node API",
        "description": "The Celestia Node API is the collection of RPC methods that can be used to interact with the services provided by Celestia Data Availability Nodes.",
        "version": "v0.11.0"
    },
```

Output from logs running on v0.11.0, as another check to see that this
worked before:

```json
--> Generating OpenRPC spec
{
    "openrpc": "1.2.6",
    "info": {
        "title": "Celestia Node API",
        "description": "The Celestia Node API is the collection of RPC methods that can be used to interact with the services provided by Celestia Data Availability Nodes.",
        "version": "v0.11.0"
    },
```

# Solution

Add sample value.

[Output after
testing](https://gist.github.com/jcstein/02c459fb781889405d7ebc802484509a)

## Other issues found while testing

API version is still v0.11.0, which is the same as last few releases, i
just ran make openrpc-gen on v0.11.0 and the API version is the same
there. This is already, addressed in
#2549, and I am
highlighting to bring it out from stale state.

### Proposed solutions for other issues found

To avoid this in the future, i would like to see if we can work this
[feature request to add openrpc.json on
main](#2611) into
celestia-node, so that there is validation before publishing specs, and
a history of past versions of the openrpc.json, stored on main with
releases. otherwise we JTMB the person updating node-rpc-docs [on almost
10000 lines of spec
code](https://github.com/celestiaorg/node-rpc-docs/pull/35/files)

> Note, this output must not contain the output which precedes the json:
> `--> Generating OpenRPC spec`
@ramin ramin self-assigned this Mar 13, 2024
@jcstein
Copy link
Member Author

jcstein commented Mar 28, 2024

bumping this again. also, the API version hasn't been updated in a long time and the result still shows:

--> Generating OpenRPC spec
{
    "openrpc": "1.2.6",
    "info": {
        "title": "Celestia Node API",
        "description": "The Celestia Node API is the collection of RPC methods that can be used to interact with the services provided by Celestia Data Availability Nodes.",
        "version": "v0.11.0"

@jcstein jcstein changed the title [Feature Request]: store openrpc.json in main [Feature Request]: store openrpc.json in releases Apr 18, 2024
ramin added a commit that referenced this issue May 21, 2024
…#3350)

<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->

Adds a step in the ci_and_release pipeline to generate `openrpc.json`
using `make openrpc-gen` and store that generated file with the release
artifacts. This is set to run after go-releaser, though we could have
made this its own workflow file potentially.

I have tested that release upload works in a personal repo, but as with
all things on github, we can only REALLY test and do this one live 🤞

refs #2611
@ramin ramin closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Related to celestia-node API enhancement New feature or request external Issues created by non node team members
Projects
None yet
Development

No branches or pull requests

3 participants