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 #304 add scm import status and deleted fields to import items #327

Merged
merged 1 commit into from
Aug 12, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
public class ScmImportItem implements DataOutput {
public String itemId;
public Boolean tracked;
public Boolean deleted;
public ScmJobItem job;
public String status;

public Map asMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("itemId", itemId);
map.put("tracked", tracked);
map.put("deleted", deleted != null ? deleted : false);
map.put("status", status);
if(null!=job) {
map.put("job", job.toMap());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ class SCMSpec extends Specification {
type: 'String'
)],
importItems: [
new ScmImportItem(itemId: '/a/path', tracked: false, job: null),
new ScmImportItem(itemId: '/a/path', tracked: false, job: null,deleted: false, status:'CLEAN'),
new ScmImportItem(
itemId: '/b/path',
tracked: true,
deleted: false,
status:'CLEAN',
job: new ScmJobItem(
jobId: 'ajob',
jobName: 'job name',
Expand All @@ -266,8 +268,8 @@ class SCMSpec extends Specification {
1 * out.output('Items:')
1 * out.output(
[
['itemId': '/a/path', 'tracked': false],
['itemId': '/b/path', 'tracked': true,
['itemId': '/a/path', 'tracked': false, 'deleted': false, status:'CLEAN'],
['itemId': '/b/path', 'tracked': true, 'deleted': false, status:'CLEAN',
'job' : [
'jobName' : 'job name',
'jobId' : 'ajob',
Expand Down