Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(observability-map): static observability scorer for webapp route entry points#4455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ac13e084fd2020fa01e3e944f4cb68e09886ab911875eaaa86a07d6d751ea1b3b194363cb31cced52e17f3b582f7183976a8413e1093d4471dbb49aca8b916e4eaa7c8232d11bacda648631151fe629642f4823aec5922a99e14ca3c74869655b3ca7754cac2cb36aa751af3f11c5908b897141dd3c2f61df57d4902c013df0333e960a56808f6be5e88f04db3200c146c5ad0433ebec2061d999e3b21a4704228255accbfc73a2e9e30033e2e9ab34e4dd8128c034d68b8380fb8ca4deaafa3d3a95d7e07dc007d919ee2a11b6613e1ee43b2e030bd0d50f8e0860dd32413525ed95444d39fb46c54ec77273d12b0d6dc0bccaf9f12f661d0645447cd02789e755639d441ca9a65ff6be2500409b26552a7e6a173635f2f7b207e287b738277179f1db8e1bdcff46a7951d430023bc0387e0822c53cbfd467a7fd2cb423378e6ad5184f441fac948aea6d6ff61fe11d32c301df06e7235ad602600b78cb26c40594ea20b030fdb024f80d582de22e44b0b243042c9c3420d2db272c3df70a6bf8be72dd50313884eb01d0aace534282bb097b7cc564902379bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -22,6 +22,7 @@ jobs: | ||
| webapp: ${{ steps.filter.outputs.webapp }} | ||
| packages: ${{ steps.filter.outputs.packages }} | ||
| internal: ${{ steps.filter.outputs.internal }} | ||
| obsmap: ${{ steps.filter.outputs.obsmap }} | ||
| cli: ${{ steps.filter.outputs.cli }} | ||
| sdk: ${{ steps.filter.outputs.sdk }} | ||
| steps: | ||
| @@ -81,6 +82,36 @@ jobs: | ||
| - 'pnpm-lock.yaml' | ||
| - 'pnpm-workspace.yaml' | ||
| - 'turbo.json' | ||
| # The whole webapp app tree, not just its routes, and that is the whole reason this | ||
| # filter exists. Two tests in @internal/observability-map read it: integration.test.ts | ||
| # scans the live route tree, and webappSymbols.test.ts walks all of apps/webapp/app and | ||
| # fails when a guard, sensitive or audit symbol stops resolving. Routes-only was this | ||
| # filter's own bug: renaming e.g. requireUserId in app/services/session.server.ts | ||
| # matched `webapp` and nothing else, so no job ran the suite and the break landed on | ||
| # main, or on the next unrelated internal-packages PR. | ||
| # | ||
| # The cost of the wider set, measured over the last 400 commits on main: 31% touch | ||
| # routes, 52% touch apps/webapp/app, so the job goes from firing on roughly a third of | ||
| # PRs to roughly a half. It is the cheap one -- a single 4x runner, no containers, no | ||
| # database, no prisma generate -- which is what makes that affordable. | ||
| # | ||
| # observability-map.yml is here because integration.test.ts asserts on its text and no | ||
| # other filter watches it, so editing the report workflow alone ran nothing at all. | ||
| # | ||
| # Deliberately NOT here: this package's own paths, and packages/plugins/src and | ||
| # internal-packages/rbac/src, the other two trees webappSymbols.test.ts reads. | ||
| # `internal` above already matches `internal-packages/**` and `packages/**`, and | ||
| # `unit-tests-internal.yml` runs `turbo run test --filter "@internal/*"`, which picks up | ||
| # @internal/observability-map and runs the same vitest suite. Listing them here as well | ||
| # ran the suite twice on every PR touching them, which was this filter's own doing. | ||
| obsmap: | ||
| - 'apps/webapp/app/**' | ||
| - '.github/workflows/pr_checks.yml' | ||
| - '.github/workflows/unit-tests-observability-map.yml' | ||
| - '.github/workflows/observability-map.yml' | ||
| - 'package.json' | ||
| - 'pnpm-lock.yaml' | ||
| - 'pnpm-workspace.yaml' | ||
1stvamp marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| cli: | ||
| - 'packages/cli-v3/**' | ||
| - 'packages/build/**' | ||
| @@ -149,6 +180,11 @@ jobs: | ||
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| obsmap: | ||
| needs: changes | ||
| if: needs.changes.outputs.obsmap == 'true' | ||
| uses: ./.github/workflows/unit-tests-observability-map.yml | ||
1stvamp marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| e2e: | ||
| needs: changes | ||
| if: needs.changes.outputs.cli == 'true' | ||
| @@ -172,6 +208,7 @@ jobs: | ||
| - e2e-webapp | ||
| - packages | ||
| - internal | ||
| - obsmap | ||
| - e2e | ||
| - sdk-compat | ||
| if: always() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| name: "🧪 Unit Tests: Observability Map" | ||
| permissions: | ||
| contents: read | ||
| # Its own workflow rather than a job inside observability-map.yml, because that workflow is not | ||
| # reachable from pr_checks.yml's all-checks aggregate and so gates nothing. Called from there | ||
| # instead, behind a paths filter, which is how every other test suite in this repo is gated. | ||
| on: | ||
| workflow_call: | ||
| jobs: | ||
| unitTests: | ||
| name: "🧪 Unit Tests: Observability Map" | ||
| # No containers and no database: the package is a static analyser over source text, so the | ||
| # suite is CPU bound on parsing the route tree and needs nothing the runner does not have. | ||
| runs-on: warp-ubuntu-latest-x64-4x | ||
| steps: | ||
| - name: ⬇️ Checkout repo | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| fetch-depth: 1 | ||
| persist-credentials: false | ||
| - name: ⎔ Setup pnpm | ||
| uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0 | ||
| with: | ||
| version: 10.33.2 | ||
| - name: ⎔ Setup node | ||
| uses: WarpBuilds/setup-node@bc639b444d583175926b588962199c247d23e8d3 # v6 | ||
| with: | ||
| node-version: 24.18.0 | ||
| cache: "pnpm" | ||
| - name: 📥 Download deps | ||
| run: pnpm install --frozen-lockfile | ||
| # This suite reads apps/webapp/app (the route tree for the scan, the whole app tree for the | ||
| # symbol check) and the report workflow's text, which is why the filter that gates this | ||
| # workflow watches all of those and not only the routes folder. | ||
| - name: 🧪 Run tests | ||
| run: pnpm --filter @internal/observability-map run test |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.