Skip to content

Commit

Permalink
Add missing properties for GitPutParams schema
Browse files Browse the repository at this point in the history
See: #65
  • Loading branch information
kdvolder committed Jul 17, 2018
1 parent dfc8614 commit 7cee9ad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,14 @@ private void initializeDefaultResourceTypes() {
AbstractType put = f.ybean("GitPutParams");
addProp(put, "repository", t_ne_string).isPrimary(true);
addProp(put, "rebase", t_boolean);
addProp(put, "merge", t_boolean);
addProp(put, "tag", t_ne_string);
addProp(put, "only_tag", t_boolean);
addProp(put, "tag_prefix", t_string);
addProp(put, "force", t_boolean);
addProp(put, "annotate", t_ne_string);

addProp(put, "notes", t_ne_string);
put.require(Constraints.requireAtMostOneOf("rebase", "merge"));
resourceTypes.def("git", source, get, put);
}
//docker-image:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. If pushing fails with non-fast-forward, continuously attempt to merge remote to local before pushing. Only one of `merge` or `rebase` can be provided, but not both.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Optional*. If this is set then notes will be added to HEAD to the `refs/notes/commits` ref. The value should be a path to a file containing the notes.
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,10 @@ public void reconcileGroups() throws Exception {
,
"force: <*>"
,
"merge: <*>"
,
"notes: <*>"
,
"only_tag: <*>"
,
"rebase: <*>"
Expand All @@ -1351,6 +1355,12 @@ public void reconcileGroups() throws Exception {
"force: false<*>",
"force: true<*>"
);
assertContextualCompletions(context,
"merge: <*>"
, // ===>
"merge: false<*>",
"merge: true<*>"
);
}

@Test public void gitResourcePutParamsReconcile() throws Exception {
Expand Down Expand Up @@ -1386,12 +1396,17 @@ public void reconcileGroups() throws Exception {
" repository: some-other-repo\n" +
" rebase: do-rebase\n" +
" only_tag: do-tag\n" +
" force: force-it\n"
" force: force-it\n" +
" merge: merge-it\n" +
" notes: whatever"
);
editor.assertProblems(
"rebase|Only one of [rebase, merge] should be defined",
"do-rebase|'boolean'",
"do-tag|'boolean'",
"force-it|'boolean'"
"force-it|'boolean'",
"merge|Only one of [rebase, merge] should be defined",
"merge-it|'boolean'"
);
}

Expand All @@ -1411,7 +1426,9 @@ public void reconcileGroups() throws Exception {
" only_tag: do-tag\n" +
" tag_prefix: RELEASE\n" +
" force: force-it\n" +
" annotate: release-annotion\n"
" annotate: release-annotion\n" +
" merge: merge-it\n" +
" notes: /path/to/notes"
);

editor.assertHoverContains("repository", "The path of the repository");
Expand All @@ -1421,6 +1438,8 @@ public void reconcileGroups() throws Exception {
editor.assertHoverContains("tag_prefix", "prepended with this string");
editor.assertHoverContains("force", "pushed regardless of the upstream state");
editor.assertHoverContains("annotate", "path to a file containing the annotation message");
editor.assertHoverContains("merge", "continuously attempt to merge remote");
editor.assertHoverContains("notes", "path to a file containing the notes");
}

@Test public void gitResourcePut_get_params_Hovers() throws Exception {
Expand Down

0 comments on commit 7cee9ad

Please sign in to comment.