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

Port simplesamlphp targets to Robo. #1485

Merged
merged 4 commits into from
May 10, 2017
Merged

Conversation

malikkotob
Copy link
Contributor

No description provided.

@malikkotob malikkotob force-pushed the port-saml-targets branch from e964a0a to c5f38ef Compare May 8, 2017 15:03
@grasmash grasmash added the Enhancement A feature or feature request label May 8, 2017
@malikkotob malikkotob force-pushed the port-saml-targets branch 2 times, most recently from 8f23fd5 to 47ee379 Compare May 9, 2017 13:58
@malikkotob malikkotob closed this May 9, 2017
@malikkotob malikkotob deleted the port-saml-targets branch May 9, 2017 17:41
@malikkotob malikkotob restored the port-saml-targets branch May 9, 2017 17:41
@malikkotob malikkotob reopened this May 9, 2017
@malikkotob malikkotob force-pushed the port-saml-targets branch 2 times, most recently from 3b045f2 to 51b2ee0 Compare May 9, 2017 19:47
$composerBin = $this->getConfigValue('composer.bin');
$projectConfigFile = $this->getConfigValue('blt.config-files.project');
$this->say("Updating ${projectConfigFile}...");
$result = $this->taskExec("{$composerBin}/yaml-cli update:value")
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably just use Yaml CLI's classes to do this more directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm would that look like? The classes I see provided by grasmash/yaml-cli are all command files with protected methods (unless I'm looking in the wrong place).

* @return bool
*/
public function isSimpleSamlPhpInstalled() {
return $this->getConfig()->has('simplesamlphp') && $this->getConfigValue('simplesamlphp');
Copy link
Contributor

Choose a reason for hiding this comment

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

Please move this to the Inspector class. This command should be able to access the method via $this->getInspector()->isSimpleSamlPhpInstalled();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

$this->say('SimpleSAMLphp has already been initialized by BLT.');
}
$this->simpleSamlPhpInitComplete();
if (isset($result)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should returns something in all instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

* @return \Robo\Result
* @throws \Exception
*/
protected function simpleSamlPhpLibInit() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The method names don't all need to start with simpleSamlPhp, since this file is dedicated to that namespace. I'd suggest something more descriptive like requirePackages() or requireModule()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh right - fixing that

*
* @command simplesamlphp:config:init
*/
public function simpleSamlPhpConfigInit() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also begin method names with verbs where possible. E.g., initializeConfig().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

* @command simplesamlphp:build:config
*/
public function simpleSamlPhpBuildConfig() {
$this->say('Copying config files to the appropriate place in simplesamlphp library.');
Copy link
Contributor

Choose a reason for hiding this comment

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

For statements using the present participle, please end with an ellipsis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

*
* @return \Robo\Result
*
* @command simplesamlphp:build:config
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make @command the first annotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

$this->say("


============================================================================
Copy link
Contributor

@grasmash grasmash May 9, 2017

Choose a reason for hiding this comment

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

I'm not crazy about the usage of the === as a separator here or the hardcoding of whitespace, since we don't do anything else like this in BLT. I'd prefer to use Symfony Console formatting if necessary. E.g., use <comment> or <info> wrappers to colorize, and blocks if necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I honestly just copy/pasted from the phing project - I'll fix this up

@grasmash
Copy link
Contributor

grasmash commented May 9, 2017

@malikkotob Well done!

I've added some comments, largely requesting stylistic changes.

@malikkotob malikkotob force-pushed the port-saml-targets branch from 51b2ee0 to 17a27e9 Compare May 10, 2017 13:41
@malikkotob
Copy link
Contributor Author

@grasmash I've addressed everything but the Yaml CLI issue - let me know your thoughts on my question on that

@malikkotob malikkotob force-pushed the port-saml-targets branch from 17a27e9 to b2d657c Compare May 10, 2017 13:46
@malikkotob malikkotob force-pushed the port-saml-targets branch from b2d657c to 15f63d3 Compare May 10, 2017 14:12
@grasmash grasmash merged commit 59f6a44 into acquia:8.x May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants