Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jonesphillip
Copy link
Contributor

@jonesphillip jonesphillip commented Sep 24, 2025

Updated catalog compaction enable argument from targetSizeMb to target-size. Small fixes for pipelines commands, defaults.

CR-1309255


  • Tests
    • Tests included
    • Tests not necessary because:
  • Public documentation
    • [] Cloudflare docs PR(s):
    • Documentation not necessary because: fixing bugs, small changes
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: change is related to new product

@jonesphillip jonesphillip requested a review from a team as a code owner September 24, 2025 02:43
Copy link

changeset-bot bot commented Sep 24, 2025

🦋 Changeset detected

Latest commit: 7f68455

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

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

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

Copy link
Contributor

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main pjones/wrangler-pipelines-catalog-fixes might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-10743
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

Copy link

pkg-pr-new bot commented Sep 24, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 7f68455

@petebacondarwin petebacondarwin force-pushed the pjones/wrangler-pipelines-catalog-fixes branch from 1f708de to d248cfa Compare September 24, 2025 09:04
Comment on lines +172 to 173
file_size_bytes?: number;
interval_seconds: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting that file size is now optional but interval is not?

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 that's correct, since interval_seconds has a default so should always be present

"The target size for compacted files in MB (allowed values: 64, 128, 256, 512)",
type: "number",
demandOption: false,
default: 128,
Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty sure that by having a default here, this option will never be undefined which might mess up your logic later?

Copy link
Contributor

Choose a reason for hiding this comment

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

I might be totally wrong but in other parts of Wrangler we have a pattern where a value can be configured in both the Wrangler config file but also on the command line.
In that case it is important that we don't have a default for the command line arg because then we never know if the user actually specified a value or whether it is just the default, so we don't know whether to override what is in the config.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK I am totally wrong. I see that this option doesn't get merged with other config. So it is all good.

Copy link
Contributor

Choose a reason for hiding this comment

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

I note that now this value is used in the only call to enabledR2CatalogCompaction(), which expects the value of targetSizeMb to be number|undefined.

But since this will always be defined (thanks to the default value) then that function could just take number.
The follow on is that R2CatalogCompactionConfig can make its targetSizMb to be only number. Making this comment redundant:

// If undefined, the service will set the default value

@petebacondarwin petebacondarwin added the skip-v3-pr Skip validation of presence of a v3 backport PR label Sep 24, 2025
@petebacondarwin petebacondarwin force-pushed the pjones/wrangler-pipelines-catalog-fixes branch from d248cfa to 7f68455 Compare September 24, 2025 13:38
"The target size for compacted files in MB (allowed values: 64, 128, 256, 512)",
type: "number",
demandOption: false,
default: 128,
Copy link
Contributor

Choose a reason for hiding this comment

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

I note that now this value is used in the only call to enabledR2CatalogCompaction(), which expects the value of targetSizeMb to be number|undefined.

But since this will always be defined (thanks to the default value) then that function could just take number.
The follow on is that R2CatalogCompactionConfig can make its targetSizMb to be only number. Making this comment redundant:

// If undefined, the service will set the default value

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Sep 24, 2025
@petebacondarwin petebacondarwin merged commit a7ac751 into main Sep 24, 2025
43 of 44 checks passed
@petebacondarwin petebacondarwin deleted the pjones/wrangler-pipelines-catalog-fixes branch September 24, 2025 15:29
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Sep 24, 2025
@lrapoport-cf lrapoport-cf mentioned this pull request Sep 24, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-v3-pr Skip validation of presence of a v3 backport PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants