Skip to content
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(web): specify pipeline target branch #1023

Merged
merged 39 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
beabb81
refactor: container configurations
m8vago Nov 6, 2024
839cc1f
fix: secret handling
m8vago Nov 25, 2024
76bc1de
fix: build
m8vago Nov 25, 2024
2a6dc53
refactor: remove unused ws messages
m8vago Nov 26, 2024
be6c022
fix: migration
m8vago Nov 27, 2024
b0c93cb
feat(web): api & ui
robot9706 Nov 27, 2024
95e13d6
fix: migration
m8vago Nov 27, 2024
54e16d0
fix: trying to fix config-bundle related tests
m8vago Nov 28, 2024
a6fe6d5
Merge branch 'develop' into feat/deployments-paginated
robot9706 Nov 28, 2024
4badf49
fix: lint
robot9706 Nov 28, 2024
63a2cb9
Merge branch 'feat/deployments-paginated' into refactor/configurations
robot9706 Nov 28, 2024
20ff448
fix: merge
robot9706 Nov 28, 2024
8a28439
feat: deploy list by configbundle
robot9706 Nov 28, 2024
66bfe63
feat: config bundle deployment list
robot9706 Nov 28, 2024
2a20744
feat: use pagination
robot9706 Nov 29, 2024
322ba35
Merge branch 'develop' into refactor/configurations
robot9706 Nov 29, 2024
9c6f837
fix: lint
robot9706 Nov 29, 2024
c2b38c9
fix: update test
robot9706 Nov 29, 2024
4bf2c8f
fix: go lint
robot9706 Dec 2, 2024
c5f654f
fix: deploy bug & separate config schema
robot9706 Dec 2, 2024
a2482b8
Revert "fix: deploy bug & separate config schema"
m8vago Dec 3, 2024
a780d10
fix: deployment null secrets
m8vago Dec 3, 2024
e214b33
feat(web): specify pipeline target branch
robot9706 Dec 3, 2024
677d17b
fix: lint
robot9706 Dec 3, 2024
a942ad0
fix: config bundle e2e
m8vago Dec 3, 2024
0b37410
fix: golang unit tests
m8vago Dec 3, 2024
04f27d3
fix(web): branch default value
robot9706 Dec 3, 2024
885cbd1
fix: setting prefix and container name
m8vago Dec 3, 2024
293a2e2
Merge branch 'develop' into refactor/configurations
m8vago Dec 3, 2024
353b164
fix: duplicated images
m8vago Dec 3, 2024
038495d
fix: container name defaults
m8vago Dec 3, 2024
8b21704
fix: storage saving
m8vago Dec 4, 2024
f42e87f
build: disable e2e
m8vago Dec 4, 2024
44d73ca
fix: remove e2e need
m8vago Dec 4, 2024
e6b8580
fix: lint
m8vago Dec 4, 2024
37755f0
Merge branch 'refactor/configurations' into feat/release-candidate
m8vago Dec 4, 2024
3d3afac
fix: go_push needs
m8vago Dec 4, 2024
e0bba87
Merge branch 'feat/release-candidate' into feat/pipeline-target-branch
robot9706 Dec 4, 2024
b687a0b
Merge branch 'develop' into feat/pipeline-target-branch
m8vago Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/crux-ui/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"version": "Version",
"pipeline": "Pipeline",
"token": "Token",
"branch": "Branch",

"changeToken": "Change token",

Expand Down
13 changes: 13 additions & 0 deletions web/crux-ui/src/components/pipelines/edit-pipeline-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const DEFAULT_EDITABLE_PIPELINE: EditablePipeline = {
repository: {
organization: '',
project: '',
branch: '',
},
trigger: {
name: '',
Expand Down Expand Up @@ -202,6 +203,18 @@ const EditPipelineCard = (props: EditPipelineCardProps) => {
message={formik.errors.repository?.project}
/>

<DyoInput
className="max-w-lg"
grow
name="repository.branch"
type="text"
label={t('common:branch')}
labelClassName="mr-2 mb-1 text-light-eased"
onChange={formik.handleChange}
value={formik.values.repository.branch}
message={formik.errors.repository?.branch}
/>

{editing && (
<DyoToggle label={t('common:changeToken')} checked={changeToken} onCheckedChange={setChangeToken} />
)}
Expand Down
1 change: 1 addition & 0 deletions web/crux-ui/src/models/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type PipelineRunStatus = 'unknown' | 'queued' | 'running' | 'successful'
export type AzureRepository = {
organization: string
project: string
branch?: string
}

export type PipelineRepository = AzureRepository
Expand Down
1 change: 1 addition & 0 deletions web/crux-ui/src/validations/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const updatePipelineSchema = yup.object().shape({
yup.object().shape({
organization: yup.string().required().label('organization'),
project: yup.string().required().label('common:project'),
branch: yup.string().optional().nullable().label('common:branch'),
}),
}),
trigger: yup.object().shape({
Expand Down
4 changes: 4 additions & 0 deletions web/crux/src/app/pipeline/pipeline.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export class AzureDevOpsRepositoryDto {

@IsString()
project: string

@IsString()
@IsOptional()
branch?: string
}

export class PipelineTriggerDto {
Expand Down
2 changes: 2 additions & 0 deletions web/crux/src/app/pipeline/pipeline.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class PipelineMapper {
repository: {
organization: repo.organization,
project: repo.project,
branch: repo.branch,
},
audit: this.auditMapper.toDto(pipeline),
trigger: pipeline.trigger as AzureTrigger,
Expand Down Expand Up @@ -185,6 +186,7 @@ export default class PipelineMapper {
organization: it.organization,
project: it.project,
projectId,
branch: it.branch && it.branch.length > 0 ? it.branch : null,
}
}

Expand Down
10 changes: 10 additions & 0 deletions web/crux/src/domain/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type AzureRepository = {
organization: string
project: string
projectId: string
branch?: string
}

export type AzureTrigger = {
Expand Down Expand Up @@ -58,8 +59,17 @@ export type AzureDevOpsVariable = {
value: string
}

export type AzureDevOpsRespositoryParameters = {
refName: string
}

export type AzureDevOpsResources = {
repositories?: Record<string, AzureDevOpsRespositoryParameters>
}

export type AzureDevOpsPipelineTrigger = {
variables: Record<string, AzureDevOpsVariable>
resources?: AzureDevOpsResources
}

export type AzureDevOpsPipelineTriggerError = {
Expand Down
12 changes: 12 additions & 0 deletions web/crux/src/services/azure-devops.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
AzureDevOpsPipelineTrigger,
AzureDevOpsPipelineTriggerError,
AzureDevOpsProject,
AzureDevOpsResources,
AzureDevOpsRun,
AzureDevOpsVariable,
PipelineHookOptions,
Expand Down Expand Up @@ -113,8 +114,19 @@ export default class AzureDevOpsService {
return result
}, {})

const resources: AzureDevOpsResources = creds.repo.branch
? {
repositories: {
self: {
refName: `refs/heads/${creds.repo.branch}`,
},
},
}
: null

const body: AzureDevOpsPipelineTrigger = {
variables,
resources,
}

const res = await this.post(creds, `/pipelines/${pipeline.id}/runs`, body)
Expand Down
Loading