-
Notifications
You must be signed in to change notification settings - Fork 219
Transparently check if template alias exists #1678
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
Conversation
We want to add separated template that accepts only template alias (not id) and transparently shows difference between 404 (you are owner and template does not exists) and 403 (you are not owner but template exists). This way we can use this endpoint in services to check if alias is available. We cannot do that with existing endpoints as they are returning 404 for both forbidden and not found cases.
Use test containers so we can run API service and test everything end to end with Postgres database running in container. This way we can run debugger and test all cases locally.
This comment was marked as outdated.
This comment was marked as outdated.
Moved onetime used functions for tema and template creation to database test utils package. This way they can be re-used.
Replace local copy of test helper utils with database package utils implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75c1e41ced
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
We want to add separated template that accepts only template alias (not
id) and transparently shows difference between 404 (you are owner and
template does not exists) and 403 (you are not owner but template
exists).
Note
Adds a dedicated endpoint to resolve templates by alias and wires it through the server interface and router.
GET /templates/aliases/{alias}route withGetTemplatesAliasesAliashandler and middleware inapi.gen.go/templates/aliases/:aliasgeneratenow also producesinternal/api/client.gen.goWritten by Cursor Bugbot for commit 8fc7c16. This will update automatically on new commits. Configure here.