-
Notifications
You must be signed in to change notification settings - Fork 13
Revert "Change TPA authentication integration name" #320
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,10 +30,10 @@ export class Authentication implements IntegrationSecret { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| * @returns Promise with the secret data | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| private async loadSecret(): Promise<Record<string, string>> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const secret = await this.kubeClient.getSecret('tssc-trustificationauth-integration', 'tssc'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const secret = await this.kubeClient.getSecret('tssc-authentication-integration', 'tssc'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!secret) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error( | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'Authentication integration secret tssc-trustificationauth-integration not found in the cluster. Please ensure the secret exists.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 'Authentication integration secret tssc-authentication-integration not found in the cluster. Please ensure the secret exists.' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+33
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the authentication file
find . -name "authentication.ts" -type f | head -20Repository: redhat-appstudio/tssc-test Length of output: 131 🏁 Script executed: # Check if the file exists and view the relevant lines
if [ -f "src/rhtap/core/integration/authentication/authentication.ts" ]; then
echo "=== File found. Showing lines 25-45 for context ==="
sed -n '25,45p' src/rhtap/core/integration/authentication/authentication.ts
else
echo "File not found at specified path"
git ls-files | grep -i authentication | head -20
fiRepository: redhat-appstudio/tssc-test Length of output: 858 🏁 Script executed: # Search for secret name references across the repository
echo "=== Searching for tssc-authentication-integration references ==="
rg -n "tssc-authentication-integration" --max-count=50
echo ""
echo "=== Searching for tssc-trustificationauth-integration references ==="
rg -n "tssc-trustificationauth-integration" --max-count=50Repository: redhat-appstudio/tssc-test Length of output: 560 🏁 Script executed: # Look for manifest files that might define this secret
echo "=== Searching for secret definitions in manifests ==="
find . -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) ! -path "*/node_modules/*" ! -path "*/.git/*" | head -50 | xargs grep -l "tssc-authentication-integration\|authentication-integration" 2>/dev/null | head -20Repository: redhat-appstudio/tssc-test Length of output: 123 🏁 Script executed: # Check the tpa.ts file mentioned in the review for comparison
echo "=== Checking similar pattern in tpa.ts ==="
if [ -f "src/rhtap/core/integration/tpa/tpa.ts" ]; then
sed -n '30,50p' src/rhtap/core/integration/tpa/tpa.ts
fiRepository: redhat-appstudio/tssc-test Length of output: 809 🏁 Script executed: # Check for test files that might reference the authentication secret
echo "=== Searching for test files referencing authentication secret ==="
find . -type f \( -name "*.test.ts" -o -name "*.spec.ts" -o -name "*test*.ts" \) ! -path "*/node_modules/*" | xargs grep -l "tssc-authentication-integration\|Authentication" 2>/dev/null | head -20Repository: redhat-appstudio/tssc-test Length of output: 199 🏁 Script executed: # Verify the refactor suggestion is syntactically aligned with the file's class structure
echo "=== Checking Authentication class structure ==="
sed -n '1,30p' src/rhtap/core/integration/authentication/authentication.tsRepository: redhat-appstudio/tssc-test Length of output: 1155 🏁 Script executed: # Check what the test files actually contain regarding authentication secrets
echo "=== Content of component.test.ts ==="
grep -n -C3 "tssc-authentication-integration\|Authentication.*secret\|getSecret" ./tests/ui/component.test.ts | head -30
echo ""
echo "=== Content of gitopsResource.test.ts ==="
grep -n -C3 "tssc-authentication-integration\|Authentication.*secret\|getSecret" ./tests/ui/gitopsResource.test.ts | head -30Repository: redhat-appstudio/tssc-test Length of output: 149 🏁 Script executed: # Also verify this is the correct pattern to follow by checking if there are any constants already defined elsewhere
echo "=== Checking if constants are defined elsewhere in integration classes ==="
rg -n "private static readonly.*=.*'" src/rhtap/core/integration/ | head -20Repository: redhat-appstudio/tssc-test Length of output: 298 Hoist the authentication secret identity into static constants to eliminate configuration drift risk. The secret name Suggested refactorexport class Authentication implements IntegrationSecret {
private static instance: Authentication | null = null;
+ private static readonly SECRET_NAME = 'tssc-authentication-integration';
+ private static readonly SECRET_NAMESPACE = 'tssc';
private readonly logger: Logger;
private kubeClient: KubeClient;
private secret: Record<string, string> = {};
private async loadSecret(): Promise<Record<string, string>> {
- const secret = await this.kubeClient.getSecret('tssc-authentication-integration', 'tssc');
+ const secret = await this.kubeClient.getSecret(
+ Authentication.SECRET_NAME,
+ Authentication.SECRET_NAMESPACE
+ );
if (!secret) {
throw new Error(
- 'Authentication integration secret tssc-authentication-integration not found in the cluster. Please ensure the secret exists.'
+ `Authentication integration secret ${Authentication.SECRET_NAME} not found in the cluster. Please ensure the secret exists.`
);
}
return secret;
}The same pattern exists in 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| return secret; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
1. Secret rename breaks deployments
🐞 Bug⛯ ReliabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools