-
Notifications
You must be signed in to change notification settings - Fork 6
feat: modification on chart registry && git provider icon method #853
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
Conversation
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.
Pull Request Overview
This PR enhances the RegistryIcon component to support determining icons based on registry URLs in addition to registry types, and updates related CI/CD history components to use the new functionality with artifact URLs.
- Modified
RegistryIconProps
to makeregistryType
optional and addedregistryUrl
prop - Implemented URL-based registry icon detection logic in
RegistryIcon
component - Updated CI/CD history types and components to pass artifact URLs for icon determination
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/Shared/Components/RegistryIcon/types.ts | Made registryType optional and added registryUrl prop |
src/Shared/Components/RegistryIcon/RegistryIcon.tsx | Added URL-based icon detection logic and updated component |
src/Shared/Components/CICDHistory/types.tsx | Added artifact string property to CI list item type |
src/Shared/Components/CICDHistory/History.components.tsx | Passed artifact prop to CIListItem component |
src/Shared/Components/CICDHistory/Artifacts.tsx | Updated to use RegistryIcon with artifact URL instead of static docker icon |
src/Common/CIPipeline.Types.ts | Added url property to MaterialType interface |
@@ -18,6 +18,9 @@ | |||
|
|||
import { IconName } from '../Icon' | |||
|
|||
export const isAWSCodeCommitURL = (url: string = ''): boolean => | |||
url.includes('git-codecommit.') && url.includes('.amazonaws.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
.amazonaws.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 24 hours ago
To fix the problem, we should parse the input URL and check the host component to ensure it matches the expected AWS CodeCommit host pattern. Specifically, AWS CodeCommit URLs have hosts like git-codecommit.<region>.amazonaws.com
. We should use the standard URL
class to parse the URL and then use a regular expression or string checks to verify that the host matches the expected pattern. This change should be made in the isAWSCodeCommitURL
function in src/Shared/Components/GitProviderIcon/utils.ts
. No external dependencies are needed, as the URL
class is available in modern JavaScript/TypeScript environments.
-
Copy modified lines R21-R30
@@ -18,8 +18,16 @@ | ||
|
||
import { IconName } from '../Icon' | ||
|
||
export const isAWSCodeCommitURL = (url: string = ''): boolean => | ||
url.includes('git-codecommit.') && url.includes('.amazonaws.com') | ||
export const isAWSCodeCommitURL = (url: string = ''): boolean => { | ||
try { | ||
const { host } = new URL(url); | ||
// AWS CodeCommit hosts are like: git-codecommit.<region>.amazonaws.com | ||
// This regex matches hosts starting with git-codecommit., followed by region, ending with .amazonaws.com | ||
return /^git-codecommit\.[a-z0-9-]+\.amazonaws\.com$/i.test(host); | ||
} catch { | ||
return false; | ||
} | ||
} | ||
|
||
export const getGitIconName = (repoUrl: string): IconName => { | ||
if (repoUrl.includes(GitProviderType.GITHUB)) { |
feat: add support for freemium license
fix: do not check expiry for freemium
…s/devtron-fe-common-lib into fix/freemium-license
feat: edit devtron reviews
feat: update freemium messaging and error messaging
7f44c95
Description
Type of change
Checklist