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

api: Recognize sapphire, cipher as valid Layer values #427

Merged
merged 2 commits into from
May 26, 2023

Conversation

mitjat
Copy link
Contributor

@mitjat mitjat commented May 25, 2023

The IsValid() function is used to validate APIs; before this bugfix PR, https://index-staging.oasislabs.com/v1/sapphire/stats/active_accounts returned "Invalid format for parameter layer: not a valid enum value: sapphire"

Reported by @csillag -- thanks!

Makefile Outdated
Comment on lines 68 to 69
test-e2e-regression: export TZ=UTC
test-e2e-regression: oasis-indexer
./oasis-indexer --config tests/e2e_regression/e2e_config.yml analyze
TZ=UTC ./oasis-indexer --config tests/e2e_regression/e2e_config.yml analyze
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unrelated. No-op change, just makes the command easier to copy-paste out of the Makefile

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we actually need to move this to the line that instantiates the api server in run.sh, since the timestamp is formatted by the api server.

Comment on lines +79 to +81
@# The result of the "spec" test is a special case. It should always match the
@# current openAPI spec file, so we symlink it to avoid having to update the expected
@# output every time the spec changes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I abstracted the inline command form run.sh into this accept-e2e-regressions rule in the Makefile. The PR caused e2e regressions to fail just because it changed the openapi JSON (but not the e2e expected file). It would be awkward if every change to the spec produced two equivalent diffs: one in the actual spec, and one in the e2e expected file.

Copy link
Collaborator

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

as described

@$(ECHO) "$(CYAN)*** Indexer finished; starting api tests...$(OFF)"
./tests/e2e_regression/run.sh

# Accept the outputs of the e2e tests as the new expected outputs.
accept-e2e-regression:
Copy link
Collaborator

Choose a reason for hiding this comment

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

add to .PHONY?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷 We don't really use/need it. Added, and half-heartedly added several other e2e-related targets that were missing, but didn't make a careful pass to ensure every relevant target is listed under .PHONY.

@mitjat mitjat force-pushed the mitjat/sapphire-is-valid-layer branch from 763fdec to 28f3ba7 Compare May 25, 2023 23:37
Copy link
Collaborator

@Andrew7234 Andrew7234 left a comment

Choose a reason for hiding this comment

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

Thanks! One comment but lgtm otherwise!

Makefile Outdated
Comment on lines 68 to 69
test-e2e-regression: export TZ=UTC
test-e2e-regression: oasis-indexer
./oasis-indexer --config tests/e2e_regression/e2e_config.yml analyze
TZ=UTC ./oasis-indexer --config tests/e2e_regression/e2e_config.yml analyze
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we actually need to move this to the line that instantiates the api server in run.sh, since the timestamp is formatted by the api server.

@mitjat mitjat force-pushed the mitjat/sapphire-is-valid-layer branch from 28f3ba7 to b779852 Compare May 26, 2023 17:59
@mitjat
Copy link
Contributor Author

mitjat commented May 26, 2023

Good catch @Andrew7234 (I can't reply to the thread)! Moved TZ=UTC into run.sh now. Compared to where it was before the PR, I like it for the copy-pastability reason I mentioned, but I doubly like it now after your comment because the env variable has a more limited scope, making it clearer why&where we use it.

@mitjat mitjat merged commit 6837a30 into main May 26, 2023
@mitjat mitjat deleted the mitjat/sapphire-is-valid-layer branch May 26, 2023 18:30
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