Skip to content

Upstream config changes#29

Merged
UltraBob merged 6 commits intomainfrom
upstream-config-changes
Mar 25, 2026
Merged

Upstream config changes#29
UltraBob merged 6 commits intomainfrom
upstream-config-changes

Conversation

@UltraBob
Copy link
Owner

@UltraBob UltraBob commented Mar 24, 2026

The Issue

Upstream Drupal core and GitLab CI template configs drift over time. There was no automated way to detect changes or apply updates, and the DDEV addon checker flagged files missing trailing newlines.

How This PR Solves The Issue

  • Adds scripts/sync-upstream-configs.sh — a maintainer script that fetches latest configs from Drupal core and GitLab CI templates, compares against local assets with smart diffing (strips DCQ headers, normalizes cspell arrays populated by prepare-cspell.php, handles phpstan baseline blocks), and optionally applies updates via --update
  • Adds a weekly GitHub Actions workflow that runs the sync check on main and opens an issue when upstream drift is detected
  • Normalizes trailing newlines on fetched files so the DDEV addon update checker doesn't flag them
  • Applies the current upstream config updates (stylelintrc viewport units, eslintrc.jquery trailing newline)

Automated Testing Overview

Expands the full install bats test with detection accuracy assertions for every wrapper command:

  • True positives: tools catch known violations (PHPStan errors, PHPCS sniffs, ESLint/Stylelint/Prettier issues, CSpell typos, PHP syntax errors)
  • True negatives: clean code passes all tools
  • Exclusion paths: contrib code is not flagged

Adds Docker volume cleanup (mariadb, mutagen, snapshots) in test teardown to prevent accumulation across runs.

Manual Testing Instructions

ddev add-on get https://github.com/UltraBob/ddev-drupal-code-quality/tarball/refs/pull/29/head
ddev restart

Release/Deployment Notes

New maintainer script at scripts/sync-upstream-configs.sh — not shipped to end users. The GitHub Actions workflow requires no additional setup beyond merging.

… cleanup

Add a maintainer script that fetches the latest config files from Drupal core
and GitLab CI templates, compares them against local assets, and optionally
applies updates. A weekly GitHub Actions workflow detects upstream drift and
opens an issue when changes are found.

Expand the full install test with detection accuracy assertions for every
wrapper command: true positives (tools catch known violations), true negatives
(clean code passes), and exclusion path tests (contrib code is not flagged).

Clean up Docker volumes (mariadb, mutagen, snapshots) in test teardown to
prevent accumulation across test runs.
The local .cspell.json asset has populated ignorePaths, dictionaries,
dictionaryDefinitions, and words arrays (expanded by prepare-cspell.php
at install time). Upstream has empty arrays. Strip these from both sides
before comparing so the script only flags structural changes to fields
like description, flagWords, and overrides.

Also revert accidental asset updates from test run.
The DDEV addon update checker requires files to end with a newline, but
some upstream files lack one. Add trailing newline to .eslintrc.jquery.json
and normalize fetched files in the sync script so the difference doesn't
cause false positives.
Resolve conflict in sync script: keep trailing newline normalization.
@UltraBob UltraBob merged commit 36543a5 into main Mar 25, 2026
3 checks passed
@UltraBob UltraBob deleted the upstream-config-changes branch March 25, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintainer script to gather latest versions of upstream configs

1 participant