Skip to content

Conversation

AustinAbro321
Copy link
Contributor

Description

Currently we archive a package after it's pulled, only to unarchive it after. This changes the logic to only archive a package pull when necessary saving time.

Testing on the uds-core package, it saves about 8 seconds on my machine https://github.com/defenseunicorns/uds-core/pkgs/container/packages%2Fuds%2Fcore

Checklist before merging

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Copy link

netlify bot commented Jul 2, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit d4674f9
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/686568918fd0520008aebb0a

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 28.20513% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/packager/load.go 5.55% 17 Missing ⚠️
src/pkg/packager/pull.go 47.61% 11 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/packager/pull.go 48.93% <47.61%> (+0.23%) ⬆️
src/pkg/packager/load.go 53.79% <5.55%> (-3.35%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
@@ -35,7 +35,7 @@ func TestTracker_ReportingCycle(t *testing.T) {
lastTotalBytes.Store(totalBytes)
}

testInterval := 10 * time.Millisecond
testInterval := 30 * time.Millisecond
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This flaked on windows. If it happens again we may just rework this test, but I figure I'll try this to start

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that's weird, it's possible this is an unrelated timing issue that was paved over by the wait from compress and uncompress. Something to track but not a blocker imo

@AustinAbro321 AustinAbro321 marked this pull request as ready for review July 2, 2025 16:44
@AustinAbro321 AustinAbro321 requested review from a team as code owners July 2, 2025 16:44
mkcp
mkcp previously approved these changes Jul 2, 2025
Copy link
Contributor

@mkcp mkcp left a comment

Choose a reason for hiding this comment

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

One nit then good to go

@@ -35,7 +35,7 @@ func TestTracker_ReportingCycle(t *testing.T) {
lastTotalBytes.Store(totalBytes)
}

testInterval := 10 * time.Millisecond
testInterval := 30 * time.Millisecond
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that's weird, it's possible this is an unrelated timing issue that was paved over by the wait from compress and uncompress. Something to track but not a blocker imo

Filter: filters.Empty(),
PublicKeyPath: publicKeyPath,
})
pkgLayout, err := pullOCI(ctx, pullOCIOpts)
Copy link
Contributor

Choose a reason for hiding this comment

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

This just makes sense - it's always nice when the test case/usage gets simpler alongside a speedup.

Co-authored-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com>
Copy link
Contributor

@mkcp mkcp left a comment

Choose a reason for hiding this comment

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

LGTM

@AustinAbro321 AustinAbro321 enabled auto-merge July 2, 2025 17:14
@AustinAbro321 AustinAbro321 added this pull request to the merge queue Jul 2, 2025
Merged via the queue into main with commit 106c164 Jul 2, 2025
27 checks passed
@AustinAbro321 AustinAbro321 deleted the improve-pull-process branch July 2, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants