Merge branch 'stable-3.1'
* stable-3.1: Fix formatting issues flagged by eslint Bump Bazel version to 2.0.0 Set version in package.json to 3.0.7-SNAPSHOT Set version in package.json to 2.16.16-SNAPSHOT Use gerritCheck API for posting checker result Update git submodules Downport "Replace deprecated `require-jsdoc`, `valid-jsdoc` with jsdoc plugin for eslint" Downport "Add a shared pre-commit to run eslintfix for frontend code changes" Downport "Remove `|| exit 0` as eslint already supported correct exit code" Downport "Update eslint version and eslint rules" Downport "Simplify installing / running polylint" Downport "Make `npm start` run run-server.sh" Downport "Simplify installing / running template tests" Downport "Simplify installing and running eslint" Downport "Simplify running frontend tests via package.json" Change-Id: I77ea844ecfb46937c0d93058e9c1370bc0a558ac
This commit is contained in:
@@ -1 +1 @@
|
||||
1.2.0
|
||||
2.0.0
|
||||
|
||||
26
Jenkinsfile
vendored
26
Jenkinsfile
vendored
@@ -53,15 +53,11 @@ class Builds {
|
||||
|
||||
class GerritCheck {
|
||||
String uuid
|
||||
String changeNum
|
||||
String sha1
|
||||
Build build
|
||||
|
||||
GerritCheck(name, changeNum, sha1, build) {
|
||||
GerritCheck(name, build) {
|
||||
this.uuid = "gerritforge:" + name.replaceAll("(bazel/)", "") +
|
||||
Globals.gerritRepositoryNameSha1Suffix
|
||||
this.changeNum = changeNum
|
||||
this.sha1 = sha1
|
||||
this.build = build
|
||||
}
|
||||
|
||||
@@ -93,21 +89,7 @@ def hasChangeNumber() {
|
||||
}
|
||||
|
||||
def postCheck(check) {
|
||||
def gerritPostUrl = Globals.gerritUrl +
|
||||
"a/changes/${check.changeNum}/revisions/${check.sha1}/checks"
|
||||
|
||||
try {
|
||||
def json = check.createCheckPayload()
|
||||
httpRequest(httpMode: 'POST', authentication: Globals.gerritCredentialsId,
|
||||
contentType: 'APPLICATION_JSON', requestBody: json,
|
||||
validResponseCodes: '200', url: gerritPostUrl)
|
||||
echo "----------------------------------------------------------------------------"
|
||||
echo "Gerrit Check: ${check.uuid}=" + check.build.result + " to change " +
|
||||
check.changeNum + "/" + check.sha1
|
||||
echo "----------------------------------------------------------------------------"
|
||||
} catch(Exception e) {
|
||||
echo "ERROR> Failed to post check results to Gerrit: ${e}"
|
||||
}
|
||||
gerritCheck(checks: [ "${check.uuid}" : "${check.getCheckResultFromBuild()}" ])
|
||||
}
|
||||
|
||||
def queryChangedFiles(url, changeNum, sha1) {
|
||||
@@ -313,7 +295,7 @@ node ('master') {
|
||||
gerritReview(
|
||||
labels: ['Code-Style': resCodeStyle],
|
||||
message: createCodeStyleMsgBody(Builds.codeStyle, resCodeStyle))
|
||||
postCheck(new GerritCheck("codestyle", Change.number, Change.sha1, Builds.codeStyle))
|
||||
postCheck(new GerritCheck("codestyle", Builds.codeStyle))
|
||||
|
||||
def verificationResults = Builds.verification.collect { k, v -> v }
|
||||
def resVerify = verificationResults.inject(1) {
|
||||
@@ -324,7 +306,7 @@ node ('master') {
|
||||
message: createVerifyMsgBody(Builds.verification))
|
||||
|
||||
Builds.verification.each { type, build -> postCheck(
|
||||
new GerritCheck(type, Change.number, Change.sha1, build)
|
||||
new GerritCheck(type, build)
|
||||
)}
|
||||
|
||||
setResult(resVerify, resCodeStyle)
|
||||
|
||||
@@ -51,7 +51,13 @@ simply execute:
|
||||
npm run start
|
||||
```
|
||||
|
||||
Then visit <http://localhost:8081>.
|
||||
Then visit http://localhost:8081
|
||||
|
||||
## Local UI, Test Data
|
||||
|
||||
```sh
|
||||
./polygerrit-ui/run-server.sh --plugins=plugins/my_plugin/static/my_plugin.js,plugins/my_plugin/static/my_plugin.html
|
||||
```
|
||||
|
||||
This method is based on a
|
||||
[simple hand-written Go webserver](https://gerrit.googlesource.com/gerrit/+/master/polygerrit-ui/server.go).
|
||||
|
||||
@@ -205,10 +205,9 @@ limitations under the License.
|
||||
id: 'administrateServer',
|
||||
value: {},
|
||||
};
|
||||
assert.equal(
|
||||
element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
element.capabilities[permission.id].name);
|
||||
assert.equal(element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
element.capabilities[permission.id].name);
|
||||
|
||||
name = 'refs/for/*';
|
||||
permission = {
|
||||
@@ -216,10 +215,9 @@ limitations under the License.
|
||||
value: {},
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
element._computePermissionName(
|
||||
name, permission, element.permissionValues, element.capabilities),
|
||||
element.permissionValues[permission.id].name);
|
||||
assert.equal(element._computePermissionName(
|
||||
name, permission, element.permissionValues, element.capabilities),
|
||||
element.permissionValues[permission.id].name);
|
||||
|
||||
name = 'refs/for/*';
|
||||
permission = {
|
||||
@@ -229,10 +227,9 @@ limitations under the License.
|
||||
},
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
'Label Code-Review');
|
||||
assert.equal(element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
'Label Code-Review');
|
||||
|
||||
permission = {
|
||||
id: 'labelAs-Code-Review',
|
||||
@@ -241,10 +238,9 @@ limitations under the License.
|
||||
},
|
||||
};
|
||||
|
||||
assert.equal(
|
||||
element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
'Label Code-Review(On Behalf Of)');
|
||||
assert.equal(element._computePermissionName(name, permission,
|
||||
element.permissionValues, element.capabilities),
|
||||
'Label Code-Review(On Behalf Of)');
|
||||
});
|
||||
|
||||
test('_computeSectionName', () => {
|
||||
|
||||
@@ -110,8 +110,7 @@
|
||||
const message = change ?
|
||||
CREATE_CHANGE_SUCCEEDED_MESSAGE :
|
||||
CREATE_CHANGE_FAILED_MESSAGE;
|
||||
this.dispatchEvent(new CustomEvent(
|
||||
'show-alert',
|
||||
this.dispatchEvent(new CustomEvent('show-alert',
|
||||
{detail: {message}, bubbles: true, composed: true}));
|
||||
if (!change) { return; }
|
||||
|
||||
|
||||
@@ -57,10 +57,9 @@ limitations under the License.
|
||||
'cell label u-gray-background');
|
||||
assert.equal(element._computeLabelClass(
|
||||
{labels: {}}, 'Verified'), 'cell label u-gray-background');
|
||||
assert.equal(
|
||||
element._computeLabelClass(
|
||||
{labels: {Verified: {approved: true, value: 1}}}, 'Verified'),
|
||||
'cell label u-green u-monospace');
|
||||
assert.equal(element._computeLabelClass(
|
||||
{labels: {Verified: {approved: true, value: 1}}}, 'Verified'),
|
||||
'cell label u-green u-monospace');
|
||||
assert.equal(element._computeLabelClass(
|
||||
{labels: {Verified: {rejected: true, value: -1}}}, 'Verified'),
|
||||
'cell label u-monospace u-red');
|
||||
|
||||
@@ -236,8 +236,9 @@
|
||||
this.change._number, {add: [newHashtag]}).then(newHashtag => {
|
||||
this.set(['change', 'hashtags'], newHashtag);
|
||||
if (newHashtag !== lastHashtag) {
|
||||
this.dispatchEvent(new CustomEvent(
|
||||
'hashtag-changed', {bubbles: true, composed: true}));
|
||||
this.dispatchEvent(
|
||||
new CustomEvent('hashtag-changed', {
|
||||
bubbles: true, composed: true}));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1197,6 +1197,7 @@
|
||||
* Compute size bar layout values from the file list.
|
||||
*
|
||||
* @return {Gerrit.LayoutStats|undefined}
|
||||
*
|
||||
*/
|
||||
_computeSizeBarLayout(shownFilesRecord) {
|
||||
if (!shownFilesRecord || !shownFilesRecord.base) { return undefined; }
|
||||
@@ -1280,6 +1281,7 @@
|
||||
* Get the x-offset of the deletion bar for a file.
|
||||
*
|
||||
* @param {Gerrit.LayoutStats} stats
|
||||
*
|
||||
* @return {number}
|
||||
*/
|
||||
_computeBarDeletionX(stats) {
|
||||
|
||||
@@ -143,6 +143,7 @@
|
||||
*
|
||||
* @param {!Array<!Gerrit.DiffChunk>} chunks
|
||||
* @param {boolean} isBinary
|
||||
*
|
||||
* @return {!Promise<!Array<!Object>>} A promise that resolves with an
|
||||
* array of GrDiffGroups when the diff is completely processed.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
const htmlPlugins = (plugins.html_resource_paths || []);
|
||||
const jsPlugins =
|
||||
this._handleMigrations(plugins.js_resource_paths || [], htmlPlugins);
|
||||
|
||||
const shouldLoadTheme = config.default_theme &&
|
||||
!Gerrit._isPluginPreloaded('preloaded:gerrit-theme');
|
||||
const themeToLoad =
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
* @return {string} Appropriate class name for the element is returned
|
||||
*/
|
||||
GrStyleObject.prototype.getClassName = function(element) {
|
||||
let rootNode = Polymer.Settings.useShadow ?
|
||||
element.getRootNode() : document.body;
|
||||
let rootNode = Polymer.Settings.useShadow
|
||||
? element.getRootNode() : document.body;
|
||||
if (rootNode === document) {
|
||||
rootNode = document.head;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
const line = context.line;
|
||||
// Highlight lines missing coverage with this background color if
|
||||
// coverage should be displayed, else do nothing.
|
||||
const annotationStyle = displayCoverage ?
|
||||
coverageStyle :
|
||||
emptyStyle;
|
||||
const annotationStyle = displayCoverage
|
||||
? coverageStyle
|
||||
: emptyStyle;
|
||||
if (coverageData[path] &&
|
||||
coverageData[path].changeNum === context.changeNum &&
|
||||
coverageData[path].patchNum === context.patchNum) {
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
switch (usersType) {
|
||||
case Gerrit.SUGGESTIONS_PROVIDERS_USERS_TYPES.REVIEWER:
|
||||
return new GrReviewerSuggestionsProvider(restApi, changeNumber,
|
||||
input =>
|
||||
restApi.getChangeSuggestedReviewers(changeNumber, input));
|
||||
input => restApi.getChangeSuggestedReviewers(changeNumber,
|
||||
input));
|
||||
case Gerrit.SUGGESTIONS_PROVIDERS_USERS_TYPES.CC:
|
||||
return new GrReviewerSuggestionsProvider(restApi, changeNumber,
|
||||
input => restApi.getChangeSuggestedCCs(changeNumber, input));
|
||||
|
||||
Reference in New Issue
Block a user