Re: [Wikitech-l] Question to WMF: Backlog on bugs

2019-03-24 Thread John Erling Blad
Sorry, but this is not valid. I can't leave this uncommented.

Assume the article is right, then all metrics would be bad. Thus we
can't find any example that contradicts the statement in the article.

If we pick coverage of automated tests as a metric, then _more_ test
coverage would be bad given the article pretense. Clearly there can be
bad tests, like any code, but assume the tests are valid, would
increasing the coverage be bad as such? Clearly no.

Pick another example, like cyclomatic complexity. Assume some code
controls what or how we measure cc. If we change this code so _more_
code is covered by CC-measurements, then this would be bad given the
articles pretense. Again clearly no.

Yet another one, code duplication. Assume some code measure code bloat
by a simple duplication test. Testing more code for code bloat would
then be bad, given the article pretense. Would all code duplication be
bad? Not if you must keep speed up in tight loops. So perhaps you may
say a metric for code duplication could be wrong sometimes.

Measuring code quality is completely valid, as is measuring article
quality. The former is disputed, but the later is accepted as a
GoodThingâ„¢ by the same programmers. Slightly rewritten; "Don't count
me, I'll count you!"

On Thu, Mar 21, 2019 at 7:07 AM Gergo Tisza  wrote:
>
> On Wed, Mar 20, 2019 at 2:08 PM Pine W  wrote:
>
> > :) Structured data exists regarding many other subjects such as books and
> > magazines. I would think that a similar approach could be taken to
> > technical debt. I realize that development tasks have properties and
> > interactions that change over time, but I think that having a better
> > quantitative understanding of the backlog would be good and would likely
> > improve the quality of planning and resourcing decisions.
> >
>
> Focusing on metrics is something bad managers tend to do when they don't
> have the skills or knowledge to determine the actual value of the work.
> It's a famous anti-pattern. I'll refer you to the classic Spolsky article:
> https://www.joelonsoftware.com/2002/07/15/20020715/
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Question to WMF: Backlog on bugs

2019-03-24 Thread Nathan
I think it was doomed to fail as soon as people argued that an organization
with an ~$80m annual budget had too many "resource constraints" to address
a backlog of bugs in its core product. That happened in the first five or
so replies to the thread!

On Sun, Mar 24, 2019 at 10:05 PM John Erling Blad  wrote:

> It is a strange discussion, especially as it is now about how some
> technical debts are not _real_ technical debts. You have some code,
> and you change that code, and breakage emerge both now and for future
> projects. That creates a technical debt. Some of it has a more
> pronounced short time effect (user observed bugs), and some of has a
> more long term effect (it blocks progress). At some point you must fix
> all of them.
>
> On Thu, Mar 21, 2019 at 11:10 PM Pine W  wrote:
> > It sounds like we have different perspectives. However, get the
> impression
> > that people are getting tired of the this topic, so I'll move on.
>
> I don't think this will be solved, so "move on" seems like an obvious
> choice.
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Huji Lee
Thanks a lot! The gist certainly helped a lot.

I think the key line in your code, and what Alex was referring to, was this
one: this.$content.empty().append( $content );

But I like the idea of formalizing the process into an object. I will
likely take a slightly different approach, in which I will create a class
that inherits PanelLayout but has the additional setContent() method you
had in your gist.



On Sun, Mar 24, 2019 at 3:01 PM Moriel Schottlender <
mschottlen...@wikimedia.org> wrote:

> You absolutely can attach a jQuery element into your $content parameter.
> That will work, and probably give you what you want.
>
> However, one of the more powerful things about OOUI is its ability to
> encapsulate this type of work. In this case, what I would recommend, is
> creating your own custom widget that manages itself.
>
> I imagine that your $content changes, but it probably has similar structure
> through its changes. For example, it might have an error box at the top
> that only appears when necessary, or it can have some regular inputs
> alongside inputs that maybe change, and it probably has some area where you
> display a text or an image or anything else.
>
> You could create all of those in jQuery, but OOUI also offers you an
> ability to encapuslate this better.
>
> I tried to explain this in an email and got a bit long, so I created a
> gist: https://gist.github.com/mooeypoo/a9082a5a5828dcec53be28ed3c538e22
>
> The main idea I am trying to show is how you can create your own widget
> that extends OO.ui.Widget, construct its base structure in the constructor
> with either other OOUI widgets or with some custom jQuery elements, add
> classes and event listeners, and then manage the state of this widget when
> some other code calls its methods.
>
> I tried to also show how you can have your custom widget emit some custom
> event so that other pieces of your code (say, the dialog in general?) can
> listen to some event (I used "success" but you can define whatever you
> want) and respond, like change to another panel, or close the dialog, or
> enable some other action.
>
> I hope the gist helps, I tried to make it self explanatory, but please let
> me know if you encounter any issues with it (I wrote it relatively quickly,
> I hope there aren't any bugs ;)
>
> Moriel
>
> On Sun, Mar 24, 2019 at 7:19 AM Alex Monk  wrote:
>
> > I haven't dealt with OOUI for a couple of years but maybe you could pass
> a
> > jQuery object to the $content parameter, store it yourself, then modify
> > that later?
> >
> > On Sun, 24 Mar 2019 at 14:14, Huji Lee  wrote:
> >
> > > In the script I am working on,[1] I have a PanelLayout that is defined
> > like
> > > this:
> > >
> > > this.previewResult = new OO.ui.PanelLayout({
> > >   expanded: true,
> > >   padded: true,
> > >   framed: true,
> > >   $content: ''
> > > });
> > >
> > > Later on, I would like to modify the content of this; specifically, I
> > want
> > > to use MW API to retrieve the parsed output of some short wikitext. For
> > > now, however, I just want to try out the concept by replacing the
> content
> > > with a simple  tag.
> > >
> > > Evidently, this line of code does not do the trick:
> > >
> > > dialog.previewResult.$content = 'Something';
> > >
> > >
> > > That is, it does update the value of the $content property for the OOUI
> > > object, but that does not result in the object getting re-rendered.
> None
> > of
> > > the setter functions for OO.ui.PanelLayout seem to do the trick either.
> > >
> > > What is the correct way to do this? If PanelLayout is not the right
> > object
> > > type for this purpose, what is?
> > > ___
> > > Wikitech-l mailing list
> > > Wikitech-l@lists.wikimedia.org
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Moriel Schottlender (she/her)
> Senior Software Engineer
> Tech Lead | Community Tech and Anti Harassment Tools
> Wikimedia Foundation https://wikimediafoundation.org/
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Question to WMF: Backlog on bugs

2019-03-24 Thread John Erling Blad
It is a strange discussion, especially as it is now about how some
technical debts are not _real_ technical debts. You have some code,
and you change that code, and breakage emerge both now and for future
projects. That creates a technical debt. Some of it has a more
pronounced short time effect (user observed bugs), and some of has a
more long term effect (it blocks progress). At some point you must fix
all of them.

On Thu, Mar 21, 2019 at 11:10 PM Pine W  wrote:
> It sounds like we have different perspectives. However, get the impression
> that people are getting tired of the this topic, so I'll move on.

I don't think this will be solved, so "move on" seems like an obvious choice.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Moriel Schottlender
You absolutely can attach a jQuery element into your $content parameter.
That will work, and probably give you what you want.

However, one of the more powerful things about OOUI is its ability to
encapsulate this type of work. In this case, what I would recommend, is
creating your own custom widget that manages itself.

I imagine that your $content changes, but it probably has similar structure
through its changes. For example, it might have an error box at the top
that only appears when necessary, or it can have some regular inputs
alongside inputs that maybe change, and it probably has some area where you
display a text or an image or anything else.

You could create all of those in jQuery, but OOUI also offers you an
ability to encapuslate this better.

I tried to explain this in an email and got a bit long, so I created a
gist: https://gist.github.com/mooeypoo/a9082a5a5828dcec53be28ed3c538e22

The main idea I am trying to show is how you can create your own widget
that extends OO.ui.Widget, construct its base structure in the constructor
with either other OOUI widgets or with some custom jQuery elements, add
classes and event listeners, and then manage the state of this widget when
some other code calls its methods.

I tried to also show how you can have your custom widget emit some custom
event so that other pieces of your code (say, the dialog in general?) can
listen to some event (I used "success" but you can define whatever you
want) and respond, like change to another panel, or close the dialog, or
enable some other action.

I hope the gist helps, I tried to make it self explanatory, but please let
me know if you encounter any issues with it (I wrote it relatively quickly,
I hope there aren't any bugs ;)

Moriel

On Sun, Mar 24, 2019 at 7:19 AM Alex Monk  wrote:

> I haven't dealt with OOUI for a couple of years but maybe you could pass a
> jQuery object to the $content parameter, store it yourself, then modify
> that later?
>
> On Sun, 24 Mar 2019 at 14:14, Huji Lee  wrote:
>
> > In the script I am working on,[1] I have a PanelLayout that is defined
> like
> > this:
> >
> > this.previewResult = new OO.ui.PanelLayout({
> >   expanded: true,
> >   padded: true,
> >   framed: true,
> >   $content: ''
> > });
> >
> > Later on, I would like to modify the content of this; specifically, I
> want
> > to use MW API to retrieve the parsed output of some short wikitext. For
> > now, however, I just want to try out the concept by replacing the content
> > with a simple  tag.
> >
> > Evidently, this line of code does not do the trick:
> >
> > dialog.previewResult.$content = 'Something';
> >
> >
> > That is, it does update the value of the $content property for the OOUI
> > object, but that does not result in the object getting re-rendered. None
> of
> > the setter functions for OO.ui.PanelLayout seem to do the trick either.
> >
> > What is the correct way to do this? If PanelLayout is not the right
> object
> > type for this purpose, what is?
> > ___
> > Wikitech-l mailing list
> > Wikitech-l@lists.wikimedia.org
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



-- 
Moriel Schottlender (she/her)
Senior Software Engineer
Tech Lead | Community Tech and Anti Harassment Tools
Wikimedia Foundation https://wikimediafoundation.org/
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Huji Lee
In the script I am working on,[1] I have a PanelLayout that is defined like
this:

this.previewResult = new OO.ui.PanelLayout({
  expanded: true,
  padded: true,
  framed: true,
  $content: ''
});

Later on, I would like to modify the content of this; specifically, I want
to use MW API to retrieve the parsed output of some short wikitext. For
now, however, I just want to try out the concept by replacing the content
with a simple  tag.

Evidently, this line of code does not do the trick:

dialog.previewResult.$content = 'Something';


That is, it does update the value of the $content property for the OOUI
object, but that does not result in the object getting re-rendered. None of
the setter functions for OO.ui.PanelLayout seem to do the trick either.

What is the correct way to do this? If PanelLayout is not the right object
type for this purpose, what is?
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] Dynamically setting the content of a LayoutPanel in OOUI

2019-03-24 Thread Alex Monk
I haven't dealt with OOUI for a couple of years but maybe you could pass a
jQuery object to the $content parameter, store it yourself, then modify
that later?

On Sun, 24 Mar 2019 at 14:14, Huji Lee  wrote:

> In the script I am working on,[1] I have a PanelLayout that is defined like
> this:
>
> this.previewResult = new OO.ui.PanelLayout({
>   expanded: true,
>   padded: true,
>   framed: true,
>   $content: ''
> });
>
> Later on, I would like to modify the content of this; specifically, I want
> to use MW API to retrieve the parsed output of some short wikitext. For
> now, however, I just want to try out the concept by replacing the content
> with a simple  tag.
>
> Evidently, this line of code does not do the trick:
>
> dialog.previewResult.$content = 'Something';
>
>
> That is, it does update the value of the $content property for the OOUI
> object, but that does not result in the object getting re-rendered. None of
> the setter functions for OO.ui.PanelLayout seem to do the trick either.
>
> What is the correct way to do this? If PanelLayout is not the right object
> type for this purpose, what is?
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l