Repository navigation
fix: match token secrets that keep the provider name in the token name - #1090
Conversation
isSecretMatchesSearchCriteria read the OAuth provider name from the che.eclipse.org/scm-provider-name annotation only. Secrets stored before that annotation was introduced keep the provider name in che.eclipse.org/scm-personal-access-token-name, so a lookup by provider name stopped matching them. Fall back to the token name when the provider name annotation is absent or empty, the same way getScmProviderName already does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Docker image build succeeded: quay.io/eclipse/che-server:pr-1090 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/cheServer/deployment", "value": {containers: [{image: "quay.io/eclipse/che-server:pr-1090", name: che}]}}]" |
|
/retest |
| String configuredOAuthProviderName = | ||
| isNullOrEmpty(secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME)) | ||
| ? secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME) | ||
| : secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME); |
There was a problem hiding this comment.
@vinokurig can we make it more readable smth. like:
String providerName = secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME);
String configuredOAuthProviderName = isNullOrEmpty(providerName)
? secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME)
: providerName;
| String providerName = secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME); | ||
| String configuredOAuthProviderName = | ||
| isNullOrEmpty(providerName) | ||
| ? secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME) |
There was a problem hiding this comment.
@vinokurig can we make it more readable smth. like:
String providerName = secretAnnotations.get(ANNOTATION_SCM_PROVIDER_NAME);
String configuredOAuthProviderName = isNullOrEmpty(providerName)
? secretAnnotations.get(ANNOTATION_SCM_PERSONAL_ACCESS_TOKEN_NAME)
: providerName;
|
Docker image build succeeded: quay.io/eclipse/che-server:pr-1090 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/cheServer/deployment", "value": {containers: [{image: "quay.io/eclipse/che-server:pr-1090", name: che}]}}]" |
|
Verified on Eclipse Che deployed on OCP v4.22 with The functionality works properly. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: artaleks9, ibuziuk, vinokurig The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
#1090) (#1091) * fix: match token secrets that keep the provider name in the token name isSecretMatchesSearchCriteria read the OAuth provider name from the che.eclipse.org/scm-provider-name annotation only. Secrets stored before that annotation was introduced keep the provider name in che.eclipse.org/scm-personal-access-token-name, so a lookup by provider name stopped matching them. Fall back to the token name when the provider name annotation is absent or empty, the same way getScmProviderName already does. * fixup! fix: match token secrets that keep the provider name in the token name --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
What does this PR do?
isSecretMatchesSearchCriteriaread the OAuth provider name from theche.eclipse.org/scm-provider-nameannotation only. Secrets stored before that annotation was introduced keep the provider name inche.eclipse.org/scm-personal-access-token-name, so a lookup by provider name stopped matching them. Fall back to the token name when the provider name annotation is absent or empty, the same waygetScmProviderNamealready does.Screenshot/screencast of this PR
What issues does this PR fix or reference?
https://redhat.atlassian.net/browse/CRW-13991
How to test this PR?
quay.io/eclipse/che-server:pr-1090Git Configtab in theUser Preferencesis empty, clear it if it is not.Git Configtab in theUser Preferencesand see that the data is fetched.PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or referenceandHow to test this PRcompletedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.
Summary by CodeRabbit
Summary