The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-7305-ad638ae035579025f48697089ad9bbc3a50d2c08
 has failed.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
ae1d1d88e6d6a3f3559eb6512a679959da152421 / Xinyuan Lin <[email protected]>
test(amber): cover ProjectResource's colour and per-project workflow APIs 
(#7305)

### What changes were proposed in this PR?

`ProjectResourceSpec` exercised the create / rename / describe / add /
remove / delete paths, but three of the resource's methods were never
called by it. Six tests for those:

**`updateProjectColor`** — the only one with real validation:

```scala
if (colorHex == null || colorHex.length != 6 && colorHex.length != 3 || 
!colorHex.matches(...))
```

The guard checks length **and** hex-ness, so the rejection test covers
both kinds of bad input: a length-only check would let `"GGGGGG"`
through, and a regex-only check would let `""` through. It also asserts
a rejected update leaves the previously stored colour intact, and that
the null check precedes the length read — without it a null colour is an
NPE rather than a 400. Both the 3- and 6-digit forms are accepted, and
the value is stored verbatim rather than expanded.

**`deleteProjectColor`** — clears the value.

**`listProjectWorkflows`** — filters by project id. The test seeds
**two** projects each holding one workflow, so a filter that ignored the
pid would return both and fail; plus a project holding none returns
empty.

These are additions to the spec's existing `MockTexeraDB` fixture, not
new infrastructure.

For transparency on scope: `WorkflowVersionResource` (12 missed, 88.4%)
was looked at as a companion for this PR and deliberately left out.
Every one of its methods is already exercised by its spec, so the
residue is branch-level and did not look reachable without padding.

No production file is touched.

### Any related issues, documentation, discussions?

Closes #7302

### How was this PR tested?

Six new tests, run as the whole spec so the pre-existing cases are
proven intact — 16 tests, Java 17:

```
sbt "WorkflowExecutionService/testOnly 
org.apache.texera.web.resource.dashboard.user.project.ProjectResourceSpec"
```

```
[info] Tests: succeeded 16, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
```

`Test/scalafmtCheck` and `Test/scalafix --check` both `[success]`.

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

Generated-by: Claude Code (Opus 5)

---------

Signed-off-by: Xinyuan Lin <[email protected]>
Co-authored-by: Copilot Autofix powered by AI 
<[email protected]>

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

With regards,
GitHub Actions via GitBox

Reply via email to