Skip to content

Commit

Permalink
Adding testing and local development points to Drupal practice area p…
Browse files Browse the repository at this point in the history
…ages (#1514)

* Update drupal-contrib-first-module-development.md

* Update README.md

* Update drupal-contrib-first-module-development.md

* Update drupal-for-drupal-engineers.md

* Update drupal-contrib-first-module-development.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dmundra and pre-commit-ci[bot] authored Feb 7, 2025
1 parent 15bc710 commit 280943d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
25 changes: 1 addition & 24 deletions practice-areas/engineering/drupal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,4 @@ CivicActions engineers all strive to be very helpful, so it's rare for a questio

## Contributions to drupal.org

We strongly encourage all CivicActioners to look for opportunities to give back to the Drupal community. To track contributions follow the instructions below. Tracking community contributions helps our Practice Area see and appreciate your contributions. It also helps our organization as a whole!

### Update your drupal.org profile

- Go to <https://drupal.org/>.
- Log into your drupal.org account (create one if you do not have one).
- Align it with CivicActions in the "Work" section: Edit profile > Then expand the Work section > Type in "CivicActions" and your Job title.
- Align your role with CivicActions in the "[Contributor roles](https://www.drupal.org/community/contributor-guide/find-your-role)" section: Edit profile > Then expand the Contributor roles section > Type in "CivicActions" in "Organization support".

### Contribution to drupal.org modules and themes

If you have created or are creating a module or a theme and use CivicActions time to work on it — either for a client or as professional development/community participation time — please make sure to add CivicActions under "Supporting organizations" when editing the module or theme. An example screenshot of what the checkbox looks like:

![Supporting organizations field screenshot seen in Drupal.org module and theme edit forms](../../../assets/images/drupal-pa-support-org-screenshot.png)

Adding the organization will ensure that the module and theme will also be attributed to CivicActions. Examples of that can be seen under [CivicActions Drupal profile page](https://www.drupal.org/civicactions#projects-supported).

### Contributing to drupal.org issues

If you are contributing to drupal.org issues for CivicActions and our customers, please make sure to click the box under "Attribute this contribution". An example screenshot of what the checkbox looks like:

![Attribute this contribution field screenshot seen in Drupal.org issue comment forms](../../../assets/images/drupal-pa-contribution-attribution-screenshot.png)

Checking the box and adding the organization and customer will ensure that any credit you receive will also be attributed to CivicActions and the customer. Examples of that can be seen under [CivicActions Drupal profile page](https://www.drupal.org/civicactions#org-page-issue-credit).
Review [Contribution to drupal.org modules and themes](./drupal-for-drupal-engineers.md#contribution-to-drupalorg-modules-and-themes).
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ When a new module is needed we try to follow [Contrib First](../../../common-pra
4. If opting to build a new module:
- Choose a meaningful search engine friendly module name. (crowd sourcing name suggestions is recommended)
- Create the Drupal project on Drupal.org
- Populate the project page with a description of what is coming. List supporters as CivicActions and the client [directions](./README.md#contribution-to-drupalorg-modules-and-themes). If the client does not have a drupal.org page, get help from your PM to encourage them to create one.
- Populate the project page with a description of what is coming. List supporters as CivicActions and the client [directions](./drupal-for-drupal-engineers.md#contribution-to-drupalorg-modules-and-themes). If the client does not have a drupal.org page, get help from your PM to encourage them to create one.
5. Populate the issue queue on the Drupal project with "Feature requests". Keep them as atomic as possible. Mark any that are part of the MVP as "major". Create issues for any improvement ideas that emerge. They don't all have to be acted on, but they help shape the road map for where you want the module to go.
6. Close the issues as you go and be sure to credit yourself, CivicActions, and the client.
7. Begin with alpha releases. Ideally when all your MVP/major issues are closed, you are ready for the official release.
8. After the official release, opt in to [Drupal security coverage](https://www.drupal.org/drupal-security-team/security-advisory-process-and-permissions-policy).
6. Add [DDEV](https://github.com/ddev/ddev-drupal-contrib) to your module to allow easy building of [local environments](./drupal-for-drupal-engineers.md#local-development) for you and others to work on the module.
7. Add [tests](https://www.drupal.org/docs/develop/creating-modules/basic-module-building-tutorial-lorem-ipsum-generator/testing-a-drupal-module) to your module to ensure [it is working as expected](./drupal-for-drupal-engineers.md#testing).
8. Close the issues as you go and be sure to credit yourself, CivicActions, and the client.
9. Begin with alpha releases. Ideally when all your MVP/major issues are closed, you are ready for the official release.
10. After the official release, opt in to [Drupal security coverage](https://www.drupal.org/drupal-security-team/security-advisory-process-and-permissions-policy).
10 changes: 10 additions & 0 deletions practice-areas/engineering/drupal/drupal-for-drupal-engineers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ When reviewing a change, consider the following factors:
4. Are there any typos or bugs?
5. Does the code make any assumptions that may not always be true? For example, assuming an array key exists that might not?

## Local development

CivicActions uses [DDEV](https://ddev.com/) for most project sandboxes and local development. We also use [Lando](https://lando.dev/) as well. Either are recommended over custom docker based solutions.

Check out [DDEV documentation](https://ddev.readthedocs.io/en/stable/) to get a Drupal site running locally in just a few minutes.

## Testing

CivicActions uses a variety of testing frameworks (e.g. PHPUnit and Cypress). For [Drupal, PHPUnit is a core testing framework](https://www.drupal.org/docs/develop/automated-testing/phpunit-in-drupal) that can also be added to custom and [contributed modules](https://www.drupal.org/docs/develop/creating-modules/basic-module-building-tutorial-lorem-ipsum-generator/testing-a-drupal-module). We recommend adding testing as soon as possible so that you are ensuring the functionality is working as expected and features are stable as you add more to it.

## Resources and opportunities

### Drupal practice area
Expand Down

0 comments on commit 280943d

Please sign in to comment.