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

Git file generator caching is broken #13440

Closed
3 tasks done
Calchan opened this issue May 3, 2023 · 0 comments · Fixed by #13452
Closed
3 tasks done

Git file generator caching is broken #13440

Calchan opened this issue May 3, 2023 · 0 comments · Fixed by #13452
Labels
bug Something isn't working

Comments

@Calchan
Copy link
Contributor

Calchan commented May 3, 2023

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

Git generator caching is broken after #10952.

I have 2 AppSets with a Git file generator, each searching for a different pattern within the same repository. Whichever of these AppSets being dealt with first produces a cache entry which then gets erroneously seen as a cache hit for the other AppSet, but the cache contents don't match what's expected for this second AppSet.

Below is a simplified excerpt of the log. Unfortunately logging doesn't show which request the good and wrong cache hits are produced for.

repo-server | DEBU[0039] listed 6 git files from https://github.com/Calchan/monorepo-local.git under prod/clusters/local/*/*.yaml

repo-server | DEBU[0039] cache hit for repo: https://github.com/Calchan/monorepo-local.git revision: 53c8f9d1b3827f018dec55c636103931e03063d8

repo-server | DEBU[0039] cache hit for repo: https://github.com/Calchan/monorepo-local.git revision: 53c8f9d1b3827f018dec55c636103931e03063d8

[etc...]

Looking at the code I don't think the Git directory generator is affected by the same issue.

I have a PR coming up to fix all of this.

To Reproduce

Start a local Argo CD setup as usual, then bootstrap the simplified monorepo at https://github.com/Calchan/monorepo-local using the instructions in the README.md.

Check the output log and search for git files from and cache hit for repo to see the single cache miss (instead of 2) and the cache hits (half of them being wrong).

Expected behavior

Git generator caching is able to make the distinction between multiple different search patterns in the same repository.

Version

$ argocd version
argocd: v2.6.7+5bcd846
  BuildDate: 2023-03-23T14:57:27Z
  GitCommit: 5bcd846fa16e4b19d8f477de7da50ec0aef320e5
  GitTreeState: clean
  GoVersion: go1.18.10
  Compiler: gc
  Platform: linux/amd64
argocd-server: v99.99.99+unknown
  BuildDate: 1970-01-01T00:00:00Z
  GoVersion: go1.19.6
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v4.5.7 2022-08-02T16:35:54Z
  Helm Version: v3.11.2+g912ebc1
  Jsonnet Version: v0.19.1
Paste the output from `argocd version` here.
@Calchan Calchan added the bug Something isn't working label May 3, 2023
@Calchan Calchan changed the title Git generator caching is broken Git file generator caching is broken May 3, 2023
Calchan added a commit to Calchan/argo-cd that referenced this issue May 4, 2023
Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
alexmt pushed a commit that referenced this issue May 4, 2023
* 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 (#13440)

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

---------

Signed-off-by: Denis Dupeyron <denis.dupeyron@gmail.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this issue 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
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant