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

Fix diff refs api to return prefix_changed #4639

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ components:
properties:
type:
type: string
enum: [ added, removed, changed, conflict ]
enum: [ added, removed, changed, conflict, prefix_changed ]
path:
type: string
path_type:
Expand Down
1 change: 1 addition & 0 deletions clients/java/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/Diff.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/lakefs_client/model/diff.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 41 additions & 2 deletions docs/assets/js/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ components:
properties:
type:
type: string
enum: [ added, removed, changed, conflict ]
enum: [ added, removed, changed, conflict, prefix_changed ]
path:
type: string
path_type:
Expand Down Expand Up @@ -863,7 +863,6 @@ components:
format: date-time
event_type:
type: string
enum: [ pre_commit, pre_merge ]
status:
type: string
enum: [ failed, completed ]
Expand Down Expand Up @@ -2670,6 +2669,15 @@ paths:
- objects
operationId: getObject
summary: get object content
parameters:
- in: header
name: Range
description: Byte range to retrieve
example: "bytes=0-1023"
required: false
schema:
type: string
pattern: '^bytes=((\d*-\d*,? ?)+)$'
responses:
200:
description: object content
Expand All @@ -2692,6 +2700,31 @@ paths:
Content-Disposition:
schema:
type: string
206:
description: partial object content
content:
application/octet-stream:
schema:
type: string
format: binary
headers:
Content-Length:
schema:
type: integer
format: int64
Content-Range:
schema:
type: string
pattern: '^bytes=((\d*-\d*,? ?)+)$'
Last-Modified:
schema:
type: string
ETag:
schema:
type: string
Content-Disposition:
schema:
type: string
401:
$ref: "#/components/responses/Unauthorized"
404:
Expand All @@ -2704,6 +2737,12 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Error"
416:
description: Requested Range Not Satisfiable
content:
application/json:
schema:
$ref: "#/components/schemas/Error"

/repositories/{repository}/branches/{branch}/staging/backing:
parameters:
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ func TestController_DiffRefs(t *testing.T) {
if results[0].Path != prefix {
t.Fatalf("wrong result: %s", results[0].Path)
}
if results[0].Type != "changes under prefix" {
if results[0].Type != "prefix_changed" {
t.Fatalf("wrong diff type: %s", results[0].Type)
}
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func transformDifferenceTypeToString(d catalog.DifferenceType) string {
case catalog.DifferenceTypeConflict:
return "conflict"
case catalog.DifferenceTypePrefixChanged:
return "changes under prefix"
return "prefix_changed"
default:
return ""
}
Expand Down
3 changes: 1 addition & 2 deletions webui/src/lib/components/repository/changes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ function extractPathText(entry, relativeTo) {
function diffType(entry) {
switch (entry.type) {
case 'changed':
return 'diff-changed';
case 'changes under prefix':
case 'prefix_changed':
return 'diff-changed';
case 'added':
return 'diff-added';
Expand Down