-
-
Notifications
You must be signed in to change notification settings - Fork 294
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: flatten (de)serialization of custom user claims #1159
Conversation
src/auth/snapshots/loco_rs__auth__jwt__tests__valid token and custom boolean claims.snap
Show resolved
Hide resolved
Think this looks great! Thank you for taking the time to fix this issue ❤️ |
Fixed failed CI |
Co-authored-by: Jorge Hermo <[email protected]>
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.
Thanks for opening this PR.
Hi @kaplanelad, thank you for your review. Addressed the changes you suggested. |
@jorgehermo9 can you fix the CI, please? |
Hi @kaplanelad . The To reproduce, in the root directory of this branch, run
(those are the commands being ran in https://github.com/loco-rs/loco/actions/runs/12927511346/job/36052787934?pr=1159) and in In order to fix that, we should link to the local loco/.github/workflows/loco-gen-ci.yml Line 73 in 1787a76
with the following command in local development (being at the repo root directory) I updated the CI workflow in cac9e5c to address this |
Now it is failing because the local How should we proceed here? If the dockerfile build should pull the dependency from crates.io, we have to publish a new The other option is to copy the local loco dependency into the docker build context. Tried that in 18de238 but I don't know if it's the best workaround... any suggestions? |
- name: | ||
run: cargo loco generate deployment --kind docker && docker build -t demo . | ||
working-directory: ./myapp | ||
- name: generate deployment |
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.
we have to split this in two steps (generate deployment
and build deployment
) because cargo loco generate deployment --kind docker
if we have the local loco dependency in the path
The docker build
works because once we are copying the files in the container, we move the loco
directory to ${{github.workspace}}
from /tmp/myapp/loco
so the app can compile with cargo build --release
(see the dockerfile template)
@@ -7,7 +7,10 @@ FROM rust:1.83.0-slim as builder | |||
WORKDIR /usr/src/ | |||
|
|||
COPY . . | |||
|
|||
{% if loco_dev_mode_path -%} |
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.
I had to use this in order to build from a local loco
dependency instead of pulling the crate from crates.io
f54a7b0
to
18de238
Compare
Fixed CI. The main problem was that the |
@@ -7,7 +7,8 @@ FROM rust:1.83.0-slim as builder | |||
WORKDIR /usr/src/ | |||
|
|||
COPY . . | |||
|
|||
# The `loco` root folder should be moved to this dockerfile path so the context can copy it to the image | |||
RUN mkdir -p /home/runner/work/loco/loco && mv loco/* /home/runner/work/loco/loco && rm -rf loco |
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.
Now this template uses the LOCO_DEV_MODE_PATH
and as the loco-gen-ci
action sets that env var https://github.com/loco-rs/loco/blob/master/.github/workflows/loco-gen-ci.yml#L73, these snapshots were generated with LOCO_DEV_MODE_PATH=/home/runner/work/loco/loco cargo insta test --review --all-features
in local
@jorgehermo9 There are too many changes in this PR that are unrelated to the feature being implemented. Kindly revert the unrelated changes so we can focus on the scope of this PR. Once that’s done, I’ll review the problem. Thanks! |
Co-authored-by: Elad Kaplan <[email protected]>
Hi @kaplanelad As you said
I debugged what was happening ( Reverted the changes. You can find what I did in commits cac9e5c, 0897e27, 18de238 and f6a03a8. After those commits, the CI passed successfully. |
Closes #1115
Left some doubts as
// TODO:
in the code, please take a look into that comments when reviewing.CC @Django-Fakkeldij