-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
fix(appset): new globbing not used until cache expires #21686
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Alexandre Gaudreault <[email protected]>
❗ Preview Environment stop on Bunnyshell failedSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
if err != nil { | ||
return nil, err | ||
} | ||
cwd, err = os.Getwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cwd, err = os.Getwd() | |
// Depending on the OS, this can be different from m.root. Get the OS-specific path | |
// for cross-platform compatibility. | |
cwd, err = os.Getwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they different because os.Getwd()
is indeterministic when a folder can be reached by multiple paths via symlinks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, some minor test cases need to be adjusted in reposerver/cache/cache_test
EDIT: I just asked some questions for my own understanding
@@ -421,10 +421,16 @@ func (m *nativeGitClient) Fetch(revision string) error { | |||
func (m *nativeGitClient) LsFiles(path string, enableNewGitFileGlobbing bool) ([]string, error) { | |||
if enableNewGitFileGlobbing { | |||
// This is the new way with safer globbing | |||
err := os.Chdir(m.root) | |||
cwd := m.root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my understanding, this was just added for debugging and doesn't make any material change?
Signed-off-by: Alexandre Gaudreault <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21686 +/- ##
==========================================
+ Coverage 55.59% 55.63% +0.04%
==========================================
Files 340 339 -1
Lines 57419 56818 -601
==========================================
- Hits 31924 31613 -311
+ Misses 22807 22555 -252
+ Partials 2688 2650 -38 ☔ View full report in Codecov by Sentry. |
When using appset with
applicationsetcontroller.enable.new.git.file.globbing: "true"
, it takes up to 24h hours for the new globbing to apply. This is because the repo server contains a cache that by default expires every 24h.To prevent this, the globbing algorithm used is used along with the pattern in the cache key.
New tests were to the new globbing to clarify it's behaviour, and a problem was found were, depending on the OS,
chdir(m.root)
can set a different value thanm.root
as the working directory.For instance, during the unit test, on MacOs,
/var/tmp/....
will result in/private/var/tmp/....
when used as a current working directory.