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

Feature/digital 27 create default content #25

Merged
merged 13 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/run-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Run validation with RoboValidate
cathybaptista marked this conversation as resolved.
Show resolved Hide resolved

cathybaptista marked this conversation as resolved.
Show resolved Hide resolved
on:
cathybaptista marked this conversation as resolved.
Show resolved Hide resolved
# Run on any branch so validate branch can always run.
cathybaptista marked this conversation as resolved.
Show resolved Hide resolved
push:
cathybaptista marked this conversation as resolved.
Show resolved Hide resolved
# Commit message validation requires a target branch which is only available in a PR.
cathybaptista marked this conversation as resolved.
Show resolved Hide resolved
pull_request:

jobs:
validate:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer:v2
# https://github.com/shivammathur/setup-php?tab=readme-ov-file#disable-coverage
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer

- name: Install Composer dependencies and initialize Robo
run: |
composer install --ignore-platform-reqs --optimize-autoloader --no-progress --no-ansi
# If a Robo command exits with a failure and a RoboFile.php does not exist
# a warning about 'Robo is not initialized here. Please run `robo init` to create a new RoboFile.'
# will be created, which might make users think that is what the error was caused by.
if [ ! -f "RoboFile.php" ]; then
vendor/bin/robo init
fi

- name: Validate a change to any branch
if: github.event_name == 'push'
run: |
# Initialize status variables to 0
status1=0
status2=0
status3=0

# Run all commands and capture their exit statuses
vendor/bin/robo validate:branch-name || status1=$? || status1=0
vendor/bin/robo validate:composer-lock || status3=$? || status3=0
vendor/bin/robo validate:coding-standards || status2=$? || status2=0

# Exit with a non-zero status if any command failed
if [ "$status1" -ne 0 ] || [ "$status2" -ne 0 ] || [ "$status3" -ne 0 ]; then
exit 1
fi

- name: Validate pull requests
if: github.event_name == 'pull_request'
run: |
vendor/bin/robo validate:commit-messages --target-branch="${{ github.base_ref }}" --current-branch="${{ github.head_ref }}"
22 changes: 18 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,22 @@ Simply edit or add new content, then run `./robo.sh drupal-project:export-conten

## Validation

We will soon have validation on branches, commits, composer.lock, and code. I'm waiting until our move to Jira.
* Uses [RoboValidate](https://github.com/mattsqd/robovalidate) to run the various validations.
* Can be run manually locally via: `./robo.sh validate:all`
* Is run when any branch is pushed to GitHub via GitHub Actions. Validation on Git commits is only run remotely when a pull request is made so that only new commits are checked.

To start:
* Follow Drupal & DrupalPractice coding standards.
* Create feature branches in the form `feature/short-description`
### Branch Names

All branches created towards tasks should be in the form `feature/DIGITAL-X-Y`. `X` is the Jira ticket number and `Y` is a short description in lower case separated by dashes.

### Commits

Commit messages must be in the form: `DIGITAL-X:YZ`. `X` is the Jira ticket number, `Y` is a space and `Z` is a short description of the work done.

### Coding Standards

See the [coding standards](https://www.drupal.org/docs/develop/standards) documentation for Drupal. The project validates against the `Drupal` and `DrupalPractice` documentation.

#### IDE

[Enable coding standards help in your IDE](https://www.drupal.org/docs/extending-drupal/contributed-modules/contributed-module-documentation/coder/installing-coder#s-ide-and-editor-configuration) so you're not surprised by a bunch of errors when you push up.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"drush/drush": "^12.5",
"league/commonmark": "^2.5",
"mattsqd/drupal-env": "dev-main",
"mattsqd/drupal-env-lando": "dev-main"
"mattsqd/drupal-env-lando": "dev-main",
"mattsqd/robovalidate": "@alpha"
},
"conflict": {
"drupal/drupal": "*"
Expand Down
53 changes: 51 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions composer.log
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ ae2759e9c45acbf0d8378d04e842d0a8|Matt Poole|develop|Tue Jul 2 13:45:43 EDT 2024
8a86ff66fb8673b6889c9c4b0ab02673|Christian Medders|feature/config-content-types|Fri Oct 11 10:58:09 EDT 2024|./composer.sh require drupal/field_group
4df8b37fbf31532557c120dddc00593b|Cathy Baptista|feature/dg-26-add-paragraphs-to-content-types|Fri Oct 11 12:00:34 EDT 2024|./composer.sh require drupal/paragraphs
834a753fafaa65adba97795d28e5f6b0|Christian Medders|feature/dg-25-enable-auto-complete|Tue Oct 15 14:25:50 EDT 2024|./composer.sh require drupal/inline_entity_form:^3.0@RC
85ee634efd1237c31d3f2d88c373a543|Matt Poole|feature/DIGITAL-36-validate-action|Thu Oct 17 16:16:53 EDT 2024|./composer.sh require mattsqd/robovalidate:@alpha
18 changes: 0 additions & 18 deletions config/sync/core.entity_form_display.node.authors.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ dependencies:
- field.field.node.authors.field_agency_acronym
- field.field.node.authors.field_agency_full_name
- field.field.node.authors.field_bio
- field.field.node.authors.field_bio_image
- field.field.node.authors.field_bio_url
- field.field.node.authors.field_display_name
- field.field.node.authors.field_email
- field.field.node.authors.field_facebook
- field.field.node.authors.field_first_name
Expand All @@ -28,7 +26,6 @@ dependencies:
- content_moderation
- field_group
- link
- media_library
- text
third_party_settings:
field_group:
Expand Down Expand Up @@ -98,13 +95,6 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
field_bio_image:
type: media_library_widget
weight: 19
region: content
settings:
media_types: { }
third_party_settings: { }
field_bio_url:
type: link_default
weight: 18
Expand All @@ -113,14 +103,6 @@ content:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_display_name:
type: text_textfield
weight: 8
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_email:
type: email_default
weight: 12
Expand Down
18 changes: 0 additions & 18 deletions config/sync/core.entity_view_display.node.authors.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ dependencies:
- field.field.node.authors.field_agency_acronym
- field.field.node.authors.field_agency_full_name
- field.field.node.authors.field_bio
- field.field.node.authors.field_bio_image
- field.field.node.authors.field_bio_url
- field.field.node.authors.field_display_name
- field.field.node.authors.field_email
- field.field.node.authors.field_facebook
- field.field.node.authors.field_first_name
Expand Down Expand Up @@ -63,15 +61,6 @@ content:
third_party_settings: { }
weight: 110
region: content
field_bio_image:
type: entity_reference_entity_view
label: above
settings:
view_mode: default
link: false
third_party_settings: { }
weight: 112
region: content
field_bio_url:
type: link
label: above
Expand All @@ -84,13 +73,6 @@ content:
third_party_settings: { }
weight: 111
region: content
field_display_name:
type: text_default
label: above
settings: { }
third_party_settings: { }
weight: 102
region: content
field_email:
type: basic_string
label: above
Expand Down
4 changes: 0 additions & 4 deletions config/sync/core.entity_view_display.node.authors.teaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ dependencies:
- field.field.node.authors.field_agency_acronym
- field.field.node.authors.field_agency_full_name
- field.field.node.authors.field_bio
- field.field.node.authors.field_bio_image
- field.field.node.authors.field_bio_url
- field.field.node.authors.field_display_name
- field.field.node.authors.field_email
- field.field.node.authors.field_facebook
- field.field.node.authors.field_first_name
Expand Down Expand Up @@ -50,9 +48,7 @@ hidden:
field_agency_acronym: true
field_agency_full_name: true
field_bio: true
field_bio_image: true
field_bio_url: true
field_display_name: true
field_email: true
field_facebook: true
field_first_name: true
Expand Down
29 changes: 0 additions & 29 deletions config/sync/field.field.node.authors.field_bio_image.yml

This file was deleted.

24 changes: 0 additions & 24 deletions config/sync/field.field.node.authors.field_display_name.yml

This file was deleted.

20 changes: 0 additions & 20 deletions config/sync/field.storage.node.field_bio_image.yml

This file was deleted.

20 changes: 0 additions & 20 deletions config/sync/field.storage.node.field_display_name.yml

This file was deleted.

Loading
Loading