magma icon indicating copy to clipboard operation
magma copied to clipboard

refactor(orc8r): split function SetIdentityFromContext in middleware

Open wolfseb opened this issue 3 years ago • 7 comments

Summary

Refactor parts of the function SetIdentityFromContext in orc8r middleware to separate functions to increase readability. A Test for the function has also been created. The test cases are oriented by

  • the possible cases described in the comment at the start of the function
  • additional possible cases given in the code

The tests were first benchmarked on the original logic to ensure the refactoring did not change any potential outcome.

original_logic

refactored_logic

Test Plan

Run unit tests and newly created test to ensure the same outcomes as before the refactoring.

Additional Information

Created in pairing with @MoritzThomasHuebner

  • [ ] This change is backwards-breaking

wolfseb avatar May 19 '22 09:05 wolfseb

Thanks for opening a PR! :100:

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

github-actions[bot] avatar May 19 '22 09:05 github-actions[bot]

feg-workflow

    2 files  203 suites   40s :stopwatch: 374 tests 374 :heavy_check_mark: 0 :zzz: 0 :x: 388 runs  388 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 0d6f21fe.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 19 '22 09:05 github-actions[bot]

dp-workflow

13 tests   13 :heavy_check_mark:  2m 46s :stopwatch:   1 suites    0 :zzz:   1 files      0 :x:

Results for commit 0d6f21fe.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 19 '22 09:05 github-actions[bot]

cloud-workflow

1 010 tests   1 010 :heavy_check_mark:  2m 53s :stopwatch:    356 suites         0 :zzz:        7 files           0 :x:

Results for commit 0d6f21fe.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 19 '22 09:05 github-actions[bot]

agw-workflow

615 tests   611 :heavy_check_mark:  3m 49s :stopwatch:     2 suites      4 :zzz:     2 files        0 :x:

Results for commit 0d6f21fe.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 19 '22 10:05 github-actions[bot]

Hi @emakeev, could you please take another look at this if you get the chance to see whether the updates have addressed your comments? Thanks!

voisey avatar Jul 07 '22 12:07 voisey

Hi @emakeev, could you please take another look at this if you get the chance to see whether the updates have addressed your comments? Thanks!

wolfseb avatar Aug 09 '22 00:08 wolfseb