Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/changes-filter/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ outputs:
app-website-changes:
description: 'Shared deps, `apps/website/**`, or website e2e workflow support changed.'
value: ${{ github.event_name != 'pull_request' || steps.filter.outputs.deps == 'true' || steps.filter.outputs.app_website == 'true' }}
app-billing-web-changes:
description: 'Shared deps or `apps/billing-web/**` changed.'
value: ${{ github.event_name != 'pull_request' || steps.filter.outputs.deps == 'true' || steps.filter.outputs.app_billing_web == 'true' }}
app-frontend-changes:
description: 'Shared deps or `src/**` changed.'
value: ${{ github.event_name != 'pull_request' || steps.filter.outputs.deps == 'true' || steps.filter.outputs.app_frontend == 'true' }}
Expand Down Expand Up @@ -73,6 +76,8 @@ runs:
- '.github/workflows/ci-website-e2e.yaml'
- 'scripts/cicd/prepare-website-e2e-report.sh'
- 'scripts/cicd/check-website-e2e-result.sh'
app_billing_web:
- 'apps/billing-web/**'

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.

Should this filter also list .github/workflows/ci-billing-web-unit.yaml, the way app_website just above lists ci-website-e2e.yaml and its two scripts? The consequence is visible on this very PR: run 35103654522 / 35103654481 shows billing-web-unit skipped and billing-web-unit-gate passing through the skip branch, so the job this PR adds has never executed once. The merge queue would still exercise it before anything lands on main, so this is fine to do as a follow-up.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, and the fix is prepared: app_billing_web also matches .github/workflows/ci-billing-web-unit.yaml, so a change to the workflow runs the job it defines instead of skipping past it.

Not pushed to this branch: the PR is at merge-queue position 1 (enqueued 16:04:18Z) and the branch is push-protected while queued, so landing it here would mean dequeuing and dropping your approval. It goes out as a follow-up PR together with the two codecov points below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes — fixed in #17844, which adds .github/workflows/ci-billing-web-unit.yaml to app_billing_web.

Your diagnosis holds exactly as written: run 35103654481 shows billing-web-unit skipped and billing-web-unit-gate green through the skip branch, so this PR merged without ever executing the job it added. The first execution was the post-merge push run on main (35121739924), which ran only because every filter output defaults to 'true' off pull_request.

One nuance on the precedent you cited: app_website lists ci-website-e2e.yaml, but not ci-website-unit.yaml. So the existing unit-workflow convention is actually 'do not self-list', and what landed here matched it. I still think self-listing is the right call — the gate is only meaningful if the workflow that defines it is in scope — so #17844 changes billing-web and leaves app_website alone rather than quietly altering website CI. Worth the matching one-liner for ci-website-unit.yaml, or do you prefer that asymmetry left as-is?

app_frontend:
- 'src/**'
packages:
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/ci-billing-web-unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Description: Unit tests + coverage reporting for the billing web app
# (apps/billing-web). The root unit workflow's path filter excludes apps/**.
name: 'CI: Billing Web Unit'

on:
push:
branches: [main]
pull_request:
branches-ignore: [wip/*, draft/*, temp/*]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
changes:
runs-on: ubuntu-latest
outputs:
app-billing-web-changes: ${{ steps.changes.outputs.app-billing-web-changes }}
packages-changes: ${{ steps.changes.outputs.packages-changes }}
steps:
- uses: actions/checkout@v7
- id: changes
uses: ./.github/actions/changes-filter

billing-web-unit:
needs: changes
if: ${{ needs.changes.outputs.app-billing-web-changes == 'true' || needs.changes.outputs.packages-changes == 'true' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Setup frontend
uses: ./.github/actions/setup-frontend

- name: Run billing web unit tests with coverage
run: pnpm --filter @comfyorg/billing-web test:coverage

- name: Upload billing web coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
working-directory: ./apps/billing-web
files: ./coverage/lcov.info
disable_search: true
flags: billing-web
# Re-root LCOV paths to prevent collisions with root-app coverage.
network_prefix: apps/billing-web/
token: ${{ secrets.CODECOV_TOKEN }}
# Forks have no token, so upload failures cannot block contributors.
fail_ci_if_error: ${{ github.event.pull_request.head.repo.fork != true }}

# Stable branch-protection context when tests are skipped.
billing-web-unit-gate:
needs: [changes, billing-web-unit]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Verify billing web unit tests passed or were not required
env:
CHANGES_RESULT: ${{ needs.changes.result }}
UNIT_RESULT: ${{ needs.billing-web-unit.result }}
BILLING_WEB_CHANGED: ${{ needs.changes.outputs.app-billing-web-changes }}
PACKAGES_CHANGED: ${{ needs.changes.outputs.packages-changes }}
run: |
if [ "$UNIT_RESULT" = "success" ]; then
echo "Billing web unit tests passed."
exit 0
fi
# Pass skipped tests only after successful filtering found no relevant changes.
if [ "$UNIT_RESULT" = "skipped" ] &&
[ "$CHANGES_RESULT" = "success" ] &&
[ "$BILLING_WEB_CHANGED" != "true" ] &&
[ "$PACKAGES_CHANGED" != "true" ]; then
echo "No billing web or package changes; billing web unit tests not required."
exit 0
fi
echo "::error title=Billing web unit tests::changes=$CHANGES_RESULT unit=$UNIT_RESULT billing-web=$BILLING_WEB_CHANGED packages=$PACKAGES_CHANGED"
exit 1
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ flags:
paths:
- apps/website/src/**
carryforward: false
billing-web:

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.

Is billing-web the name we want sitting next to website-unit a few lines up? Renaming a flag later costs its coverage history, so this is the cheapest moment to settle whether the convention is <app> or <app>-unit.

@dante01yoon dante01yoon Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

billing-web-unit, matching website-unit and leaving billing-web-e2e free for later. Renamed in the follow-up, in both places the flag appears: the codecov.yml flags: entry, and this workflow's Codecov flags: input.

Nothing is lost by doing it now rather than at merge: as your other comment shows, the job has never executed, so no coverage has ever been uploaded under billing-web. It does want to land before #17798, which adds ~10 billing-web test files and would be the first real upload.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed on the convention — website-unit is the only other app flag, and ci-website-unit.yaml uploads under that name, so billing-web-unit is the consistent choice. Your point about the cost of a late rename is the operative one: the flag currently holds exactly one upload (the post-merge push run), so this is as cheap as it will ever be.

It is not in #17844, and only for a mechanical reason. The rename has to move flags: in ci-billing-web-unit.yaml and both new status entries in a single commit — split across two, the upload and the config disagree and the statuses silently receive no data. The token I have carries no workflow scope, so pushing .github/workflows/ is refused outright (refusing to allow a Personal Access Token to create or update workflow ... without 'workflow' scope), and the Contents API is gated the same way.

So it needs a push from a workflow-scoped credential. Three lines, all verified locally against the Codecov validator before I had to drop them:

  • ci-billing-web-unit.yaml: flags: billing-web → flags: billing-web-unit
  • codecov.yml: flags.billing-web → flags.billing-web-unit
  • codecov.yml: the flags: list under both project.billing-web and patch.billing-web → billing-web-unit

Happy to fold it into #17844 if you or @dante01yoon re-push that branch; otherwise it should get its own PR before more history accrues under billing-web. Leaving the status-name keys as billing-web either way, matching website keying website-unit.

paths:
- apps/billing-web/src/**
carryforward: false

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.

Do we want matching project.billing-web and patch.billing-web entries under coverage.status too? The website flag has both, scoped to apps/website/src/** with flag_coverage_not_uploaded_behavior: pass — which is why this PR shows live codecov/patch/website and codecov/project/website checks and no billing-web counterparts. As it stands the new upload arrives with no dedicated status of its own.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes. The follow-up adds project.billing-web and patch.billing-web mirroring the website pair — paths: apps/billing-web/src/**, flags: [billing-web-unit], informational: true, flag_coverage_not_uploaded_behavior: pass — so the new upload reports under a status of its own instead of only feeding the comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes — added in #17844. project.billing-web and patch.billing-web now mirror the website entries verbatim apart from the path and flag: scoped to apps/billing-web/src/**, informational: true, and flag_coverage_not_uploaded_behavior: pass so a skipped job cannot fail the status.

Verified with Codecov's own validator (curl -X POST --data-binary @codecov.yml https://codecov.io/validate → Valid!); both statuses resolve to flag billing-web and path (?s:apps/billing\-web/src/.*)\Z.

Loading