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(example): Make it possible to load user configuration from file #656

Closed
wants to merge 0 commits into from

Conversation

lanseg
Copy link
Contributor

@lanseg lanseg commented Sep 24, 2024

This change allows to load users from the json file.

That should help to create better test scenarios when using example server as fake Zitadel instance for testing. For example, having several users with different permissions or presence in the internal base (known user, unknown user, blocked user, etc).

We don't need dynamic server for testing, but I could update it to make env variables unified if needed.

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.09%. Comparing base (0992c5f) to head (5ae5df8).
Report is 97 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #656      +/-   ##
==========================================
+ Coverage   60.06%   62.09%   +2.03%     
==========================================
  Files          80       81       +1     
  Lines        6998     6218     -780     
==========================================
- Hits         4203     3861     -342     
+ Misses       2498     2047     -451     
- Partials      297      310      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lanseg lanseg marked this pull request as draft September 26, 2024 12:15
@lanseg lanseg marked this pull request as ready for review September 26, 2024 12:53
Copy link
Collaborator

@muhlemmer muhlemmer left a comment

Choose a reason for hiding this comment

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

Left 1 comment.

Also please change the PR description to match semver: feat(example): <description>

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file doesn't need to be included, right? The defaults are already hard-coded in the program.
If you do think it is useful to include the file as an example, then use the embed package and remove the hard-coded data from the storage/user.go file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the testing data, I decided to include it as a sample for end users. If that is against some conventions, it's totally ok to remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's duplicate data, the convention is called DRY. So please remove it or embed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm very sorry for closing this branch. I wanted to pull latest version before submitting a proper pull request, but removed my own code.
I'll try to submit a new one soon.

@lanseg lanseg changed the title Make it possible to load user configuration from file feat(example): Make it possible to load user configuration from file Oct 4, 2024
@lanseg lanseg requested a review from muhlemmer October 4, 2024 10:33
@muhlemmer muhlemmer added the waiting For some reason, this issue will have to wait. This can be a feedback that is being waited for, a de label Oct 8, 2024
@lanseg lanseg closed this Oct 8, 2024
@muhlemmer muhlemmer removed their request for review October 8, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os-contribution waiting For some reason, this issue will have to wait. This can be a feedback that is being waited for, a de
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants