Skip to content

Conversation

@healthy-pod
Copy link

@healthy-pod healthy-pod commented Jan 28, 2026

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 Title of the PR
  • 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.
  • 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.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Closes #12978

@healthy-pod healthy-pod requested review from a team as code owners January 28, 2026 22:30
@bunnyshell
Copy link

bunnyshell bot commented Jan 28, 2026

🔴 Preview Environment stopped on Bunnyshell

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔵 /bns:start to start the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@healthy-pod healthy-pod force-pushed the 260129.add_redis_key_prefix branch 2 times, most recently from 79cca62 to b9f1b12 Compare January 28, 2026 22:57

const (
// envRedisKeyPrefix is an env variable name which stores the prefix for redis keys
envRedisKeyPrefix = "ARGOCD_REDIS_KEY_PREFIX"
Copy link
Member

Choose a reason for hiding this comment

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

we can simply keep it to ARGOCD_REDIS_KEY

Copy link
Author

Choose a reason for hiding this comment

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

TFTR! Updated, please take another look.

@healthy-pod healthy-pod force-pushed the 260129.add_redis_key_prefix branch from b9f1b12 to 7ebfba1 Compare January 29, 2026 07:13
@healthy-pod healthy-pod requested a review from nitishfy January 29, 2026 07:59
@healthy-pod healthy-pod force-pushed the 260129.add_redis_key_prefix branch 6 times, most recently from 7610b8b to f23a4cd Compare January 29, 2026 10:58
Copy link
Contributor

@ppapapetrou76 ppapapetrou76 left a comment

Choose a reason for hiding this comment

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

I'm wondering if we want to use a more sophisticated path, like redis hook
See below
https://github.com/githubzhaoqian/go-redis-prefix/blob/main/prefix.go

Also I disagree with removing the word PREFIX from the env variable
The env variable name should clearly describe what is being used for and by omitting the word PREFIX users might be confused

@healthy-pod healthy-pod force-pushed the 260129.add_redis_key_prefix branch from f23a4cd to 8ef3067 Compare January 31, 2026 17:32
@healthy-pod
Copy link
Author

@ppapapetrou76

I'm wondering if we want to use a more sophisticated path, like redis hook
See below
https://github.com/githubzhaoqian/go-redis-prefix/blob/main/prefix.go

I am open to update my code but we already have a code path (*redisCache.getKey) that gets exercised on every key-related operation so I believe this is better than pulling an external dep. If we were adding a prefix in several parts spread over the codebase I'd agree :) What do you think?

Also I disagree with removing the word PREFIX from the env variable
The env variable name should clearly describe what is being used for and by omitting the word PREFIX users might be confused

Updated back to ARGOCD_REDIS_KEY_PREFIX, I agree.

@ppapapetrou76
Copy link
Contributor

Let's give some time to others to chime in.

Copy link
Contributor

@Mangaal Mangaal left a comment

Choose a reason for hiding this comment

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

The overall changes LGTM.
I have added a small suggestion. Feel free to resolve it if it is not needed.

expiration: expiration,
cache: rediscache.New(&rediscache.Options{Redis: client}),
redisCompressionType: compressionType,
prefix: env.StringFromEnv(envRedisKeyPrefix, ""),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we check for whitespace while retrieving the prefix from env?

Copy link
Author

Choose a reason for hiding this comment

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

Technically redis keys are allowed to have whitespace [1].
[1] https://redis.io/docs/latest/develop/using-commands/keyspace/#content-of-keys

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.

[ArgoCD] Cache key enhancement

4 participants