> Isn't Foreman going to switch to Patternfly at some point? How does that
> work when we add Angular to that equation?
Angular works seamlessly with patternfly and in fact patternfly is working on their own angular library . We will be contributing the common "widgets" we've created back into angular-patternfly soon.
> Making the UI pluggable (either through deface or changes we introduce in
> Foreman core) is key for plugins. Is there a solid alternative to deface at
> this point if we made the change?
> Do we have people willing to lead this changes? Tom and Joseph?
Eric and myself are currently working on splitting up Bastion into bastion and bastion-katello . This will go a long way in making it easier to develop plugins against Bastion.
> How fast can we build plugins that starts changing some things (tables, top
> bar…) to bastion? If developers are skilled enough to do this, I think
> it's reasonable not to rewrite this from scratch but to see how the look
> evolves and ask the whole community (developers + users) in the end. Worst
> case scenario, the downstream product will look more unified.
I'd guess within a couple of weeks. Eric?
···----- Original Message ----- From: "Daniel Lobato" To: firstname.lastname@example.org Sent: Wednesday, September 10, 2014 1:44:06 PM Subject: Re: [foreman-dev] foreman and katello UI future
A few questions and thoughts after reading the whole thread:
I like the fact Bastion comes with tests and that we could have a tested js
What happens to all the js logic AND html helpers we’ve been using?
Isn’t Foreman going to switch to Patternfly at some point? How does that
work when we add Angular to that equation?
Making the UI pluggable (either through deface or changes we introduce in
Foreman core) is key for plugins. Is there a solid alternative to deface at
this point if we made the change?
Do we have people willing to lead this changes? Tom and Joseph?
How fast can we build plugins that starts changing some things (tables, top
bar…) to bastion? If developers are skilled enough to do this, I think
it’s reasonable not to rewrite this from scratch but to see how the look
evolves and ask the whole community (developers + users) in the end. Worst
case scenario, the downstream product will look more unified.
Thanks Tom for bringing up the issue, clearly lots of people care about it.
On Wed, Sep 10, 2014 at 7:11 PM, Ivan Necas email@example.com wrote:
----- Original Message -----
Thanks for the thoughts Ohad. I, for one, do not think making a
singular decision is the right approach as you mention as this is true
of any other type of change that would be made (e.g. to switch to
Dynflow for orchestration has taken time and small steps as well). I
do want to clarify a few points below because I think there are some
misconceptions that I have heard time and time again.
On Wed, Sep 10, 2014 at 9:56 AM, Ohad Levy firstname.lastname@example.org wrote:
Just to make sure, please read my reply in positive light as thats how
I’m sure we all write and read the posts in positive light. Could we add
some disclaimer about this practice on this mailing list?
On Wed, Sep 10, 2014 at 4:12 PM, Eric D Helms email@example.com > wrote:
I will include some specific responses inline below, however, as the
person who originally pushed Katello down this road, I’d like to give
some insight into the history of the choice we made.
During the days that Katello was the open-source project for what
became Cloud Forms 1.0, we had a UI that reflected the typical 960px
as, for those that know, tupane. Over time, users and developers alike
started requesting more and more dynamic functionality. This led to
creating a swath of spaghetti that interlinked Rails views, UI only
this is indeed true for Katello, but on the other side, Foreman is 5
old (today!) and we don’t have spaghetti code at all,
the most “complicated” js we have is in the host edit form, totaling
600 lines, surely that’s not that bad.
we can and should improve our UI implementation, but based on my
i cant say that ERB/JS is evil or not manageable etc.
First, Happy birthday! Second, the combination of JS (via jQuery
selectors), erb, and erb.js is to me spaghetti. The use of erb.js
links JS snippets to your Rails controllers and the data therein
making it hard to determine where a particular chunk of JS
functionality is coming from. jQuery style selectors to produce
workflows is not scalable and leads to the issues that we encountered.
You are required to build views and view chunks that have specific
makes figuring out which file manipulates what view difficult.
Once we hashed out, via design meetings, what new design we wanted for
all pages that represented a table + object details I began to
investigate if there was a better way to build this new design. I had
grown tired of the increasing effort to sustain the spaghetti due to
how inter-weaved all the pieces (views, JS, controller, helpers) had
become and looked for what new tools were out there. This led me to
better. I took a basic premise: build a table view that only changes
out the data. I then built this using Backbone, AngularJS, Knockout,
and early Ember. At the time, these were the most popular frameworks
that my research could discern. I quickly found that I was building
the AngularJS application faster and more understandably than the
rest. However, I did not stop there. I also considered:
a) Does the framework have longevity? Will there be support 2 years
b) How easy is to build JS components?
c) How easy is it for a new developer to get on board?
d) Can the code written with said framework be tested?
That is indeed great, however, at the same time, i assume it took you
least* one year to learn, implement etc.
The benefit of using common / simple UI practices, means that we dont
to spend a lot of time in design, learning and testing which is
scope of our tool.
It also means, that a lot of existing tools can be used, we use a lot
libs (charting, editor, bootstrap, novnc, spice, multi select, data
etc), that are either based on json( e.g. data tables) or on pure html
(which is also a very good official api such as multi select).
Honestly, it took me about 2 months. After a year we were building
prototypes with ease, spinning up new pages and the bulk of our time
and effort was spent getting our API controllers into proper shape
because they had been neglected in favor of our previous UI
controllers. In the Angular world there are plenty of libraries
available for use (http://ngmodules.org/) and wrappers around
existing, popular libraries (e.g.
in other words, you’ve have built a framework based on angular, while
be the best framework in the world, the original question remains,
spend all of this time building a framework for a new UI workflow?
We did not build a framework. This is the equivalent of saying that
Foreman is a framework. We built some common tools and functionality
just as a helper or application controller in a Rails application
centralizes common functionality.
The reasons I inevitably went with Angularjs, and should address some
concerns folks have mentioned are:
a) A primary goal of the Angularjs team is to build Angularjs using
such that when those are implemented natively by the browser, the
Angularjs team can remove that functionality from the library and thus
reduce the foot print. And, where they see a concept created by them
that could be useful to the larger community, pushing those changes to
the browser spec so as to remove it from their library. A good example
of this is the watch/observe functionality that is now making it’s way
into the browser.
27.2k stars on Github
4 years old
54k tagged questions on stack overflow
75k+ hits on youtube when searching “angularjs”
b) Directives made creating components easy, and although the toughest
part of angular, this was easier than building components using basic
c) I’ll let other developers who have built things subsequently chime
in here. For me, things are much quicker and have not degraded over
time like before. There are lots of tools for learning, plenty of
tutorials, videos and tons of short videos. Websites such as
http://angular.codeschool.com/. They also have case studies from
parties - https://builtwith.angularjs.org/.
d) Angularjs came built with testing in mind via their test runner
Karma. We have since been able to write tests for all aspects of our
JS, generate coverage, run a Jenkins job on each PR for the testing.
Further, the tests can be run from the command line and run in less
than a minute.
After considering all of the above, I decided to build out the design
that had been created and spec’d out with Angularjs for the most
complex object we had (i.e. systems). I did this in order to
illuminate any pitfalls that may occur when applied to a complex
object. Further, I did not radically overhaul and push this upon the
project. Rather, I took an approach of showing off the steps along the
way to developers, asking questions of developers when I faced design
choices, and eventually providing this new look’n’feel and interface
via an experimental UI mode.
This experimental mode was a toggle-able user preference that when
enabled hid the old UI and displayed the new UI components. This
allowed users to play with and try out the new pieces without having
to completely give up (or break) old functionality. After we got the
experimental UI to the point of being ready for prime time, we then
flipped the scenario such that the old UI was still around but in a
legacy mode that a user could toggle on or off. This allowed us to
step through the building with a new implementation style as well as
test and use new pieces without having to make radical change.
As others have mentioned, a side benefit of this approach was that we
only needed to maintain one set of API controllers. This meant that we
found gaps in the logic that our UI controllers and API controllers
were assuming as well as gaps in the authentication by centralizing to
a single entry point.
I still dont see it as plus, API needs to be stable, and cant be
while UI controllers can evolve quicker and allow breaking changes
want to change your UI.
The reason, in the previous thread, that I brought up the idea of UI
plugins was based upon our previous experience with experimental mode.
Creating UI plugins seems like a great way to not disrupt the core,
while simultaneously providing a method for the community to try out
this new way of creating and new design patterns. If, in the end, we
can convince you of what we believe with respect to how we should
build UI’s in the Foreman community, then we can easily pull these
changes into the project as the main method.
I have, at times, got the impression that some feel as if we did not
take a measured and reasoned approach towards converting how we built
the Katello UI in the past to how we build it now. I hope this helps
explain a bit about where we are coming from, why we made the choices
we did and why we believe in the approach that we took.
Overall, I think you guys did what is right for Katello, For foreman,
having a hard time justifying a rewrite, overall the issues i see are:
- make simple pages complex (its much easier to use existing foreman
for the avg community developer)
Much easier is subjective, and I’d argue this lacks evidence on either
angular, api, json etc)
Fair point, although JS already exists within Foreman and knowledge of
the API and it’s JSON doesn’t seem like asking for much compared to
the other knowledge that is required. This, however, can only be
proven/shown over time and with users trying.
- is not extendable by plugins
- rewrite most likely will break existing plugins
I’d argue that this is not true for current Foreman core either.
Pointing users to a library (deface) that can manipulate the UI in any
way they want is not providing extension and cannot scale. You can
never know what parts of the UI any user is changing at any given time
and thus any change to the UI is subject to breaking existing plugins.
However, I wouldn’t argue for ever doing a drastic, quick change but
rather, like an API change, introduce it over time.
- normally, takes longer to implement
- has no equivalent helpers like rails / foreman.
As I always tell Tom when he makes passionate arguments, please
provide data and evidence.
on the plus side, I do admit that our JS testing is lacking, and that
pages are over complicated, refactoring will solve it, but i can’t say
AngularJS is the only solution.
Further, pure client side implementation is not required for a
app with a limited amount of users… its obviously a plus, and there
good chance that I myself would start with Angular if I had started
but I have the feeling that the UI does not require that much of an
attention compared to the actual features the application can provide.
I agree that a client side implementation is not required, and this
argument is not dealing with the scale of users but rather the
requirements around building dynamic components and workflows. The
original aspects that drove our push for client side was due in part
to requirements. We received requirements that increasing requested
dynamic interface components that provided workflows, and data views
and manipulation. Which we found were easier and quicker to build
through pure client side implementations and hitting the API than
attempting to combine Rails controller, views and jQuery.
As you said, the only course of action is to take the open source
approach, keep believing in what we believe and push to help others
see it as we do
IMHO, we need to be as useful as possible (e.g. integrate with X, do Y
while providing a high quality look & feel, I also believe that most
that use both foreman / katello, do not see / feel the difference
the pages at first.
and if performance is an issue, there are simple ways using turbolinks
etc, that can mitigate that as well.
lastly, I’m not against improving, I’m mostly worried that it would
down, and introduce a bottleneck, imho we must:
- unify look and feel, this is needed regardless of the technologies
- provide bastion as a plugin, so it wont work only in the context of
+1 on this approach: we took similar one with foreman-tasks (we started
first having the
functionality build into the Katello, but we decided quite early we want a
separate plugin so that it can be used outside of Katello realm, which
turned out to be a good decision, as it opened the orchestration
for Staypuft, MCO, foreman snapshot, all contributing in improving the
and stability, and now we’re slowly on a journey to the core.
I’m sure the foreman community is able to recognize added value once
useful in hands. The Bastion went interesting way so far and now it’s good
time to share
that knowledge and code with others (and I’m glad to see the other thread