Repository navigation
test: let the Playwright stack sign its own enterprise licenses - #7375
Conversation
ddaa330 to
b7b34d0
Compare
|
/review |
|
Claude finished @luizhf42's task in 8m 0s —— View job Code Review CompleteReviewed 9 files on Standards (repo rules, language conventions, tests, code smells) and Correctness (security and runtime defects). No new issues found, and the code looks good as-is. The Spec axis did not run: the only issue this PR references, shellhub-io/team#298, is in another repository that this run cannot read. Correctness checks that came back clean:
Additional notes
|
b7b34d0 to
0da0735
Compare
0da0735 to
491a5c0
Compare
491a5c0 to
268e393
Compare
268e393 to
fc9d006
Compare
fc9d006 to
3842123
Compare
3842123 to
3dde91c
Compare
5fe2a32 to
5f58275
Compare
5f58275 to
f68899a
Compare
|
/review |
f68899a to
223580b
Compare
|
Claude finished @otavio's task in 4m 7s —— View job Code Review CompleteReviewed 7 files and posted 2 inline issues. Standards: 0 violations, 1 judgement call. Spec: did not run. Correctness: 1. StandardsThe only finding is a judgement call. Correctness
These checks came back clean:
SpecThe Spec axis did not run. The only issue referenced, shellhub-io/team#298 (in the To request another review round, comment |
94e197d to
0579753
Compare
|
/review |
1 similar comment
|
/review |
|
Claude finished @otavio's task in 3m 14s —— View job Code Review CompleteReviewed 13 files and posted 1 inline issue. Standards: 1 violation, 0 judgement calls. Spec: did not run. Correctness: 0. StandardsThe doc comment on SpecThe Spec axis did not run. The only issue this PR references is shellhub-io/team#298 (the Additional notes
To request another review round, comment |
0579753 to
fe23233
Compare
|
/review |
|
Claude finished @otavio's task in 1m 59s —— View job Code Review CompleteI reviewed 13 files on Standards (repo rules, language conventions, tests, code smells) and Correctness (security and runtime defects). I found no new issues, and the code looks good as it is. The Spec axis did not run. The only issue this PR references is shellhub-io/team#298 (the |
|
/review |
|
Claude finished @otavio's task in 4m 59s —— View job Code Review CompleteReviewed 13 files and posted 1 inline issue. Standards: 0 violations, 0 judgement calls. Spec: 3. Correctness: 0. StandardsNo violations. All four doc comments that remain ( SpecThe Spec axis ran against shellhub-io/team#298 this time. User stories 1, 3, 4 and 5 are met. Three requirements are missing or only partly done:
Additional notes
To request another review round, comment |
fe23233 to
031ac32
Compare
|
/review |
|
Claude finished @otavio's task in 6m 30s —— View job Code Review CompleteReviewed 15 files. 2 inline issues posted. Standards: 0 violations, 1 judgement call. Spec: 1 partial (plus 1 already reported). Correctness: 1. StandardsThe one judgement call is Dead Code. In Correctness
Spec (shellhub-io/team#298)User stories 1–5 are all met. The CI workflow references neither secret, the cloud edition gets the expired license too, and the key path resolves in the
Additional notes
To request another review round, comment |
031ac32 to
d096e54
Compare
d096e54 to
c5bde4e
Compare
|
/review |
|
Claude finished @otavio's task in 3m 20s —— View job Code Review CompleteReviewed 16 files. 1 inline issue posted. Standards: 1 violation, 0 judgement calls. Spec: 0 new. Correctness: 0. StandardsThis branch rewrote the doc comment on SpecThe Spec axis ran against shellhub-io/team#298.
Additional notes
To request another review round, comment |
The Go suite already runs enterprise stacks under licenses a run issuer signs, but `stack up` started its run without one, so the Playwright stack still loaded the license SHELLHUB_LICENSE_FILE named and the license spec read its expired license from the environment. Both had to be real licenses signed with the production key, and both break when they expire. `stack up` now loads the issuer from `.stack/license-issuer.pem`, the key the Go suite uses, so both build the same server and share its cached layers. For an enterprise or cloud stack it also signs `E2E_EXPIRED_LICENSE`, a license that expired a year ago, well past the 7-day grace period, and exports it with the rest. `stack down` attaches to the existing stack and builds nothing, so its run takes no issuer. It exports `E2E_LICENSE_ISSUER_KEY` too, the key's absolute path, so a spec that needs a license of its own, past a device limit or bound to another region, can sign one against the stack's server. The test and e2e containers mount the workspace at the same path, so the path `stack up` resolves is the one Playwright reads. It is also the first exported value that holds the checkout's path, and `e2e.sh` evals the export lines, so a space in that path would stop the script after the stack was up. `printExports` now quotes every value for the shell. Both runners name the key through `environment.LicenseIssuerKeyPath`. Two literals could drift apart without failing anything; the two builds would just stop sharing their cache. The signed license `Up` writes to `.stack/licenses/<project>.dat` is new for these stacks, and `stack down` left it behind. `Down` removed a stack's license and GeoIP files only when `Up` had started the stack in the same process, and `stack down` runs in another, reaching the stack through `Attach`. `Attach` now derives those paths from the project name, the way `Up` does, and `Down` removes them for an attached stack too. With `stack up` exporting it, the license spec's own hint for a missing E2E_EXPIRED_LICENSE, to supply an expired license by hand, now points at a license this run's server rejects as invalid. The spec falls back to `requireEnv`'s default hint, which leaves `hint` with no caller, so it goes. Fixes: shellhub-io/team#298
`stack up` signs the stack's license and `E2E_EXPIRED_LICENSE` with the key its server trusts, so nothing reads `TEST_LICENSE` or `TEST_EXPIRED_LICENSE` any more. Delete both secrets once this lands.
`stack up` and the Go suite now both start their runs with an issuer, so no enterprise or cloud stack reaches the branch that loaded the license SHELLHUB_LICENSE_FILE named in the shell or .env.override. Left in place, it would let a run without an issuer start an enterprise stack under a license signed with the production key, which is what team#298 removes: such a license has to be supplied by hand and breaks when it expires. An enterprise or cloud stack on a run that issues no licenses now fails with errRunIssuesNoLicense, unless it asks for no license through Unlicensed. `stack down` still starts its run without an issuer; it attaches to the stack and never signs a license. `WriteLicenseFile` drops its own check for a run without an issuer. A stack on such a run is now community or Unlicensed, so the check for a license file right after it already fails. The variable stays. The compose files mount the license `Up` signs through it, and the dev stack reads it from .env.override.
c5bde4e to
dc28332
Compare
|
/review |
|
Claude finished @otavio's task in 2m 11s —— View job Code Review CompleteReviewed 16 files on all three axes: Standards (repo rules, language conventions, tests, code smells), Spec (does it implement the issue?) and Correctness (security and runtime defects). No new issues found. The code looks good as-is. |
Summary
#7390 made the Go suite sign its own enterprise licenses. The Playwright stack still started its run without an issuer, so the enterprise UI e2e kept reading real licenses from the
TEST_LICENSEandTEST_EXPIRED_LICENSEsecrets, which break when they expire.Closes shellhub-io/team#298
Evidence
TEST_LICENSEandTEST_EXPIRED_LICENSE, and the expired-license test fails without the second one.After:
ui/scripts/e2e.sh test --edition=enterprise e2e/license.spec.ts e2e/admin.spec.tspasses 6/6 with neither set, including "with an expired license every admin page sends the admin to the license page".Merge Danger
Door: two-way
Blast Radius: e2e
Only the e2e harness and the UI e2e workflow change. The cloud edition hasn't been run locally because it needs Stripe keys. After this merges, delete the
TEST_LICENSEandTEST_EXPIRED_LICENSEsecrets.