Skip to content

Commit c5982b9

Browse files
author
Axelerant IDP
committed
Initial commit from IDP scaffolder plugin
1 parent 3e1f943 commit c5982b9

11 files changed

+934
-2
lines changed

docs/automated-testing.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Automated Testing and Continuous Integration
2+
3+
This document outlines the automated testing and continuous integration (CI) processes implemented in this project using GitHub Actions. The workflows cover visual regression testing, Cypress end-to-end tests, general code quality checks, and Platform.sh environment cleaning.
4+
5+
## Visual Regression Testing (VR)
6+
7+
The `vr.yml` workflow file ([/.github/workflows/vr.yml](/.github/workflows/vr.yml)) configures visual regression tests. This ensures that UI changes do not introduce unexpected visual regressions.
8+
9+
### Trigger
10+
11+
* `push` events to any tag
12+
* Manual workflow dispatch
13+
* Weekly schedule: every Monday at 00:00
14+
15+
### Concurrency
16+
17+
This workflow uses concurrency to manage parallel runs, preventing race conditions.
18+
19+
### Job: `vr_test`
20+
21+
* Runs on: `ubuntu-latest`
22+
* Environment Variables:
23+
* `CYPRESS_ADMIN_USERNAME`: Username for the administrative user in Cypress tests.
24+
* `CYPRESS_ADMIN_PASSWORD`: Password for the administrative user in Cypress tests.
25+
* `PERCY_TOKEN`: Token for Percy visual regression testing, retrieved from GitHub Secrets.
26+
* Steps:
27+
1. **Checkout:** Checks out the repository code.
28+
2. **Cache Directories:** Determines cache directories for Composer and npm to speed up subsequent runs.
29+
30+
## Cypress Tests
31+
32+
The `cypress-tests.yml` workflow file ([/.github/workflows/cypress-tests.yml](/.github/workflows/cypress-tests.yml)) configures end-to-end tests using Cypress ([https://www.cypress.io/](https://www.cypress.io/)).
33+
34+
### Trigger
35+
36+
* Weekly schedule: every Sunday at 00:00
37+
38+
### Job: `cypress_tests`
39+
40+
* Runs on: `ubuntu-latest`
41+
* Environment Variables:
42+
* `CYPRESS_ADMIN_USERNAME`: Username for the administrative user in Cypress tests.
43+
* `CYPRESS_ADMIN_PASSWORD`: Password for the administrative user in Cypress tests.
44+
* Steps:
45+
1. **Checkout:** Checks out the repository code.
46+
2. **Setup DDEV:** Sets up the DDEV local development environment.
47+
3. **Configure Platform.sh Token:** Configures the Platform.sh token (details on how this is configured TBD).
48+
4. **Install Dependencies:** Installs dependencies using Composer.
49+
5. **Database Operations:** Performs database import and update operations.
50+
51+
## Continuous Integration (CI) for Code Quality
52+
53+
The `ci.yml` workflow file ([/.github/workflows/ci.yml](/.github/workflows/ci.yml)) defines code quality checks to maintain a high standard of code.
54+
55+
### Trigger
56+
57+
* `push` events to the `main` branch or any tag
58+
* `pull_request` events
59+
60+
### Concurrency
61+
62+
This workflow uses concurrency to manage parallel runs, preventing race conditions.
63+
64+
### Job: `drupal_codequality`
65+
66+
* Runs on: `ubuntu-latest`
67+
* Uses the `hussainweb/drupalqa-action@v2` action to perform Drupal-specific code quality checks:
68+
* `phplint`: Checks PHP syntax.
69+
* `yamllint`: Checks YAML syntax.
70+
* `jsonlint`: Checks JSON syntax.
71+
* `phpcs`: Checks PHP coding standards.
72+
* `phpmd`: Checks PHP for potential problems.
73+
* `twigcs`: Checks Twig template coding standards.
74+
* PHP Version: 8.2
75+
76+
### Job: `frontend_codequality`
77+
78+
* Runs inside a `node:20` container.
79+
* Performs frontend code quality checks (details on what checks are performed TBD).
80+
81+
## Platform.sh Environment Cleaning
82+
83+
The `pr-close.yml` workflow file ([/.github/workflows/pr-close.yml](/.github/workflows/pr-close.yml)) handles cleaning up Platform.sh environments when a pull request is closed, to avoid resource exhaustion.
84+
85+
### Trigger
86+
87+
* Triggered when a pull request is closed.
88+
89+
### Job: `on-pr-close`
90+
91+
* Runs on: `ubuntu-latest`
92+
* Uses the `axelerant/platformsh-action@v1` to clean up the Platform.sh environment associated with the pull request:
93+
* Action: `clean-pr-env`
94+
* `PLATFORMSH_CLI_TOKEN`: Authentication token for the Platform.sh CLI, retrieved from GitHub Secrets.
95+
* `project-id`: `brbqplxd7ycq6` (Platform.sh Project ID)

docs/ci-cd.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# CI/CD Configuration
2+
3+
This section details the Continuous Integration and Continuous Deployment (CI/CD) workflows implemented in this project, leveraging GitHub Actions. These workflows automate tasks such as code quality assurance, visual regression testing, and environment management.
4+
5+
## Workflow Overview
6+
7+
The following workflows are defined:
8+
9+
* VR (Visual Regression)
10+
* Clean Platform.sh env on PR Close
11+
* Cypress Tests
12+
* CI (Continuous Integration)
13+
14+
Each workflow is described in detail below, including its triggers, jobs, and configurations.
15+
16+
## Workflow Details
17+
18+
### VR (Visual Regression)
19+
20+
* **File:** [.github/workflows/vr.yml](/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/.github/workflows/vr.yml)
21+
* **Name:** VR
22+
* **Description:** This workflow executes visual regression tests to identify unintended visual changes in the application.
23+
* **Triggers:**
24+
* `push` on tags (any tag). This allows VR tests to be run when new versions are tagged.
25+
* `workflow_dispatch` (manual trigger). This enables on-demand execution of the VR tests.
26+
* Scheduled Cron job: Runs every Monday at 00:00 (UTC). This provides regular automated VR testing.
27+
* **Concurrency:** This workflow ensures that only one VR test runs at a time for a given Git ref, cancelling in-progress runs to avoid conflicts and ensure accurate results.
28+
* **Job:** `vr_test`
29+
* **Runs On:** `ubuntu-latest`
30+
* **Environment Variables:**
31+
* `CYPRESS_ADMIN_USERNAME`: Retrieved from GitHub Secrets.
32+
* `CYPRESS_ADMIN_PASSWORD`: Retrieved from GitHub Secrets.
33+
* `PERCY_TOKEN`: Retrieved from GitHub Secrets. This token is required for authenticating with Percy, the visual regression testing service.
34+
* **Steps:**
35+
1. **Checkout Code:** Checks out the repository code.
36+
2. **Cache Management:** Gets cache directories for both Composer (PHP dependencies) and npm (Node.js dependencies) to speed up subsequent runs.
37+
3. **[Further steps truncated, but presumably involve running Visual Regression tests using Cypress and Percy.]**
38+
39+
### Clean Platform.sh env on PR Close
40+
41+
* **File:** [.github/workflows/pr-close.yml](/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/.github/workflows/pr-close.yml)
42+
* **Name:** Clean Platform.sh env on PR Close
43+
* **Description:** This workflow automates the cleanup of Platform.sh environments created for pull requests after the pull request is closed. This helps to manage resources and avoid unnecessary costs.
44+
* **Trigger:** `pull_request` event when a pull request is `closed`.
45+
* **Job:** `on-pr-close`
46+
* **Runs On:** `ubuntu-latest`
47+
* **Action:** `axelerant/platformsh-action@v1` - Uses a dedicated GitHub Action to interact with the Platform.sh API.
48+
* **Configuration:**
49+
* `action`: `clean-pr-env` - Specifies the action to perform: cleaning up the PR environment.
50+
* `project-id`: `brbqplxd7ycq6` - The Platform.sh project ID.
51+
* `cli-token`: Fetches the Platform.sh CLI token from `secrets.PLATFORMSH_CLI_TOKEN`. This token is required to authenticate with the Platform.sh API.
52+
53+
### Cypress Tests
54+
55+
* **File:** [.github/workflows/cypress-tests.yml](/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/.github/workflows/cypress-tests.yml)
56+
* **Name:** Cypress Tests
57+
* **Description:** This workflow runs Cypress end-to-end tests to ensure the application functions correctly from a user perspective.
58+
* **Trigger:** Scheduled Cron job: Runs every Sunday at 00:00 (UTC).
59+
* **Job:** `cypress_tests`
60+
* **Runs On:** `ubuntu-latest`
61+
* **Environment Variables:**
62+
* `CYPRESS_ADMIN_USERNAME`: Retrieved from GitHub Secrets.
63+
* `CYPRESS_ADMIN_PASSWORD`: Retrieved from GitHub Secrets.
64+
* **Steps:**
65+
1. **Checkout Code:** Checks out the repository code.
66+
2. **Set up DDEV:** Uses `ddev/github-action-setup-ddev@v1` to set up DDEV, a local development environment, disabling autostart.
67+
3. **Configure Platform.sh Token**: Configures the Platform.sh token in DDEV's web environment.
68+
4. **Start DDEV:** Starts the DDEV environment.
69+
5. **Install Dependencies:** Installs PHP dependencies using `ddev composer install`.
70+
6. **[Further steps truncated, but presumably involve running Cypress tests.]**
71+
72+
### CI (Continuous Integration)
73+
74+
* **File:** [.github/workflows/ci.yml](/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/.github/workflows/ci.yml)
75+
* **Name:** CI
76+
* **Description:** This workflow performs continuous integration tasks, including code quality checks, on every push to the `main` branch, tags, and pull requests.
77+
* **Triggers:**
78+
* `push` on the `main` branch and any tag.
79+
* `pull_request` (all pull requests).
80+
* **Concurrency:** Ensures only one CI workflow runs at a time for a given Git ref, cancelling any in-progress runs.
81+
* **Jobs:**
82+
* `drupal_codequality`:
83+
* **Runs On:** `ubuntu-latest`
84+
* **Steps:**
85+
1. **Checkout Code:** Checks out repository code.
86+
2. **Run Drupal Code Quality Checks:** Uses `hussainweb/drupalqa-action@v2` to perform Drupal-specific code quality checks.
87+
* **Configuration:**
88+
* `php-version`: `8.2` - Specifies the PHP version to use for the checks.
89+
* `checks`: Defines the checks to run, including `phplint`, `yamllint`, `jsonlint`, `phpcs`, `phpmd`, and `twigcs`, using GrumPHP.
90+
* `frontend_codequality`:
91+
* **Runs On:** `ubuntu-latest`
92+
* **Container:** `node:20` - Runs inside a Node.js 20 container.
93+
* **[Further steps truncated, but presumably involve running front-end code quality checks.]**
94+
95+
## Summary
96+
97+
These workflows collectively establish a comprehensive CI/CD pipeline. They ensure that code is automatically validated and tested upon commits, pull requests, and at scheduled intervals. This process facilitates rapid feedback, reduces errors, and promotes code quality across the project.

docs/content-structure.md

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# Drupal Project Content Structure Documentation
2+
3+
This document provides a comprehensive overview of the content structure within the Drupal project. It outlines the content types, taxonomies, views, content moderation practices, user information, menus, and block content types, offering a clear understanding of how content is organized and managed.
4+
5+
## Content Types
6+
7+
Content types define the structure and fields for different content entities within the project.
8+
9+
* **Page:**
10+
* **Description:** Basic static content pages.
11+
12+
* **Non Code Contributions:**
13+
* **Description:** Captures information about contributions that do not involve coding. Examples include blog posts, documentation, and translations.
14+
* **Fields:**
15+
* Contribution Author
16+
* Contribution Date
17+
* Technology (Reference to the Technology taxonomy)
18+
* Type (Blog, Stack Overflow, Localisation)
19+
* Profile link
20+
* Credit
21+
22+
* **Issue:**
23+
* **Description:** Represents issues (bug reports, feature requests, tasks) and is used to link them to code contributions.
24+
* **Fields:**
25+
* Link to the issue
26+
27+
* **Event Contributions:**
28+
* **Description:** Records contributions made during specific events, such as conferences or sprints.
29+
* **Fields:**
30+
* Event (Reference to the Event content type)
31+
* Contribution Type (Reference to the Event Contribution Type taxonomy)
32+
* Contribution Link
33+
* Technology (Reference to the Technology taxonomy)
34+
* Contribution Author
35+
* Contribution Date
36+
* Contribution Comments
37+
38+
* **Event:**
39+
* **Description:** Represents events that are referenced in event contributions.
40+
* **Fields:**
41+
* Event Dates
42+
* Event Type (Reference to the Event Type taxonomy)
43+
* Event Location
44+
* Event Address
45+
* Event Link
46+
* Event Additional Links
47+
48+
* **Code contributions:**
49+
* **Description:** Captures details about code contributions.
50+
* **Fields:**
51+
* Contribution Project (Reference to the Project taxonomy)
52+
* Contribution Issue Link
53+
* Contribution Type (Reference to the Contribution Type taxonomy)
54+
* Contribution Link
55+
* Contribution Details
56+
57+
## Taxonomies
58+
59+
Taxonomies are used to categorize and classify content, enabling better organization and filtering.
60+
61+
* **Technology:**
62+
* **Description:** Used to categorize contributions by the technologies they relate to.
63+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.technology.yml`
64+
65+
* **Tags:**
66+
* **Description:** Used for free-form tagging of articles on similar topics.
67+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.tags.yml`
68+
69+
* **Project:**
70+
* **Description:** Stores projects related to community contributions.
71+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.project.yml`
72+
73+
* **Event Type:**
74+
* **Description:** Stores the types of events, such as DrupalCamp or DrupalCon.
75+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.event_type.yml`
76+
77+
* **Event Contribution Type:**
78+
* **Description:** Stores the types of contributions made at events (e.g., session, volunteering).
79+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.event_contribution_type.yml`
80+
81+
* **Contribution Type:**
82+
* **Description:** Stores the different types of contributions (e.g., submitting a patch, porting a module).
83+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/taxonomy.vocabulary.contribution_type.yml`
84+
85+
## Views
86+
87+
Views are used to create dynamic lists and displays of content.
88+
89+
* **Patches:**
90+
* **Description:** Lists all patches.
91+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.patches.yml`
92+
93+
* **Patches on issues:**
94+
* **Description:** Lists patches associated with specific issues.
95+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.patches_on_issues.yml`
96+
97+
* **Non code contributions:**
98+
* **Description:** Lists all non-code contributions.
99+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.non_code_contributions.yml`
100+
101+
* **Event Contributions:**
102+
* **Description:** Lists all event contributions.
103+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.event_contributions.yml`
104+
105+
* **All Contributions:**
106+
* **Description:** Aggregates all types of contributions into a single view.
107+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.all_contributions.yml`
108+
109+
* **Code contributions:**
110+
* **Description:** Lists all code contributions.
111+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.code_contributions.yml`
112+
113+
* **Content:**
114+
* **Description:** Provides an administrative interface for finding and managing content.
115+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.content.yml`
116+
117+
* **Recent content:**
118+
* **Description:** Lists recently created content.
119+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.content_recent.yml`
120+
121+
* **Files:**
122+
* **Description:** Provides an administrative interface for listing and managing files.
123+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.files.yml`
124+
125+
* **Frontpage:**
126+
* **Description:** Lists content that has been promoted to the front page.
127+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.frontpage.yml`
128+
129+
* **People:**
130+
* **Description:** Provides an administrative interface for finding and managing user accounts.
131+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.user_admin_people.yml`
132+
133+
* **Taxonomy term:**
134+
* **Description:** Lists content associated with a specific taxonomy term.
135+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/views.view.taxonomy_term.yml`
136+
137+
## Content Moderation
138+
139+
* A "Contribution Moderator" role is defined, which can approve contributions by flagging them. The flag configuration is located at `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/flag.flag.contribution_approval.yml`.
140+
141+
## User Information
142+
143+
* Drupal.org and Github usernames are tracked via custom fields on the user entity.
144+
* `field_do_username` configuration is located at `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/field.storage.user.field_do_username.yml`.
145+
* `field_github_username` configuration is located at `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/field.storage.user.field_github_username.yml`.
146+
147+
## Menus
148+
149+
Menus provide navigation and structure to the site.
150+
151+
* **Main navigation:**
152+
* **Description:** Provides links to the main sections of the site.
153+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/system.menu.main.yml`
154+
155+
* **Footer:**
156+
* **Description:** Contains links to site information, such as legal notices and contact information.
157+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/system.menu.footer.yml`
158+
159+
* **Tools:**
160+
* **Description:** Contains links to user tools, often added by modules.
161+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/system.menu.tools.yml`
162+
163+
* **Adminstration:**
164+
* **Description:** Exposes links related to administrative tasks.
165+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/system.menu.admin.yml`
166+
167+
## Block Content Types
168+
169+
Basic blocks are used for reusable content snippets.
170+
171+
* **Social Sharing:**
172+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/fixed_block_content.fixed_block_content.social_sharing.yml`
173+
* **Quick Links:**
174+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/fixed_block_content.fixed_block_content.quick_links.yml`
175+
* **Blog:**
176+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/fixed_block_content.fixed_block_content.blog.yml`
177+
* **Axelerant Logo:**
178+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/fixed_block_content.fixed_block_content.axelerant_logo.yml`
179+
* **Axelerant Footer:**
180+
* **Configuration:** `/tmp/12493156-1e7a-4ef2-8ddf-88c8f2d5c76f/repo-dir/config/sync/fixed_block_content.fixed_block_content.axelerant_footer.yml`

0 commit comments

Comments
 (0)