fission-codes / fission

Fission CLI & server
https://runfission.com/docs
119 stars 14 forks source link

Fix whoami route typo #551

Closed expede closed 3 years ago

expede commented 3 years ago

CLI

ยป  fission setup -R staging
๐ŸŒฑ Setting up environment
๐Ÿช Downloading managed IPFS for macOS
๐Ÿ•๐ŸŽ›๏ธ  Configuring managed IPFS
๐Ÿ”‘ Setting up keys
๐Ÿ  Do you have an existing account? [Y/n] n
Username: expede-210914-staging
Email: be.zelenka@gmail.com
โœ… Registration successful! Head over to your email to confirm your account.
๐ŸŽ›๏ธ  Initializing user config file
โœ… Done! Welcome to Fission, expede-210914-staging โœจ

ยป  fission whoami -R staging
๐Ÿ’ป Currently logged in as: expede-210914-staging

ยป  fission app register -R staging
๐Ÿ‘ท Choose build directory (.):
โœ… App initialized as little-wide-silk-elf.fissionapp.net
โฏ๏ธ  Next run fission app publish [--open|--watch] to sync data
๐Ÿ’ It may take DNS time to propagate this initial setup globally. In this case, you can always view your app at https://ipfs.runfission.com/ipns/little-wide-silk-elf.fissionapp.net

ยป  fission up -R staging
๐Ÿ•—๐Ÿ›ซ App publish local preflight
โœˆ๏ธ  Pushing to remote
๐Ÿš€ Now live on the network
๐Ÿ“ DNS updated! Check out your site at:
๐Ÿ”— little-wide-silk-elf.fissionapp.net

Browser (Signup & Drive)

Screen Shot 2021-09-14 at 20 47 07 Screen Shot 2021-09-14 at 20 47 26 Screen Shot 2021-09-14 at 20 48 01 Screen Shot 2021-09-14 at 20 48 07

Linking

Screen Shot 2021-09-14 at 20 49 19
matheus23 commented 3 years ago

The openapi-diff tool I linked above didn't really work, so I tried this openapi-diff tool from atlassian on npm instead. Also small sidenote, I had to convert our OpenAPI v2 into OpenAPI v3, because the diff tools would only understand that. There's an endpoint at converter.swagger.io, so I used that.

So I tried this:

$ yarn global add openapi-diff
$ curl https://converter.swagger.io/api/convert?url=https://runfission.net/docs.json > docsv2.json
$ curl https://converter.swagger.io/api/convert?url=https://runfission.com/docs.json > docsv1.json
$ openapi-diff docsv1.json docsv2.json
No changes found between the two specifications

I assume that is because staging was rolled back to before the v2 route changes.

So I tried to build this PR locally and run the server to get the OpenAPI file, but I can't build this PR (and main) with the same error as the CI on ubuntu-latest:

error: a 'x86_64-darwin' with features {} is required to build '/nix/store/asi46dj02lxc5ccq8azjr2wkfw7rrmxv-build.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test}

I'll leave it at that for now. Let me know if there's something I can do to help make this run on linux!

expede commented 3 years ago
error: a 'x86_64-darwin' with features {} is required to build '/nix/store/asi46dj02lxc5ccq8azjr2wkfw7rrmxv-build.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, nixos-test}

Yeah, I committed pointing the stack.yaml's nix.shell-path to rosetta.nix. It annoyingly does not override when you pass a command line argument. Will fix

https://github.com/fission-suite/fission/blob/main/stack.yaml#L38

I just searched and found openapi-diff. I'll give that a try!

I think this is really great for this PR ๐Ÿ‘

We don't do this often enough to automate the process, and it's "just" trading one declarative spec for another. A replay test suite would be useful long-term because it also captures the responses from a real-world server request, but we should probably write more tests in general ๐Ÿ˜…

We're also not generating docs for the unversioned API, since it's deprecated and conflicts with the default (latest) docs, but we can change that temporarily to check the routes

expede commented 3 years ago

๐Ÿ˜ซ Nooooo, I dropped the sections from the docs to make them easier to generate, and that breaks openapi-diff. Literally 22 cases where the endpoint is there, but the swagger docs are confused because it's no longer nested. Having those section produces nicer docs, but will break this diff tool if we change their organization, like here. Bare paths from here on out it is!

This will be more useful from here on out, but we're possibly stuck doing it by hand for this PR ๐Ÿคทโ€โ™€๏ธ It's okay, there's only 32 routes

I will add openapi-diff to (soon-to-exist) debugging environment for future use, though!

expede commented 3 years ago

Here's what I ended up doing:

  1. Directly on staging server, set docs to generate RoutesV_ docs, build & run
  2. Open production docs in one tab
  3. Open staging docs in another tab
  4. Walk down the prod (unversioned) docs, and compare to the staging docs. Make sure that:
    • All routes are available
    • Return types are the same

Honestly, tabbing back and forth was great. Aside from the sidebar, the pages are identical, so it's pretty easy to spot where (e.g.) the updated doc generator version has additional information.

I'm going to run through Drive and the CLI and stuff, but I think this is good to go now