Skip to content
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: broken Git file generator caching (fixes #13440) #13452

Merged
merged 2 commits into from
May 4, 2023

Conversation

Calchan
Copy link
Contributor

@Calchan Calchan commented May 4, 2023

The Git file generator currently assumes that only a single Git file generator will ever exist for any repository. If multiple generators exist the cache will always return the results of the first file search that randomly happened to all subsequent searches.

This PR adds the search pattern to the Git file generator cache key in order to individualize cache entries for the Git file generator.

Note that reposerver/cache/types.go is deleted since it is no longer needed.

Fixes #13440

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Patch coverage: 17.64% and project coverage change: -0.01 ⚠️

Comparison is base (f0911f2) 49.15% compared to head (1521782) 49.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #13452      +/-   ##
==========================================
- Coverage   49.15%   49.15%   -0.01%     
==========================================
  Files         248      248              
  Lines       42891    42893       +2     
==========================================
  Hits        21082    21082              
- Misses      19691    19693       +2     
  Partials     2118     2118              
Impacted Files Coverage Δ
reposerver/cache/cache.go 55.09% <0.00%> (-0.52%) ⬇️
reposerver/repository/repository.go 60.29% <42.85%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Calchan Calchan changed the title Fix git generator caching fix: broken Git file generator caching May 4, 2023
@Calchan Calchan changed the title fix: broken Git file generator caching fix: broken Git file generator caching (fixes #13440) May 4, 2023
@Calchan Calchan force-pushed the fix_git_generator_caching branch from 1ecf858 to a11c620 Compare May 4, 2023 17:09
@alexmt alexmt requested a review from gdsoumya May 4, 2023 17:27
@alexmt
Copy link
Collaborator

alexmt commented May 4, 2023

@gdsoumya can you please take a look?

Copy link
Member

@gdsoumya gdsoumya left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks for the fix!

@alexmt alexmt enabled auto-merge (squash) May 4, 2023 17:33
auto-merge was automatically disabled May 4, 2023 17:36

Head branch was pushed to by a user without write access

@Calchan Calchan force-pushed the fix_git_generator_caching branch from a11c620 to 9aba418 Compare May 4, 2023 17:36
@crenshaw-dev crenshaw-dev enabled auto-merge (squash) May 4, 2023 18:09
Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
auto-merge was automatically disabled May 4, 2023 18:21

Head branch was pushed to by a user without write access

@Calchan Calchan force-pushed the fix_git_generator_caching branch from 9aba418 to 94562a0 Compare May 4, 2023 18:21
@alexmt alexmt enabled auto-merge (squash) May 4, 2023 18:28
Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
auto-merge was automatically disabled May 4, 2023 18:45

Head branch was pushed to by a user without write access

@Calchan Calchan force-pushed the fix_git_generator_caching branch from 94562a0 to 1521782 Compare May 4, 2023 18:45
@alexmt alexmt enabled auto-merge (squash) May 4, 2023 19:10
@alexmt alexmt merged commit 8c5af34 into argoproj:master May 4, 2023
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
…oj#13452)

* chore: add .*.swp to .gitignore for Vim users

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>

* fix: add search pattern to Git file generator cache key (argoproj#13440)

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>

---------

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
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.

Git file generator caching is broken
3 participants