-
Notifications
You must be signed in to change notification settings - Fork 36
Add package resource file sizes to PackageRevision interface #954
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
Open
JamesMcDermott
wants to merge
19
commits into
kptdev:main
Choose a base branch
from
Nordix:feature-fetch-size-limit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ece05e8
Feat: add package resource file sizes to PackageRevision interface
JamesMcDermott 2edcdc3
Update documentation to include new size-on-disk field
JamesMcDermott 34b8fd8
missed some generated bits
JamesMcDermott 0b6b3c1
Fix tests, revert "Size on Disk" column from PackageRevision table
JamesMcDermott 6ee13ee
unit test fixes after table column reversion
JamesMcDermott ecd85fa
update e2e tests' expectations
JamesMcDermott 8baf5e4
Address review comments
JamesMcDermott b908fe1
Address review comments part 2
JamesMcDermott e463d70
fix failing CR-cache E2E tests
JamesMcDermott 6128f78
comment nitpick to retrigger CI
JamesMcDermott bdb2ae3
comment nitpick to retrigger CI
JamesMcDermott e0e8162
comment nitpick to retrigger CI
JamesMcDermott 0d7037a
nitpick to retrigger CI
JamesMcDermott afc9dd4
replace missed nephio-project imports with kptdev
JamesMcDermott b807ffd
Address Copilot review comments
JamesMcDermott 9b92fe8
Address Copilot review comments part 2
JamesMcDermott e76c342
ssimplify tests' DB cache detection - missed Copilot review comment
JamesMcDermott d816485
nitpick to retrigger CI
JamesMcDermott e7c96d0
Address Copilot review comments part 3
JamesMcDermott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| Copyright 2026 The kpt Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| ALTER TABLE package_revisions | ||
| DROP COLUMN IF EXISTS resources_size; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| Copyright 2026 The kpt Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| -- Add the resources_size column - stores the total size of a package revision's | ||
| -- resource files in bytes so it can be found without having to retrieve the full | ||
| -- resources. | ||
| ALTER TABLE package_revisions | ||
| ADD COLUMN IF NOT EXISTS resources_size BIGINT NOT NULL DEFAULT 0; | ||
|
|
||
| -- In the event of an upgrade with repositories already synced, Porch's sync | ||
| -- routines (manual or background) will not detect the need to backfill | ||
| -- resource sizes for existing package revisions. | ||
| -- Go through them once, calculating their resource sizes, and backfill the | ||
| -- resources_size column. | ||
| UPDATE package_revisions pr | ||
| SET resources_size = r.total_size | ||
| FROM ( | ||
| SELECT k8s_name_space, k8s_name, revision, SUM(OCTET_LENGTH(resource_value)) AS total_size | ||
| FROM resources | ||
| GROUP BY k8s_name_space, k8s_name, revision | ||
| ) r | ||
| WHERE pr.k8s_name_space = r.k8s_name_space | ||
| AND pr.k8s_name = r.k8s_name | ||
| AND pr.revision = r.revision; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* | ||
| Copyright 2026 The kpt Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| -- Add the resources_size column - stores the total size of a package revision's | ||
| -- resource files in bytes so it can be found without having to retrieve the full | ||
| -- resources. | ||
| ALTER TABLE package_revisions | ||
| ADD COLUMN IF NOT EXISTS resources_size BIGINT NOT NULL DEFAULT 0; | ||
|
|
||
| -- In the event of an upgrade with repositories already synced, Porch's sync | ||
| -- routines (manual or background) will not detect the need to backfill | ||
| -- resource sizes for existing package revisions. | ||
| -- Go through them once, calculating their resource sizes, and backfill the | ||
| -- resources_size column. | ||
| UPDATE package_revisions pr | ||
| SET resources_size = r.total_size | ||
| FROM ( | ||
| SELECT k8s_name_space, k8s_name, revision, SUM(OCTET_LENGTH(resource_value)) AS total_size | ||
| FROM resources | ||
| GROUP BY k8s_name_space, k8s_name, revision | ||
| ) r | ||
|
JamesMcDermott marked this conversation as resolved.
|
||
| WHERE pr.k8s_name_space = r.k8s_name_space | ||
| AND pr.k8s_name = r.k8s_name | ||
| AND pr.revision = r.revision; | ||
|
JamesMcDermott marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| Copyright 2026 The kpt Authors | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| ALTER TABLE package_revisions | ||
| DROP COLUMN IF EXISTS resources_size; |
|
efiacor marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...iants/pkg/controllers/packagevariant/packagevariant_controller-with-workspacename_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
efiacor marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.