Skip to content

liferay/liferay-portal / .claude/skills/pr-check

pr-check

Verified

Check that a PR is ready to be sent for review.

FileKindSize
SKILL.mdskill md36.5 KB
find_modules.shexecutablescript1.4 KB
references/testing.mdmarkdown5.4 KB
select_paths.shexecutablescript2.2 KB
select_validations.shexecutablescript1.1 KB
validations/branch/bean-param-util-getter.mdmarkdown6.6 KB
validations/branch/bnd-content.mdmarkdown15.2 KB
validations/branch/bnd-dsannotations-options.mdmarkdown9.1 KB
validations/branch/cache-field-usage.mdmarkdown13.9 KB
validations/branch/concurrent-mapper-hash-map-usage.mdmarkdown7.5 KB
validations/branch/html-escaping.mdmarkdown2.6 KB
validations/branch/pr-reviewer.mdmarkdown6.6 KB
validations/branch/redundant-assert-message.mdmarkdown13.5 KB
validations/branch/required-configuration-policy.mdmarkdown7.9 KB
validations/branch/service-holder-usage.mdmarkdown8.3 KB
validations/branch/service-registration.mdmarkdown3.7 KB
validations/branch/source-format.mdmarkdown4.1 KB
validations/branch/startup-sync-usage.mdmarkdown10.6 KB
validations/branch/transaction-usage.mdmarkdown4.0 KB
validations/branch/unused-project-dependencies.mdmarkdown18.5 KB
validations/portal/baseline.mdmarkdown14.0 KB
validations/portal/cross-module-compile.mdmarkdown7.9 KB
validations/portal/full-portal-build.mdmarkdown1.4 KB
validations/portal/go-generate.mdmarkdown2.8 KB
validations/portal/go-source-format.mdmarkdown1.9 KB
validations/portal/helm-unit-test-order.mdmarkdown1.4 KB
validations/portal/instance-wrapper-build.mdmarkdown656 B
validations/portal/java-unit-test.mdmarkdown6.7 KB
validations/portal/javascript-unit-test.mdmarkdown7.7 KB
validations/portal/module-registration.mdmarkdown7.8 KB
validations/portal/per-module-compile.mdmarkdown10.4 KB
validations/portal/portlet-title.mdmarkdown1.1 KB
validations/portal/poshi-syntax.mdmarkdown336 B
validations/portal/pql-validation.mdmarkdown516 B
validations/portal/rest-builder.mdmarkdown938 B
validations/portal/service-builder.mdmarkdown1.6 KB
validations/portal/structural-smoke.mdmarkdown3.9 KB
validations/portal/theme-build.mdmarkdown2.0 KB
validations/workspaces/generated-file.mdmarkdown2.5 KB
validations/workspaces/source-format.mdmarkdown2.0 KB
validations/workspaces/workspace-compile.mdmarkdown1.8 KB
validations/workspaces/workspace-java-unit-test.mdmarkdown1.7 KB
validations/workspaces/workspace-javascript-unit-test.mdmarkdown1.9 KB

validations/portal/structural-smoke.md

View on GitHub
# Structural Smoke

Runs the structural tests that read the files the branch changed. **Selection** below maps each path to its test.

## Match

`/configuration/.*Configuration\.java$|^portal-impl/src/portal-osgi-configuration\.properties$|^lib/|^\.classpath$|\.iml$|^\.idea/|/nbproject/project\.(properties|xml)$|\.gradle$|(^|/)(bnd|app)\.bnd$|^modules/.+/\.gitignore$|^modules/.+/README\.md$|^modules/.+/package\.json$|portal-log4j(-ext)?\.xml$|\.lfrbuild|^\.github/`

## Preconditions

- Portal Snapshots

## Command

### Selection

Run only the scanners whose inputs the diff touches:

| Diff Touches | Run |
| --- | --- |
| `*Configuration.java` under a `configuration` package, or `portal-impl/src/portal-osgi-configuration.properties` | `ConfigurationEnvBuilderTest` |
| `lib/**`, `.classpath`, `*.iml`, `.idea/**`, `nbproject/project.{properties,xml}` | `LibraryReferenceTest` |
| `*.gradle`, `bnd.bnd`, `app.bnd`, `package.json`, a module `.gitignore` or `README.md`, `portal-log4j*.xml`, `.lfrbuild*`, `.github/**` | `ModulesStructureTest` |

### Scanners

Run the selected scanners:

```bash
(cd "${REPO_ROOT}/portal-impl" && ant test-class -Dtest.class="ConfigurationEnvBuilderTest")
```

```bash
(cd "${REPO_ROOT}/portal-kernel" && ant test-class -Dtest.class="LibraryReferenceTest")
```

```bash
(cd "${REPO_ROOT}/portal-kernel" && ant test-class -Dtest.class="ModulesStructureTest")
```

Run only the scanners the table selected. A diff that matches no row selects none, which is not a failure: report **NOT APPLICABLE** and name the diff as outside every scanner's inputs.

Read the table's first column as basenames at any depth, except `portal-impl/src/portal-osgi-configuration.properties`, which is a path from the repository root. A deletion counts as touching, since removing one of these inputs changes the structure as surely as adding one.

### Verdict

**Judge from the JUnit XML, never from the exit status.** `build.properties` sets `junit.halt.on.failure=false`, so `ant test-class` prints `BUILD SUCCESSFUL` and exits 0 with failing tests in the same run. The results land at `<project>/test-results/unit/TEST-<FQCN>.xml`, under `portal-impl` or `portal-kernel` to match the scanner:

```bash
command grep \
	--extended-regexp \
	--only-matching \
	--regexp='(tests|failures|errors)="[0-9]+"' \
	"${REPO_ROOT}/portal-kernel/test-results/unit/TEST-com.liferay.portal.modules.ModulesStructureTest.xml"
```

Delete that tree before running. A stale file from an earlier run reads exactly like a fresh one, and a clean 8 of 8 sitting on disk will be read as this run's result.

PASS when every selected scanner reports `failures="0" errors="0"` with `tests` greater than zero. FAIL on any failure, and report the assertion message.

**Never rerun a failed scanner to confirm it.** `ModulesStructureTest` repairs what it finds: several of its assertions delete or move the offending file and then fail on it, so the second run passes with nothing having been fixed. Treat the first run as the verdict and check `git status` afterwards to see what it changed.

A `.lfrbuild*` change selects `ModulesStructureTest` but is not asserted on by it. The only `.lfrbuild-portal` rule forbids the marker in archived modules and asserts nothing about live ones, so the scanner runs, checks the module tree's other invariants, and says nothing about the marker itself. Report the scanner's own result, and say that the marker change went unexamined here. [module-registration.md](module-registration.md) is what reports that case.

## Checklist

One subitem per selected scanner:

```
- [ ] portal-impl: ConfigurationEnvBuilderTest
- [ ] portal-kernel: LibraryReferenceTest
- [ ] portal-kernel: ModulesStructureTest
```

## Notes

Only these three scanners belong here. Do not add `Log4jConfigUtilTest` or `SampleSQLBuilderTest` — they do not run in CI, and **Java Unit Tests** skips them.

## Time Estimate

~1-2 min for the scanners.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall