Multitenancy for Forge as a Service
by Andrew Lee Rubinger
Hi, all:
We have some requests coming down the pike from the Developer Group with
regards to running Forge as a Service (which is great!).
Additionally, I'm suspecting this will soon be very important for us as
well, as we continue to build out what's currently known as the "Obsidian
Generator", using Forge as a backend.
I'm hoping the Forge team will kindly advise as to our preparedness for
running Forge in a multitenant environment. Concerns may include resource
consumption (not running an instance-per-user), security, etc. Have we yet
broached this subject specifically in the prototypes I've seen thus far
using Forge Online?
I've requested of the Developer Group a list of requirements they've
devised; will send those along here when I have them. In the meantime,
mind describing where we currently stand?
S,
ALR
--
Red Hat Developer Group Architecture
@ALRubinger
7 years, 9 months
JavaSourceClass parameter
by Alex Soto Bueno
Hi mates,
currently I am creating a command that should receive a Test Java Class as
parameter.
I have created a command with an attribute of type JavaClassSource.
@Inject
@WithAttributes(shortName = 'j', label = "Test Class", required = true)
private UIInput<JavaClassSource> testClass;
Then when I try to run this command from CLI the first thing I have noted
is that autocompletition of the java class name does not work, and when I
set it manually typing all characters
i.e arquillian-algeron-create-contract-fragment --consumer consumer
--provider provider --fragment myFragment --test-class
org.contract.MyContract then I got No converter found from java.lang.String
to org.jboss.forge.roaster.model.source.JavaClassSource
I think that this is because it expects the class to be found as main java
classes and not test classes, any idea on why this is happening?
Thank you so much.
7 years, 9 months
Metadata for projects
by Alex Soto Bueno
Hello, is there any way to set some kind of metadata that survives to forge
console life time?
What I want to do is that when you run a command you set some metadata
regarding an option that user has chosen.
Then in the future when user runs other commands we can get that
information from there and act accordantly.
Alex.
7 years, 9 months
Bug on XML indentation?
by Alex Soto Bueno
Hi I am generating an XML file in an addon using:
XMLParser.toXMLString(xml);
The node I am creating is done:
xml.getOrCreate("extension@qualifier=" + qualifier)
.getOrCreate("property@name=" + key)
.text(value);
were value is a yaml-like expression.
The problem is that the resulting XML is not well indented:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<extension qualifier="algeron-consumer">
<configuration>
<property name="publishConfiguration">
provider: folder
outputFolder: /tmp/contracts
contractsFolder: target/pacts
</property>
</configuration>
</extension>
</arquillian>
I can understand that YAML thing is not correctly formatted but notice that
the closing </property> tag is not correctly indented.
Any idea?
Alex.
7 years, 10 months
Required Parameter is ignored although it is set
by Alex Soto Bueno
Hello,
I have next command:
public class AddAlgeronFolderPublisher extends AbstractProjectCommand
implements UICommand
{
@Inject
private ProjectFactory projectFactory;
@Inject
private FacetFactory facetFactory;
@Inject
@WithAttributes(shortName = 'o', label = "Output Folder", required =
true)
private UISelectOne<String> outputFolder;
@Inject
@WithAttributes(shortName = 'c', label = "Contracts Folder")
private UISelectOne<String> contractFolder;
@Override
public UICommandMetadata getMetadata(UIContext context)
{
return Metadata.from(super.getMetadata(context), getClass())
.category(Categories.create("Algeron"))
.name("Arquillian Algeron: Add Folder Publisher")
.description("This command registers a Folder Publisher for
Algeron");
}
@Override
public void initializeUI(UIBuilder builder) throws Exception
{
builder.add(outputFolder).add(contractFolder);
contractFolder.setDefaultValue("target/pacts");
}
// ......
}
When in Forge console I run:
arquillian-algeron-add-folder-publisher --output-folder /tmp
I got:
***INFO*** Required inputs not satisfied, entering interactive mode
***ERROR*** Output Folder must be specified.
But you can see that I am setting the attribute in the command so any idea
of why this is failing?
7 years, 10 months
Dependency check
by Alex Soto Bueno
Hi guys, is it necessary to check every time you want to register a
dependency if this dependency has been registered previously or not? Or the
DependencyFacet takes care of it?
Thank you so much.
7 years, 10 months
Testing Forge Addons
by Bartosz Majsak
Hi Forgers ;)
First and foremost many thanks for this great tool :)
We are working on Arquillian Addon
<https://github.com/forge/addon-arquillian> bringing more capabilities as
our universe is growing. One thing which has been quite challenging is
testing. There are several ways of doing it as one can figure from
different addons available out in the wild.
I would like to get better understanding of what would be the preferred way
of testing an addon.
I personally liketestShellapproach as it gives you end-to-end flow and
ability to verify the behaviour of what user would do with the tool. This
has obvious performance drawbacks, but I believe we could make it more
efficient. I have developed small set of testing assertions
<https://github.com/forge/addon-arquillian/tree/e61fad56cab4a1684eb283345d...>
based on assertjfor verifying the state of a project (e.g. classes or
artifacts present). It is still work in progress and I’m eagerly looking
for feedback, but eventually I would like to bring it upstream to test
harness if that makes sense. You can see how it looks like for example in
the test verifying junit test scaffolding
<https://github.com/forge/addon-arquillian/blob/e61fad56cab4a1684eb283345d...>
.
Another problematic aspect is Forge addon deployment - the documentation
<https://forge.jboss.org/document/test-your-addon> seems not to reflect the
current state and I failed badly trying to create my own@Deployment with
assertj bundled. What I ended up with is an Arquillian extension
<https://github.com/forge/addon-arquillian/tree/e61fad56cab4a1684eb283345d...>
which lets you add dependencies (resolved by Shrinkwrap under the hood) as
well as packages by simply using annotations - you can see both in action
in the junit test mentioned above. Is it the right way? We can also think
about bringing it upstream. Can we improve the docs to show what is
required to create proper @Deployment for the addon?
As Arquillian Addon is around for quite some time and several folks were
involved in it, there is also another way of testing forge commands by
using CommandController - can someone point me to the doc or briefly
explain what is the difference? Here’s one test
<https://github.com/forge/addon-arquillian/blob/e61fad56cab4a1684eb283345d...>
from our addon.
Cheers,
Bartosz.
7 years, 10 months