verify-status-plugin and polyui

114 views
Skip to first unread message

Björn Pedersen

unread,
Dec 4, 2018, 8:36:16 AM12/4/18
to Repo and Gerrit Discussion
Hi,

we do use the verify status plugin (it builds and loads on 2.16 nicely), but in polyui I get a js error as the gwt js is loaded in polyui context as well:

verifystatus-0.js:1085 Tue Dec 04 14:25:36 GMT+100 2018 Class$134
SEVERE: TypeError: $wnd.Gerrit.get_raw is not a function
Class$S38: TypeError: $wnd.Gerrit.get_raw is not a function
    at Unknown.Wc(verifystatus-0.js)
    at Unknown.Tc(verifystatus-0.js)
    at Unknown._b(verifystatus-0.js)
    at Unknown.At(verifystatus-0.js)
    at Unknown.g(verifystatus-0.js)
    at Unknown.Wd(verifystatus-0.js)
    at Unknown.Zd(verifystatus-0.js)
    at Unknown.eval(verifystatus-0.js)
    at Unknown.rt(verifystatus-0.js)
    at Unknown.eval(verifystatus-0.js)
    at Unknown.anonymous(<anonymous>)
    at Unknown.m(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.anonymous(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.l(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.A.verifystatus.onScriptDownloaded(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.anonymous(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/8162A4E5098D95249A3B8192E56C872B.cache.js)

Any tips where look how to either suppress loading completly in polyui or supply a polyui-compatible interface?

Björn

David Pursehouse

unread,
Dec 4, 2018, 9:24:57 AM12/4/18
to Björn Pedersen, Repo and Gerrit Discussion
On Tue, Dec 4, 2018 at 10:36 PM 'Björn Pedersen' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
Hi,

we do use the verify status plugin (it builds and loads on 2.16 nicely),

Unrelated to your problem but note that this plugin has a quite outdated master branch, i.e. there are a lot of commits on its stable-2.14 branch that have not been merged up through stable-2.15 to master.    I started working on it but didn't have time to solve all the conflicts.
You might be able to suppress it in the same way that the delete-project plugin does, i.e. by enclosing everything in a conditional that is only executed when it's not loaded in polygerrit:


 

Björn

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Björn Pedersen

unread,
Dec 5, 2018, 2:42:09 AM12/5/18
to Repo and Gerrit Discussion


Am Dienstag, 4. Dezember 2018 15:24:57 UTC+1 schrieb David Pursehouse:
On Tue, Dec 4, 2018 at 10:36 PM 'Björn Pedersen' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:
Hi,

we do use the verify status plugin (it builds and loads on 2.16 nicely),

Unrelated to your problem but note that this plugin has a quite outdated master branch, i.e. there are a lot of commits on its stable-2.14 branch that have not been merged up through stable-2.15 to master.    I started working on it but didn't have time to solve all the conflicts.


I'll try to push some changes.
 
but in polyui I get a js error as the gwt js is loaded in polyui context as well:

verifystatus-0.js:1085 Tue Dec 04 14:25:36 GMT+100 2018 Class$134
SEVERE: TypeError: $wnd.Gerrit.get_raw is not a function
Class$S38: TypeError: $wnd.Gerrit.get_raw is not a function
    at Unknown.Wc(verifystatus-0.js)
    at Unknown.Tc(verifystatus-0.js)
    at Unknown._b(verifystatus-0.js)
    at Unknown.At(verifystatus-0.js)
    at Unknown.g(verifystatus-0.js)
    at Unknown.Wd(verifystatus-0.js)
    at Unknown.Zd(verifystatus-0.js)
    at Unknown.eval(verifystatus-0.js)
    at Unknown.rt(verifystatus-0.js)
    at Unknown.eval(verifystatus-0.js)
    at Unknown.anonymous(<anonymous>)
    at Unknown.m(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.anonymous(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.l(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.A.verifystatus.onScriptDownloaded(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/verifystatus.nocache.js)
    at Unknown.anonymous(http://opc-158.office.frm2:8085/plugins/verify-status/static/verifystatus/8162A4E5098D95249A3B8192E56C872B.cache.js)

Any tips where look how to either suppress loading completly in polyui or supply a polyui-compatible interface?

You might be able to suppress it in the same way that the delete-project plugin does, i.e. by enclosing everything in a conditional that is only executed when it's not loaded in polygerrit:


Hmm, as  there is no static js (only gwt generated things) I do not see where I can hook into here. Shouldn't all GWT-generated code include this by default?

Björn

Björn Pedersen

unread,
Dec 20, 2018, 1:26:22 AM12/20/18
to Repo and Gerrit Discussion
Hi,

I'll got  now a littel bit further, but am still stuck at 2 problems now:

1) The GWT-generated js is still unconditonally loaded in PolyUI context as  well and do not really see where to hook to change this. The exclusion is easier for JSPlugins in GWT-context, where the mentioned trick can get implemented.
   This is not too critical, as it produces js-exception client side, but no further harm.

2) The bigger problem: How to access the GWT-Style rest endpoints from a polyUi js plugin or add new-style endpoints? The plugin.restAPI calls use new-style (http://<url>/c/<projects>/+ ...), but the plugin currently only provides the old-style endpoints (<url>/changes/...)

Any pointer would be helpful.

Björn

David Ostrovsky

unread,
Dec 20, 2018, 11:08:07 AM12/20/18
to Repo and Gerrit Discussion

Am Donnerstag, 20. Dezember 2018 07:26:22 UTC+1 schrieb Björn Pedersen:
Hi,

I'll got  now a littel bit further, but am still stuck at 2 problems now:

1) The GWT-generated js is still unconditonally loaded in PolyUI context as  well and do not really see where to hook to change this. The exclusion is easier for JSPlugins in GWT-context, where the mentioned trick can get implemented.
   This is not too critical, as it produces js-exception client side, but no further harm.

2) The bigger problem: How to access the GWT-Style rest endpoints from a polyUi js plugin or add new-style endpoints? The plugin.restAPI calls use new-style (http://<url>/c/<projects>/+ ...), but the plugin currently only provides the old-style endpoints (<url>/changes/...)

Can you share the client code how can I replicate the issue?

Björn Pedersen

unread,
Dec 28, 2018, 5:33:05 AM12/28/18
to Repo and Gerrit Discussion
Hi,

Sorry for the late reply. The gwt-Endpoints are coming from:
https://gerrit.googlesource.com/plugins/verify-status/+/refs/heads/master/src/main/java/com/googlesource/gerrit/plugins/verifystatus/client/VerifyStatusPlugin.java

And the polymer plugin I use for developing is actually this:
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<dom-module id="gr-verify-status">
 
<script>
   
if (window.Polymer) {
     
Gerrit.install(function(plugin) {
          plugin
.registerCustomComponent(
             
'change-view-integration', 'gr-verify-status-panel');
     
});
   
}
 
</script>
</dom-module>


<dom-module id="gr-verify-status-panel">
 
<template>
   
<style include="gr-form-styles"></style>
   
<gr-verifiy-status-panel>
   
<div id="verify-status">Content here 2 [[fetched]] </div>
   
</gr-verifiy-status-panel>
 
</template>
 
<script >

//(function() {
//  'use strict';
 
Polymer({
    is
: 'gr-verify-status-panel',
    properties
: {
      fetched
: { type: String,
                 computed
: '_fetchData(revision)',
     
},
   
},
    attached
() {
     
this.plugin.attributeHelper(this).bind(
         
'revision', this._onRevisionChanged.bind(this));
   
},
    _fetchData
(what) {
     
const endpoint = '/projects/';

     
const errFn = response => {
       
this.fire('page-error', {response});
     
};

     
return this.plugin.restApi().get(
          endpoint
, errFn)
           
.then(r => {
   console
.log("XXX");        
     
});
   
},
   _onRevisionChanged
(value) {
      console
.log(`(attributeHelper.bind) revision number: ${value._number}`);
   
},
 
}
);
//})();
</script>
</dom-module>





 

Kévin Raymond

unread,
Mar 20, 2019, 5:54:54 AM3/20/19
to Björn Pedersen, Repo and Gerrit Discussion
Hi there,

In my company we also use the verify-status plugin, which "blocks" our
migration to Gerrit version > 2.14.
Considering other alternatives (several cases where CI status are
reported through specific labels)
I still really like the status-verify features (aggregating several data).

Therefore I am considering asking a freelancer (or other software
company) the porting task to polygerrit.
Do any of you have contacts to share of someone already knowing the
project and community?

Cheers,
Reply all
Reply to author
Forward
0 new messages