Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy command created. #57

Merged
merged 1 commit into from
Feb 17, 2016
Merged

Conversation

rhatlapa
Copy link

@rhatlapa rhatlapa commented Feb 1, 2016

Created deploy command, which handles deploy part of #42.

EDIT: updated link to point to correct issue.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 1, 2016

How is #10 related? Should be #42, no?

@Ladicek
Copy link
Contributor

Ladicek commented Feb 1, 2016

An option -- CLI has deploy which could be used here. I'm of course by no means objecting to creating the mgmt operation manually, just suggesting a possibility.

@rhatlapa
Copy link
Author

rhatlapa commented Feb 1, 2016

Yes, you are right, I meant #42

@rhatlapa
Copy link
Author

rhatlapa commented Feb 1, 2016

I wanted to use management operation directly to prevent need of creating temporary files and to just leave it in memory.

@Ladicek Ladicek self-assigned this Feb 1, 2016
/**
* This test uses the {@code ajp} socket binding for all listener types, because there's no listener configured
* by default that uses it (unlike {@code http}).
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it? :-)

private final boolean autoCloseInputStream;
private final List<String> serverGroups;

private Deploy(InputStream deploymentInputStream, Data deployCmdOptions) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly worrying, because InputStream is a one-off thing. If we were on Java 8, I'd prefer Supplier<InputStream>. Another option would be Guava's ByteSource, and even though we already depend on Guava, I'd like to avoid depending on it in public APIs. Another very similar thing is ShrinkWrap's Asset. Sadly, on Java 6, there's probably nothing we can do (short of providing our own interface, which I'd really like to avoid) :-(

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with you, don't now about any better way with Java 6 than using the InputStream. If that would be big issue, I would redo this and allow only File. In that case only in memory handling would be lost :-(.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do that, we can live with InputStream for now.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 8, 2016

What are your plans with this? Do you want this reviewed and merged, or do you plan to work on undeploy commands first and prefer to keep this PR open?

@rhatlapa
Copy link
Author

rhatlapa commented Feb 8, 2016

I plan to work on undeploy command, I believe I should have time to do it during this week. If no one is in hurry, I would wait for it :-).

@rhatlapa
Copy link
Author

I have added also the undeploy command, now it fixes #42 as whole :-).

Note I was thinking also about removing all options from undeploy command, that it would in case of domain always undeploy the deployment from all relevant server groups. As the way the undeploy command behaves, it requires using enabling option for keeping content if there wasn't all relevant server groups selected. WDYT?

@rhatlapa
Copy link
Author

I've decided to remove the option for specifying server groups as I believe no one really wants to use it this way. If it is found needed, I left it as builder => it should be easy to add those options without breaking API.

@rhatlapa
Copy link
Author

=> ready for review

/**
* A single shared instance of this class is passed through the entire builder invocation chain to accumulate
* all the options.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is clearly copied from Online|OfflineOptions, where I deliberately broke the builder to a bunch of classes to be able to provide compile-time checking of all mandatory options. It adds quite some maintenance burden, so I don't think it's suitable for commands. Did you have any special reason to use this pattern instead of plain old single-class builder?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to have also check at compile time, but I agree it is not so important in this case and having written in javadoc which options are only for domain should be satisfactory.

@rhatlapa
Copy link
Author

BTW: there is also option to rewrite the deploy command and make use of DeploymentPlan class similarly as arquillian is handling deploying.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 15, 2016

If you feel like using DeploymentPlan would make the implementation easier, go for it :-) I'm fine with it both ways.

@rhatlapa
Copy link
Author

I have incorporated your suggestions, should be ready for another round of review :-)

@Ladicek
Copy link
Contributor

Ladicek commented Feb 17, 2016

LGTM. Please squash.

I'd also like @simkam and @ochaloup to check if the API exposes all the features they need.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 17, 2016

Also please rebase, I just pushed #61 :-) Shouldn't affect this PR, you're not doing anything version-specific.

I'd also like to do a release today, so if you don't rebase & squash soon, this will have to wait for another release. Waiting for review from @simkam and @ochaloup is not a prerequisite for merge, though.

@ochaloup
Copy link
Collaborator

For me it's fine. I haven't found anything special that I would need for more from the API.

if (serverGroups != null) {
this.serverGroups.addAll(Arrays.asList(serverGroups));
}
return build();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked to Radim and he mentioned that he is not sure if this ok. I agree that this could problem in future if we eventually add more options to builder. @Ladicek wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also a bit unusual. I agree it would be better if these methods just returned Builder and the user always had to call build().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, as Radim just told me, it makes sure that the user can't call both toServerGroups and toAllServerGroups, which is nice. IMHO it would be enough to throw an exception when it's detected that the user called both of these methods, the question is how to detect this -- that would require slightly more complex encoding in the Builder.

Address.deployment added in the process.
@rhatlapa
Copy link
Author

I have done force update, where I have squashed the commits, rebased and modified the builder to return the builder object for toServerGroups and toAllServerGroups and emphasize in javadoc that only one of those should be used, not both of them.

@Ladicek
Copy link
Contributor

Ladicek commented Feb 17, 2016

OK, thanks.

@Ladicek Ladicek added this to the 0.9.5 milestone Feb 17, 2016
@Ladicek Ladicek merged commit 2b0131a into wildfly-extras:master Feb 17, 2016
jtymel pushed a commit to jtymel/creaper that referenced this pull request Jan 23, 2017
Adding command for adding application-security-domain into Undertow subsystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants