Polygerrit: Always create new changes as WIP
The WIP checkbox was removed on master in [1] but was modified on stable-2.15 in [2] to respect the new "work in progress by default" project option. This causes conflict when stable-2.15 is merged up to master. An attempt to resolve this was done in [3] but it was deciced to instead remove the checkbox on stable-2.15, which is done in this commit. [1] https://gerrit-review.googlesource.com/c/gerrit/+/127513 [2] https://gerrit-review.googlesource.com/c/gerrit/+/183910 [3] https://gerrit-review.googlesource.com/c/gerrit/+/189026 Change-Id: I293d5f529ae880d69aa1d599ce8388f4d9e6b294
This commit is contained in:
parent
de0488a5fb
commit
0f9cd503cc
|
@ -92,13 +92,6 @@ limitations under the License.
|
|||
id="privateChangeCheckBox"
|
||||
checked$="[[_projectConfig.private_by_default.inherited_value]]">
|
||||
</section>
|
||||
<section>
|
||||
<label for="wipChangeCheckBox">WIP Change</label>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="wipChangeCheckBox"
|
||||
checked$="[[_projectConfig.work_in_progress_by_default.inherited_value]]">
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -61,9 +61,8 @@
|
|||
|
||||
handleCreateChange() {
|
||||
const isPrivate = this.$.privateChangeCheckBox.checked;
|
||||
const isWip = this.$.wipChangeCheckBox.checked;
|
||||
return this.$.restAPI.createChange(this.projectName, this.branch,
|
||||
this.subject, this.topic, isPrivate, isWip)
|
||||
this.subject, this.topic, isPrivate, true)
|
||||
.then(changeCreated => {
|
||||
if (!changeCreated) {
|
||||
return;
|
||||
|
|
|
@ -101,41 +101,6 @@ limitations under the License.
|
|||
});
|
||||
});
|
||||
|
||||
test('new change created with wip by default', () => {
|
||||
element._projectConfig = {
|
||||
work_in_progress_by_default: {
|
||||
inherited_value: true,
|
||||
},
|
||||
};
|
||||
|
||||
const configInputObj = {
|
||||
branch: 'test-branch',
|
||||
topic: 'test-topic',
|
||||
subject: 'first change created with polygerrit ui',
|
||||
project: element.projectName,
|
||||
work_in_progress: true,
|
||||
};
|
||||
|
||||
const saveStub = sandbox.stub(element.$.restAPI,
|
||||
'createChange', () => {
|
||||
return Promise.resolve({});
|
||||
});
|
||||
|
||||
element.project = element.projectName;
|
||||
element.branch = 'test-branch';
|
||||
element.topic = 'test-topic';
|
||||
element.subject = 'first change created with polygerrit ui';
|
||||
assert.isTrue(element.$.wipChangeCheckBox.checked);
|
||||
|
||||
element.$.branchInput.bindValue = configInputObj.branch;
|
||||
element.$.tagNameInput.bindValue = configInputObj.topic;
|
||||
element.$.messageInput.bindValue = configInputObj.subject;
|
||||
|
||||
element.handleCreateChange().then(() => {
|
||||
assert.isTrue(saveStub.lastCall.calledWithExactly(configInputObj));
|
||||
});
|
||||
});
|
||||
|
||||
test('new change created with wip', () => {
|
||||
const configInputObj = {
|
||||
branch: 'test-branch',
|
||||
|
@ -153,7 +118,6 @@ limitations under the License.
|
|||
element.branch = 'test-branch';
|
||||
element.topic = 'test-topic';
|
||||
element.subject = 'first change created with polygerrit ui';
|
||||
element.$.wipChangeCheckBox.checked = true;
|
||||
assert.isFalse(element.$.privateChangeCheckBox.checked);
|
||||
|
||||
element.$.branchInput.bindValue = configInputObj.branch;
|
||||
|
|
Loading…
Reference in New Issue