Skip to content

Conversation

@matthewdavidrodgers
Copy link
Contributor

As noted in the comments, normally we'd need to validate this jwt, but since any uploads depend on a valid jwt (and are validated later) it's fine to just decode the jwt and check for this feature

For WC-4185

Describe your change...


  • Tests
    • Tests included/updated
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal-only change
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: not a patch change

A picture of a cute animal (not mandatory, but encouraged)

@matthewdavidrodgers matthewdavidrodgers requested review from a team as code owners December 5, 2025 00:03
@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 9d1e1a1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 5, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11529

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11529

miniflare

npm i https://pkg.pr.new/miniflare@11529

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11529

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11529

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11529

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11529

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11529

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11529

wrangler

npm i https://pkg.pr.new/wrangler@11529

commit: 9d1e1a1

@matthewdavidrodgers matthewdavidrodgers force-pushed the matthewrodgers/WC-4185-pages-100k-assets branch from 7ba955a to c9cee82 Compare December 5, 2025 00:12
if (fileMap.size > fileCountLimit) {
throw new FatalError(
`Error: Pages only supports up to ${MAX_ASSET_COUNT.toLocaleString()} files in a deployment. Ensure you have specified your build output directory correctly.`,
`Error: Pages only supports up to ${fileCountLimit.toLocaleString()} files in a deployment. Ensure you have specified your build output directory correctly.`,
Copy link
Contributor

@danielrs danielrs Dec 5, 2025

Choose a reason for hiding this comment

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

Since this now varies depending on plan, maybe we should say Pages only supports up to N files in a deployment for your current account plan or similar. Also, are we sure we don't need cloudflare-docs change as well?

Choose a reason for hiding this comment

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

✅️

Choose a reason for hiding this comment

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

✅️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes - a docs pr is needed here too. but i want to make sure the approach is ok first

const fileMap = await validate({ directory });
const fileMap = await validate({
directory,
fileCountLimit: isMoreFilesEnabled(process.env.CF_PAGES_UPLOAD_JWT)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd personally just give a claim with the actual file limit ({ files: 100_000 } — default 20k). That way we don't need to change Wrangler again if we ever increase this further.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was trying to fit into the "features" structure earlier, but i like the flexibility with your approach. updated

Choose a reason for hiding this comment

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

Go Report Card License

Go Report Card

A web application that generates a report on the quality of an open source Go project. It uses several measures, including gofmt, go vet, go lint and gocyclo. To get a report on your own project, try goreportcard.com.

Sponsors

Support us over on Patreon!

Installation

git clone https://github.com/gojp/goreportcard.git
cd goreportcard
make install

Now run:

GRC_DATABASE_PATH=./db make start

and you should see

Running on :8000...

Navigate to localhost:8000 and you should see the Go Report Card front page.

Command Line Interface

There is also a CLI available for grading applications on your local machine.

Example usage:

git clone https://github.com/gojp/goreportcard.git
cd goreportcard
make install
go install ./cmd/goreportcard-cli
goreportcard-cli
Grade .......... A+  99.9%
Files ................ 362
Issues ................. 2
gofmt ............... 100%
go_vet ............... 99%
gocyclo .............. 99%
golint .............. 100%
ineffassign ......... 100%
license ............. 100%
misspell ............ 100%

Verbose output:

goreportcard-cli -v
Grade .......... A+  99.9%
Files ................ 362
Issues ................. 2
gofmt ............... 100%
go_vet ............... 99%
go_vet  vendor/github.com/prometheus/client_golang/prometheus/desc.go:25
        error: cannot find package "github.com/prometheus/client_model/go" in any of: (vet)

gocyclo .............. 99%
gocyclo download/download.go:22
        warning: cyclomatic complexity 17 of function download() is high (> 15) (gocyclo)

golint .............. 100%
ineffassign ......... 100%
license ............. 100%
misspell ............ 100%

Contributing

Go Report Card is an open source project run by volunteers, and contributions are welcome! Check out the Issues page to see if your idea has already been mentioned. Feel free to raise an issue or submit a pull request.

Academic Citation

If you use Go Report Card for academic purposes, please use the following citation:

@Misc{schaaf-smith-goreportcard,
    author = {Schaaf, Herman and Smith, Shawn},
    title  = {Go Report Card: A report card for your Go application},
    year   = {2015--},
    url    = {https://www.goreportcard.com/},
    note   = {[Online; accessed <today>]}
}

License

The code is licensed under the permissive Apache v2.0 license. Read this for a summary.

Choose a reason for hiding this comment

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

Go Report Card License

Go Report Card

A web application that generates a report on the quality of an open source Go project. It uses several measures, including gofmt, go vet, go lint and gocyclo. To get a report on your own project, try goreportcard.com.

Sponsors

Support us over on Patreon!

Installation

git clone https://github.com/gojp/goreportcard.git
cd goreportcard
make install

Now run:

GRC_DATABASE_PATH=./db make start

and you should see

Running on :8000...

Navigate to localhost:8000 and you should see the Go Report Card front page.

Command Line Interface

There is also a CLI available for grading applications on your local machine.

Example usage:

git clone https://github.com/gojp/goreportcard.git
cd goreportcard
make install
go install ./cmd/goreportcard-cli
goreportcard-cli
Grade .......... A+  99.9%
Files ................ 362
Issues ................. 2
gofmt ............... 100%
go_vet ............... 99%
gocyclo .............. 99%
golint .............. 100%
ineffassign ......... 100%
license ............. 100%
misspell ............ 100%

Verbose output:

goreportcard-cli -v
Grade .......... A+  99.9%
Files ................ 362
Issues ................. 2
gofmt ............... 100%
go_vet ............... 99%
go_vet  vendor/github.com/prometheus/client_golang/prometheus/desc.go:25
        error: cannot find package "github.com/prometheus/client_model/go" in any of: (vet)

gocyclo .............. 99%
gocyclo download/download.go:22
        warning: cyclomatic complexity 17 of function download() is high (> 15) (gocyclo)

golint .............. 100%
ineffassign ......... 100%
license ............. 100%
misspell ............ 100%

Contributing

Go Report Card is an open source project run by volunteers, and contributions are welcome! Check out the Issues page to see if your idea has already been mentioned. Feel free to raise an issue or submit a pull request.

Academic Citation

If you use Go Report Card for academic purposes, please use the following citation:

@Misc{schaaf-smith-goreportcard,
    author = {Schaaf, Herman and Smith, Shawn},
    title  = {Go Report Card: A report card for your Go application},
    year   = {2015--},
    url    = {https://www.goreportcard.com/},
    note   = {[Online; accessed <today>]}
}

License

The code is licensed under the permissive Apache v2.0 license. Read this for a summary.

@matthewdavidrodgers matthewdavidrodgers force-pushed the matthewrodgers/WC-4185-pages-100k-assets branch from c9cee82 to 1004d6f Compare December 5, 2025 22:26
@matthewdavidrodgers matthewdavidrodgers changed the title WC-4185 Support 100k assets when jwt claim more_files is present WC-4185 Support variable asset count based on claims from upstream Dec 5, 2025
@matthewdavidrodgers matthewdavidrodgers force-pushed the matthewrodgers/WC-4185-pages-100k-assets branch from 1004d6f to 5fb4f51 Compare December 5, 2025 22:43
As noted in the comments, normally we'd need to validate this jwt, but
since any uploads depend on a valid jwt (and are validated later) it's
fine to just decode the jwt and check for this feature
@matthewdavidrodgers matthewdavidrodgers force-pushed the matthewrodgers/WC-4185-pages-100k-assets branch from 5fb4f51 to 9d1e1a1 Compare December 5, 2025 23:08
@Mahmoodyazdanpanah
Copy link

✅️🫡

1 similar comment
@Mahmoodyazdanpanah
Copy link

✅️🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants