Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

[CMS-415] Update Installation and add Testing sections#27

Open
uberhacker wants to merge 2 commits into
1.xfrom
feature/CMS-415-Update-terminus-secrets-plugin
Open

[CMS-415] Update Installation and add Testing sections#27
uberhacker wants to merge 2 commits into
1.xfrom
feature/CMS-415-Update-terminus-secrets-plugin

Conversation

@uberhacker

Copy link
Copy Markdown

Modified tests to work with Terminus 3.

@uberhacker uberhacker changed the title Update Installation and add Testing sections [CMS-415] Update Installation and add Testing sections Dec 28, 2021
Comment thread README.md Outdated
## Installation
For help installing, see [Manage Plugins](https://pantheon.io/docs/terminus/plugins/)

### Installing Secrets 3.x:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only the Build Tools plugin has different major versions that align to different Terminus versions. Other plugins have a single version that may be installed on Terminus 3 or Terminus 2.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Would Installing Secrets in Terminus 3.x be better?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah; see README of the Terminus plugin example, and follow that format.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated.

Comment thread README.md Outdated

```bash
mkdir -p ~/.terminus/plugins
composer create-project -d ~/.terminus/plugins pantheon-systems/terminus-secrets-plugin:~1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need the ~1, do we?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Probably not.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed.

Update README.md as suggested by Greg
@uberhacker uberhacker force-pushed the feature/CMS-415-Update-terminus-secrets-plugin branch from 0d76aa6 to 50c53ac Compare December 31, 2021 08:03
Comment thread composer.json
"cs": "PATH=tools/bin:$PATH phpcs --standard=PSR2 -n src Commands",
"cbf": "PATH=tools/bin:$PATH phpcbf --standard=PSR2 -n src Commands",
"functional": "PATH=tools/bin:$PATH bats tests/functional",
"cs": "PATH=vendor/bin:$PATH phpcs --standard=PSR2 -n src Commands",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you want to move the tools to vendor/bin, then you will also need to add them to require-dev. However, this won't work for bats. If we want to remove the "install tools" step, maybe we should switch to phpunit-based testing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is actually correcting a bug. The phpcs and phpcbf executables are located in vendor/bin, not tools/bin. It might make sense to remove the PATH=... line and just call vendor/bin/phpcs directly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

require-dev is empty in this composer.json, ergo, phpcs et. al. probably won't be found there.

The design / setup of the tests were intended to allow the tests to be run without installing any dev dependencies into the vendor directory. This was done due to the limitations of Terminus 2, where dev dependencies would often conflict with Terminus' own dependencies. The way the plugin avoided dev dependencies was via the install-bats commands & etc., which installs them to tools. Setting the PATH and then calling bats allowed the tests to be run in environments that had a global bats and an empty tool directory, or in environments that used the install-bats script to install it to tools.

Since Terminus 3 no longer has the restriction on dev dependencies, we could do as you suggest and just call vendor/bin/phpcs directly. However, to do that you'd have to add phpcs to require-dev. Also, bats can't be installed via Composer. I suppose that you could keep the install-bats trick and use require-dev for just the PHP tools if you wanted.

It would be a good idea to turn on testing for GitHub actions, so that we don't need to worry about the Circle permissions. It wouldn't be hard to make Circle run again, but GitHub actions are probably a better example for open source repositories.

@uberhacker uberhacker Jan 11, 2022

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you for the feedback. I'm a bit confused. Doesn't COMPOSER_BIN_DIR=../../vendor/bin cause phpcs to be installed in the vendor directory? This is what I experienced in my testing. If you execute composer install-tools then vendor/bin/phpcs works, hence the proposed change to fix. What are you thoughts regarding the new Testing section in README.md?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@greg-1-anderson: How should we proceed with this PR? The most recent merge has created a merge conflict. Should I just close?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants