The GitHub Actions job "Benchmarks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
ffbda031344176dbba2820406ac418b36d273c67 / Neil Ketteringham 
<[email protected]>
refactor(auth): construct User via .tap instead of positional constructor 
(#7057)

### What changes were proposed in this PR?
Classes relying on the POJO User generated by jOOq uses its positional
constructor which is fragile and requires us to refactor every
constructor every time we edit the User table even if the new fields
aren't used. Most instances of User() called it with mostly null fields
which is hard to read and isn't very clear.

This PR changes that by using the .tap{} feature of Scala which allows
you to construct and modify objects in place before assigned as a
parameter or variable.

This allows code like this:
```scala
  val GUEST: User =
    new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, null, 
null, null, null)
```
To be rewritten like this 
```scala
val GUEST: User = {
  new User().tap { user =>
    user.setName("guest")
    user.setRole(UserRoleEnum.REGULAR)
  }
}
```

### Any related issues, documentation, discussions?
Closes #7044

### How was this PR tested?
PR was tested against current test suite. 

### Was this PR authored or co-authored using generative AI tooling?
No.

Report URL: https://github.com/apache/texera/actions/runs/30575903716

With regards,
GitHub Actions via GitBox

Reply via email to