Skip to content

Commit f132a34

Browse files
richardltyesnault
andauthored
fix(vcs): get bitbucket branch ordered by modification date (#7406)
* fix(vcs): get bitbucket branch ordered by modification date Signed-off-by: richard.le-terrier <[email protected]> * fix: it tests Signed-off-by: richard.le-terrier <[email protected]> * fix: it tests Signed-off-by: Yvonnick Esnault <[email protected]> * fix: it tests Signed-off-by: Yvonnick Esnault <[email protected]> --------- Signed-off-by: richard.le-terrier <[email protected]> Signed-off-by: Yvonnick Esnault <[email protected]> Co-authored-by: Yvonnick Esnault <[email protected]>
1 parent 863a559 commit f132a34

5 files changed

+14
-14
lines changed

engine/vcs/bitbucketserver/client_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (b *bitbucketClient) Branch(ctx context.Context, fullname string, filters s
8585
}
8686

8787
branches := BranchResponse{}
88-
path := fmt.Sprintf("/projects/%s/repos/%s/branches?filterText=%s", t[0], t[1], url.QueryEscape(filters.BranchName))
88+
path := fmt.Sprintf("/projects/%s/repos/%s/branches?orderBy=MODIFICATION&filterText=%s", t[0], t[1], url.QueryEscape(filters.BranchName))
8989

9090
if err := b.do(ctx, "GET", "core", path, nil, nil, &branches, Options{DisableCache: filters.NoCache}); err != nil {
9191
return nil, sdk.WrapError(err, "Unable to get branch %s %s", filters.BranchName, path)

tests/03_clictl_admin_organization.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ testcases:
77
steps:
88
- script: {{.cdsctl}} -f {{.cdsctl.config}} admin organization list --format json
99
assertions:
10-
- result.systemoutjson.__len__ ShouldEqual 2
10+
- result.systemoutjson ShouldHaveLength 2
1111
- name: Remove an organization
1212
steps:
1313
- script: {{.cdsctl}} -f {{.cdsctl.config}} admin organization delete my-org --force

tests/03_clictl_template_apply_detached.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ testcases:
4545
path: ./fixtures/template/simple/export-detached/*.yml
4646
assertions:
4747
- result.err ShouldEqual ""
48-
- result.md5sum.fixtures_template_simple_export-detached_first-environment.env.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_first-environment}}"
49-
- result.md5sum.fixtures_template_simple_export-detached_first-pipeline.pip.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_first-pipeline}}"
50-
- result.md5sum.fixtures_template_simple_export-detached_second-pipeline.pip.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_second-pipeline}}"
51-
- result.md5sum.fixtures_template_simple_export-detached_itcliwkf.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_itcliwkf}}"
48+
- result.md5sum.fixtures_template_simple_export-detached_First-environment.env.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_first-environment}}"
49+
- result.md5sum.fixtures_template_simple_export-detached_First-pipeline.pip.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_first-pipeline}}"
50+
- result.md5sum.fixtures_template_simple_export-detached_Second-pipeline.pip.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_second-pipeline}}"
51+
- result.md5sum.fixtures_template_simple_export-detached_ITCLIWKF.yml ShouldEqual "{{.readWorkflowSourceFiles.md5sum_fixtures_template_simple_workflow-detached_itcliwkf}}"

tests/04_sc_workflow_edit_scheduler.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ testcases:
2222
- result.code ShouldEqual 0
2323
- script: "{{.cdsctl}} -f {{.cdsctl.config}} workflow export ITSCWRKFLW16 ITSCWRKFLW16-WORKFLOW --format json"
2424
assertions:
25-
- result.systemoutjson.hooks.itscwrkflw16-pipeline.itscwrkflw16-pipeline0.config.cron ShouldEqual '10 * * * *'
25+
- result.systemoutjson.hooks.ITSCWRKFLW16-PIPELINE.ITSCWRKFLW16-PIPELINE0.config.cron ShouldEqual '10 * * * *'
2626

2727
- name: get-imported-workflow
2828
steps:
@@ -38,7 +38,7 @@ testcases:
3838
steps:
3939
- script: "{{.cdsctl}} -f {{.cdsctl.config}} admin hooks list --filter workflow_id={{.get-imported-workflow.workflow_id}} --format json"
4040
assertions:
41-
- result.systemoutjson.systemoutjson0.cron ShouldEqual '10 * * * *'
41+
- result.systemoutjson.systemoutjson0.Cron ShouldEqual '10 * * * *'
4242

4343
- name: update workflow
4444
steps:
@@ -47,7 +47,7 @@ testcases:
4747
- result.code ShouldEqual 0
4848
- script: "{{.cdsctl}} -f {{.cdsctl.config}} workflow export ITSCWRKFLW16 ITSCWRKFLW16-WORKFLOW --format json"
4949
assertions:
50-
- result.systemoutjson.hooks.itscwrkflw16-pipeline.itscwrkflw16-pipeline0.config.cron ShouldEqual '20 * * * *'
50+
- result.systemoutjson.hooks.ITSCWRKFLW16-PIPELINE.ITSCWRKFLW16-PIPELINE0.config.cron ShouldEqual '20 * * * *'
5151

5252
- name: get-updated-workflow
5353
steps:
@@ -63,4 +63,4 @@ testcases:
6363
steps:
6464
- script: "{{.cdsctl}} -f {{.cdsctl.config}} admin hooks list --filter workflow_id={{.get-updated-workflow.workflow_id}} --format json"
6565
assertions:
66-
- result.systemoutjson.systemoutjson0.cron ShouldEqual '20 * * * *'
66+
- result.systemoutjson.systemoutjson0.Cron ShouldEqual '20 * * * *'

tests/04_sc_workflow_run_notif.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ testcases:
5656
url: '{{.smtpmock.url}}/messages/[email protected]'
5757
assertions:
5858
- result.statuscode ShouldEqual 200
59-
- result.bodyjson.__len__ ShouldEqual 1
59+
- result.bodyjson ShouldHaveLength 1
6060
retry: 10
6161
delay: 3
6262
- type: http
@@ -75,15 +75,15 @@ testcases:
7575
url: '{{.smtpmock.url}}/messages/[email protected]'
7676
assertions:
7777
- result.statuscode ShouldEqual 200
78-
- result.bodyjson.__len__ ShouldEqual 1
78+
- result.bodyjson ShouldHaveLength 1
7979
retry: 10
8080
delay: 3
8181
- type: http
8282
method: GET
8383
url: '{{.smtpmock.url}}/messages/[email protected]'
8484
assertions:
8585
- result.statuscode ShouldEqual 200
86-
- result.bodyjson.__len__ ShouldEqual 1
86+
- result.bodyjson ShouldHaveLength 1
8787
retry: 10
8888
delay: 3
8989

@@ -113,6 +113,6 @@ testcases:
113113
url: '{{.smtpmock.url}}/messages/[email protected]'
114114
assertions:
115115
- result.statuscode ShouldEqual 200
116-
- result.bodyjson.__len__ ShouldEqual 1
116+
- result.bodyjson ShouldHaveLength 1
117117
retry: 30
118118
delay: 1

0 commit comments

Comments
 (0)