Update chef-zero api to match the expectation that new user with different case email as an existing user cannot be created.
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 303
- Forks
- 211
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
Before #2400 changes:
If
user1 - USER@abc.com exists
user2 - User@abc.com could be created
then get on api?email=USER@abc.com would return both users.
After #2400
If
user1 - USER@abc.com exists
user2 - User@abc.com cannot be created
hence get on api?email=USER@abc.com would return only the 1 existing user.
If the users already existed then get on api?email=USER@abc.com would return both users <- this makes sure current sraed is not broken.
This API change needs to be reflected into chef-zero to maintain compatibility with server. We currently disable the test with https://github.com/chef/chef-zero/pull/311.
NOTES:
How can I run chef-zero pedant?
on the dev-vm
#cd /opt/opscode/embedded/service/oc-chef-pedant
/opt/opscode/embedded/service/oc-chef-pedant# bundle exec rake chef_zero_spec
How can I test only the failing test:
Add a tag to the test to be focussed on
Include the tag in
/opt/opscode/embedded/service/gem/ruby/2.6.0/gems/chef-zero-15.0.4/spec/run_oc_pedant.rb#L200
NOTE:
This does not break the expectation that if those 2 users existed before the change was applied, get to the users endpoint
Acceptance criteria:
Chef-zero maintains api compatibility with chef-server and returns a 409 conflict for a newuser if (upper or lowercase) email exists
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the chef-zero pedant suite using bundle exec rake chef_zero_spec on the dev-vm, then inspect the focused-test configuration at spec/run_oc_pedant.rb#L200. Restore the disabled email-case expectation so a new conflicting user returns 409 while pre-existing users with different casing are both returned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100