-
Notifications
You must be signed in to change notification settings - Fork 1
feat: new build page #678
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
feat: new build page #678
Conversation
Coverage report
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run success289 tests passing in 12 suites. Report generated by 🧪jest coverage report action from 5e4703f |
| if (allRepoUrls.includes(data.spec.repositoryUrl)) throw new AlreadyExists() | ||
| if (!data.spec.private) unset(data.spec, 'secret') | ||
| if (data.spec.gitService === 'gitea') unset(data.spec, 'private') | ||
| const codeRepo = this.repoService.getTeamConfigService(teamId).createCodeRepo(data) |
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.
I think that the try block should start from here. Then you do not need a complicated catch statement and throw AlreadyExists exception.
|
|
||
| return await getPublicRepoBranches(repoUrl) | ||
| } catch (error) { | ||
| return [] |
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.
No error log?
| let sshPrivateKey = '', | ||
| username = '', | ||
| accessToken = '' | ||
|
|
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.
by defining here isPrivate you can solely rely on the variable to make decisions instead of relying on secretName and then on isPrivate
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.
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/openapi/api.yaml: Language not supported
Comments suppressed due to low confidence (1)
src/utils/codeRepoUtils.ts:84
- The normalizeSSHKey function does not appear to throw an error when given an invalid SSH key format even though tests expect an exception. Consider adding a check to throw an error (e.g., 'Invalid SSH Key format') when the key does not include the required header and footer.
export function normalizeSSHKey(sshPrivateKey) {
| let url = repoUrl | ||
|
|
||
| if (url.startsWith('git@')) { | ||
| const normalizedKey: string = sshPrivateKey ? normalizeSSHKey(sshPrivateKey) : '' |
Copilot
AI
Apr 10, 2025
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.
When the repo URL starts with 'git@', if no SSH private key is provided (resulting in an empty normalized key), the function silently bypasses SSH authentication configuration. Consider explicitly handling the case where sshPrivateKey is missing by throwing an error or providing a meaningful fallback.
| const normalizedKey: string = sshPrivateKey ? normalizeSSHKey(sshPrivateKey) : '' | |
| if (!sshPrivateKey) { | |
| throw new Error('SSH private key is required for SSH-based repository URLs (git@).') | |
| } | |
| const normalizedKey: string = normalizeSSHKey(sshPrivateKey) |
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.
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/openapi/api.yaml: Language not supported
|
|
||
| if (!repoUrl) return ['HEAD'] | ||
|
|
||
| if (isPrivate) return await getPrivateRepoBranches(repoUrl, sshPrivateKey, username, accessToken) |
Copilot
AI
Apr 11, 2025
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.
For private repositories, secret values (sshPrivateKey, username, accessToken) are not being retrieved prior to calling getPrivateRepoBranches, which may lead to authentication failures. Consider fetching these secret values (using getSecretValues) when secretName is present.
Implements
https://jira.linode.com/browse/APL-535
https://docs.google.com/document/d/1xAtM88sVC7VXAskz413Ec5AYVR7RDJoCcSZAaHYXZV0/edit?tab=t.0
https://www.figma.com/design/YuBiIolysFdtQgFEfAIJd1/APL-Master-Design?node-id=0-1&p=f&t=HFl0TjPGZV14lcGW-0
Description
This PR provides repo branches endpoint for the new build page feature and updates the related files.
Is paired with: linode/apl-console#536 and linode/apl-core#2026