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 all json schemas endpoint #1703

Merged
merged 4 commits into from
Sep 23, 2021

Conversation

provokateurin
Copy link
Contributor

@provokateurin provokateurin commented Aug 30, 2021

This PR implements an endpoint to list all Json schemas

Related issue(s)

#1699

Checklist

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2021

CLA assistant check
All committers have signed the CLA.

@provokateurin
Copy link
Contributor Author

I'm not sure which docs I'm supposed to update and also if I should commit the generated code.

schema/handler.go Outdated Show resolved Hide resolved
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you for your contribution! This looks pretty good and I have some ideas how to improve it further :)

schema/handler.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 30, 2021

Codecov Report

Merging #1703 (6a4a83f) into master (5b456b3) will decrease coverage by 0.04%.
The diff coverage is 80.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1703      +/-   ##
==========================================
- Coverage   74.10%   74.06%   -0.05%     
==========================================
  Files         260      260              
  Lines       12715    12770      +55     
==========================================
+ Hits         9423     9458      +35     
- Misses       2667     2681      +14     
- Partials      625      631       +6     
Impacted Files Coverage Δ
selfservice/strategy/link/strategy_recovery.go 67.92% <69.23%> (+0.91%) ⬆️
schema/schema.go 86.66% <77.77%> (-2.23%) ⬇️
schema/handler.go 84.48% <92.68%> (-8.86%) ⬇️
cmd/courier/watch.go 60.34% <0.00%> (-12.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 131e62e...6a4a83f. Read the comment docs.

@provokateurin
Copy link
Contributor Author

@aeneasr i hope this is to your liking

@aeneasr
Copy link
Member

aeneasr commented Aug 31, 2021

Thank you! It looks like the tests fail with a panic right now:

https://app.circleci.com/pipelines/github/ory/kratos/4621/workflows/b18b066e-0dab-4771-8311-79846e0692fe/jobs/25049

Could you please take a look? :)

@provokateurin
Copy link
Contributor Author

Uh the endpoint returns the same schema multiple times. I need to fix that.

@provokateurin provokateurin changed the title feat: Add json schema ids endpoint feat: Add all json schemasendpoint Aug 31, 2021
@provokateurin provokateurin changed the title feat: Add all json schemasendpoint feat: Add all json schemas endpoint Aug 31, 2021
@provokateurin
Copy link
Contributor Author

I think the implementation should be fixed now. I also improved the test, because the bug slipped past it. Sorry for the many force pushes :(

@provokateurin
Copy link
Contributor Author

The test fail seems completely unrelated to this PR

@provokateurin
Copy link
Contributor Author

@aeneasr i think there is a but in the admin list identities endpoint. requesting page 0 and page 1 both return the same results. In this endpoint pages start at 0 and the bug is not present. this should be consistent though and the spec says pages start at 0, so the admin list identities endpoint needs to be fixed.

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Thanks for updating the PR 👍
I have some ideas how to improve the code even further 😉

schema/handler.go Outdated Show resolved Hide resolved
schema/schema.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
@provokateurin
Copy link
Contributor Author

@zepatrik i applied all your suggestions

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Nice, this is going in a very good direction 😉
Just some final details, then it should be good to merge 👍

schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/schema_test.go Outdated Show resolved Hide resolved
schema/handler_test.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler_test.go Outdated Show resolved Hide resolved
schema/handler_test.go Show resolved Hide resolved
@provokateurin
Copy link
Contributor Author

I hope this is all good now

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Nice, nearly there 👍

schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Show resolved Hide resolved
schema/handler_test.go Outdated Show resolved Hide resolved
@provokateurin
Copy link
Contributor Author

@zepatrik i don't know how the hot-reloading of the config should work, can you give me a hint?

@zepatrik
Copy link
Member

zepatrik commented Sep 6, 2021

What you did should work already, isn't it?

@provokateurin
Copy link
Contributor Author

yes it works, but it's a bit hacky

@provokateurin
Copy link
Contributor Author

circleci test fails because of something unrelated with goreleaser

@zepatrik
Copy link
Member

zepatrik commented Sep 6, 2021

You have to merge/rebase to current master 😉 #1730
Btw, you don't have to force push all the time, we squash the commits in the end anyway. You can push later changes as individual commits.

@provokateurin
Copy link
Contributor Author

Ok :) I wasn't sure what the merge strategy is, so I didn't want to spam the git log

@provokateurin
Copy link
Contributor Author

the failed test to me seems unrelated to these changes

schema/handler_test.go Outdated Show resolved Hide resolved
@provokateurin
Copy link
Contributor Author

@zepatrik i fixed the coverage as you suggested. the remaining uncovered lines are all error handling. i don't know if that is something that should be covered, because it wasn't covered before too.

@zepatrik
Copy link
Member

zepatrik commented Sep 8, 2021

That is fine, only errors that are expected to occur during normal usage have to be covered. These are not expected errors.

@aeneasr
Copy link
Member

aeneasr commented Sep 9, 2021

@zepatrik green light?

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Just some swagger stuff :)

schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me 😉 Thanks for all the hard work 👍

@provokateurin
Copy link
Contributor Author

Thanks for all your nice comments :) It was a pleasure to work with so friendly developers

@provokateurin
Copy link
Contributor Author

When will this be merged/released?

@zepatrik
Copy link
Member

I am waiting for @aeneasr to approve.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Thank you ! Looking great and also awesome tests 😎 You’re almost there!

schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/handler.go Outdated Show resolved Hide resolved
schema/schema.go Show resolved Hide resolved
@provokateurin
Copy link
Contributor Author

@aeneasr anything missing for the merge?

@aeneasr
Copy link
Member

aeneasr commented Sep 21, 2021

Just got back from holidays. Will review as soon as possible!

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 🎉 Your contribution makes Ory better :)

@aeneasr aeneasr merged commit aa23d5d into ory:master Sep 23, 2021
@provokateurin provokateurin deleted the feature/schema-ids-endpoint branch September 27, 2021 08:33
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.

None yet

4 participants