-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve NuGet cache log output #151
Merged
Merged
Conversation
This file contains 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
runesoerensen
changed the title
Improve nuget log output
Improve NuGet cache log output
Nov 10, 2024
NugetCacheLayerMetadata#restore_count is intended to track the number of times the layer has been restored, so it makes more sense to set this value to 0 when the layer has just been created. This should improve readability by reducing the ambiguity between "number of NuGet package restores" (which are part of every build/publish), and "cache layer restores". Updated the log message wording accordingly.
This is more consistent with the output when the cache is reused, and the logging style used in the SDK layer (and elsewhere)
No need to include "NuGet" in "NuGet cache" sub-bullets
The NuGet CLI uses the term "clear" for related cache maintenance operations, so prefer "clearing" over "purging" in our output https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders#clearing-local-folders
runesoerensen
force-pushed
the
improve-nuget-log-output
branch
from
November 11, 2024 04:14
03dc8ac
to
37505f4
Compare
edmorley
approved these changes
Nov 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR changes the log output so nothing is written when the NuGet cache layer is created for the first time. Printing that the cache has been created provides no substantial value (as it really just reflects the fact that a folder has been created at this stage).
Removing the "NuGet cache" output avoids cluttering the output when the buildpack is first executed (while retaining all relevant messages when the cache is restored/reused/purged etc), and when running pack with the
--clear-cache
flag (and/or when the buildpack is used in an environment that doesn't store/restore the layer cache).The PR also includes minor changes to terminology, as well as the way the cache restore limit is evaluated, to improve log output and code readability respectively (explained further in the relevant commits).