aglinxinyuan opened a new issue, #7476: URL: https://github.com/apache/texera/issues/7476
### Task Summary `DatasetSearchQueryBuilder` has no spec. Every member is `override protected`, so unlike the workflow and project arms — which widen `mappedResourceSchema` and `toEntryImpl` to public — nothing here is directly callable. The one public route in is the trait's `final constructQuery`, and what it returns can be **rendered to SQL and inspected without executing it**, so the query's shape can be asserted with no rows and no live database. That reaches the part of the file with real consequences: which datasets a caller is allowed to see. Three branches decide it and none is tested. ```scala .and(if (uid == null) DSL.falseCondition() else DATASET_USER_ACCESS.UID.eq(uid)) ``` Without the `eq(uid)`, the `UID.isNotNull` check in the where clause is satisfied by **any** user's grant row — a complete sharing bypass. Alongside it: the anonymous arm must restrict to public datasets and match no grant row at all, and `includePublic == false` must return only explicitly-granted datasets without leaking public ones in. Notes for whoever picks this up: - `MockTexeraDB.initializeDBAndReplaceDSLContext()` is needed only because `SearchQueryBuilder.context` reads `SqlServer.getInstance()`. No query is executed. - jOOQ renders fully-qualified quoted identifiers (`"texera_db"."dataset"."is_public"`), so strip the quoting before matching or the assertions are unreadable and brittle. - **Do not** plan on `toEntryImpl` (lines 128–164). It is ~80% of the file's uncovered lines and sits behind a live LakeFS `retrieveRepositorySize` call with no mockable seam; reaching it needs a source change (injecting a repository-size provider), not a test. Expect only a handful of lines to flip — this is a correctness PR, not a coverage play. ### Task Type - [ ] Refactor / Cleanup - [ ] DevOps / Deployment / CI - [x] Testing / QA - [ ] Documentation - [ ] Performance - [ ] Other -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
