Skip to content

chore: coverage targets, build metadata, delete e2e, cleanups - #5996

Merged
norman-abramovitz merged 18 commits into
cloudfoundry:developfrom
nabramovitz:norm/chore/coverage-targets
Oct 8, 2026
Merged

norman-abramovitz merged 18 commits into
cloudfoundry:developfrom
nabramovitz:norm/chore/coverage-targets

Conversation

@nabramovitz

@nabramovitz nabramovitz commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

This PR collects one session's work as separate commits. Each section below can be reviewed on its own.

1. Coverage targets

  • make check coverage runs frontend and backend coverage. make check frontend coverage and make check backend coverage run one side, the same way build and test treat those modifiers.
  • Backend coverage is new: one Go profile per module in coverage/backend/, each module's total, and the statement total across all seven modules.
  • Frontend coverage now counts every source file. The report moved to coverage/frontend/.

Why the frontend numbers change

In projects mode Vitest reads coverage options only from the root config. The per-package coverage blocks were ignored, so the report held only files some test loaded: 85 source files that no test imports never counted, while about 160 test helpers did. The root config now owns coverage (include: ['src/**/*.ts'], matched against each project's root), and the dead per-package blocks are removed.

Frontend Before After
Statements 63.5% 62.0%
Branches 44.6% 43.7%
Functions 56.5% 55.3%
Lines 63.7% 62.2%

All 1038 source files appear in the report (0 missing, no test helpers).

Backend, first measurement: 31.8% of 25,645 statements. src/jetstream 43.2%, api 12.2%, cfapppush 13.9%, analysis/container 12.1%, kubernetes/auth 5.9%, kubernetes 1.8%, monocular 0.9%.

2. index.html build values

  • Every frontend build now writes the stratos.yaml title, git metadata and build date into the built dist/frontend/browser/index.html. Before, the build rewrote the tracked source once, and later builds in the same checkout kept those first values.
  • The source index.html holds plain defaults with a comment saying the build replaces them. Setup no longer hides it with skip-worktree; a checkout that still holds an old rewritten copy gets a warning with the restore command.
  • The git metadata step re-runs on every build. Its cache never invalidated in a worktree.
  • Release builds record the release tag as the branch (the About page showed HEAD). A checkout with no branch and no tag records the short commit. version.mk and store-git-metadata.cjs share the rule, and make dump version now shows the branch.

3. Branding docs

  • docs/branding-architecture.md "How to Rebrand" pointed at a company-config.json path and a make build cf target that don't exist. It now covers source builds and the pre-built packages, and where the tab title comes from before and after the app starts.
  • The cf and all-in-one deploy guides say which files to edit or mount to rebrand. Hand editing is documented as interim until the branding tool is ready.
  • The stratos.yaml title description no longer claims it reaches the About page.

4. Cleanups

  • Removed the unused devkit application and dev-server builders. Their directory moved the compiled devkit, so bun run prepare-backend and setup could not find dist-devkit/backend.js. Both work again.
  • Removed stratos-buildpack.yml, deploy/cloud-foundry/build.sh and deploy/cloud-foundry/start.sh. They served the old source-building buildpack, which the current deploy no longer uses. The release note says v5.5.5 is the last release with them and how to restore them.

5. Application delete e2e suite

Rewrote application-delete.spec.ts and its page object for the two-phase delete (the wizard collects routes and bindings, then the detail page's Delete dialog runs it). 12 tests cover:

  • the wizard steps, Cancel, and the dialog;
  • routes kept or deleted, and the shared-route badge;
  • unbinding a service while keeping the instance;
  • an injected delete failure, then a retry.

Results are checked against the CF API, not just the UI. The three "Delete via CF API" tests could never fail before; they now poll for the app to go. Removed the hollow delete-app-services-smoke.spec.ts. Both rewritten files left the e2e ratchet list (95 remain).

Checks

  • make check gate green on the final commit: lint, e2e ratchet, 3769 unit tests, production build.
  • application-delete: 38/38 live on a lab foundation (the spec run three times). Reverse tests fail as expected; no leftovers.
  • A build with title: Acme Cloud Console writes it to the built index.html and leaves the source unchanged.
  • Branch recording tested on a branch, detached at v5.5.5, and detached with no tag.
  • The docs website builds (it fails on broken links).
  • make -n over every check combination: each runs only the intended half.

Not in this PR

Found while working, left for separate decisions:

  • On a direct-URL load of /delete, the "Gathering application information" overlay blocks the wizard for 1–2 s.
  • No step header is highlighted when the first visible wizard step isn't the first defined step.
  • The Delete dialog shows org "?" / space "?" on the direct-URL path.
  • src/frontend/packages/devkit/src/build/ looks unused.

AI disclosure (RFC-0047): prepared with AI coding assistance; reviewed by the author.

In projects mode Vitest reads coverage options only from the root
config, so the per-package blocks were ignored and the report held
only files some test loaded: 85 source files no test imports never
counted, and about 160 test helpers did. The root config now owns
coverage, matching src/**/*.ts against each project's own root, and
writes to coverage/frontend/. The dead per-package blocks are gone.

All 1038 source files now appear in the report. Statements go from
63.5% to 62.0%, branches from 44.6% to 43.7%.
make check coverage now runs frontend and backend coverage, and
frontend or backend narrows it to one side, the same way build and
test treat those modifiers. The backend side writes one Go profile
per module to coverage/backend/ and prints each module's total and
the statement total across all seven. frontend and backend are valid
on check only next to coverage, so a bare make check frontend still
warns instead of running lint and gate.
The orchestrator rewrote the tracked source index.html in place,
replacing its @@ tokens. With the tokens gone, every later build in
that checkout kept the first title and git metadata, and setup hid the
changed file with skip-worktree so git status never showed it. The
build-cf script runs no orchestrator, so it shipped the raw tokens.

The source now holds plain defaults (title "Stratos", empty metadata)
so the dev server shows a sane page. The prebuild-application builder
runs the transformer on the built index.html after each successful
build. The transformer replaces element contents instead of tokens,
so it can run again on its own output, and it escapes the values.
Setup marked src/frontend/packages/core/src/index.html skip-worktree
because the build rewrote it. The build no longer touches it, so setup
now clears the flag, and warns when an older build left a rewritten
copy behind.
The store-git-metadata step was cached on .git/HEAD and
.git/refs/heads/**. In a worktree .git is a file, so neither pattern
matches and the step never ran again; packed refs hide commits the
same way in a clone. The script is three git calls, so run it always.
devkit/builders held an application and a dev-server builder that no
angular.json target uses; the build runs tools/builders instead. The
application builder also started the prebuild with node directly.

The directory also moved tsc's inferred root from devkit/src up to
devkit, so every output landed under dist-devkit/src/. That broke the
paths that expect the src-relative layout: the prepare-backend script
and post-setup look for dist-devkit/backend.js, and the stratos-theme
builders.json names ./theme.builder beside it. angular.json had been
pointed at dist-devkit/src/backend.js to work around it.

Pin rootDir to src so the layout cannot drift again, and point
angular.json back at dist-devkit/backend.js.
stratos-buildpack.yml, deploy/cloud-foundry/build.sh and start.sh
served the retired custom Stratos buildpack, which built the UI from
source during cf push. Cloud Foundry deploys now push the pre-built
zip with binary_buildpack and never run them; nothing in the repo
calls them. v5.5.5 is the last release that has them.
Comment thread src/frontend/packages/core/src/index.html
Deleting an app takes two phases: the /delete wizard only collects the
routes to delete and bindings to unbind, and its Confirm returns to the
detail page, whose Delete dialog runs the delete. The suite still drove
a one-page flow, so six tests failed and ten passed without asserting
anything (dead Material selectors behind isVisible().catch guards).

The page object now drives both phases and the spec checks the outcome
in Cloud Foundry: wizard steps and cancel, the dialog's cancel and
confirm, a kept and a deleted route, the shared-route badge, an unbound
service whose instance survives, and an injected delete failure plus
retry. The three CF API tests could not fail either: the
expect(true).toBe(false) sat inside a try whose catch passed. They now
poll appExists. cf-api.helper gains app/route/service-instance/binding
existence checks.

goToConfirmStep waits for each step's opening sentence to change: a
step's own content re-renders after it loads and the button label lags
the content by a frame, and acting on either clicked Next twice, which
submits on Confirm.

delete-app-services-smoke.spec.ts is removed: its picker test passed
whether or not the picker rendered, and the services test covers it.
Both rewritten files leave the e2e ratchet list.
The source index.html now holds plain defaults, so readers expect the
title to be fixed. Say beside it that every build writes the
stratos.yaml title, git metadata and build date into the built copy.
The steps pointed at a company-config.json path that does not exist
and a `make build cf` target that does not exist, and said nothing
about the pre-built packages. Say where a release zip or all-in-one
image keeps the file, how a source build produces a package, and
where the tab title comes from before and after the app starts. The
stratos.yaml title does not reach the About page; it sets the built
index.html title.
Release CI checks out the tag, which leaves HEAD detached, so the
About page, the backend version info and the index.html metadata all
recorded the branch as "HEAD". When there is no branch, record the
tag on HEAD, else the short commit. version.mk and
store-git-metadata.cjs use the same rule so the values agree.
Record that release builds now show their tag as the branch.
Point the release zip and all-in-one guides at the files to edit or
mount, and say that the first title can differ from the company name
and that hand editing is interim until the branding tool is ready.
BUILD_VCS_BRANCH feeds the About page and the backend version info,
so show it beside the other VCS values when checking a build.
@nabramovitz nabramovitz changed the title chore: frontend and backend coverage targets chore: coverage targets, build metadata, delete e2e, cleanups Oct 8, 2026

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the additional changes

@norman-abramovitz
norman-abramovitz marked this pull request as ready for review October 8, 2026 14:47
@norman-abramovitz
norman-abramovitz merged commit 3685208 into cloudfoundry:develop Oct 8, 2026
24 checks passed
@nabramovitz
nabramovitz deleted the norm/chore/coverage-targets branch October 8, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants